What are difference between Monolithic kernel architecture & Microkernel architecture

What are difference between Monolithic kernel architecture & Microkernel architecture

Post by Richard L » Thu, 26 Aug 1999 04:00:00



Hi
I am interested in the Linux kernel. I knew the Linux kernel use monolithic
kernel architecture. Anyway, I have no idea about monolithic kernel
architecture and what differ from microkernel architecture.
Best regards,
Richard
 
 
 

What are difference between Monolithic kernel architecture & Microkernel architecture

Post by Eugen » Thu, 26 Aug 1999 04:00:00




Quote:>Hi
>I am interested in the Linux kernel. I knew the Linux kernel use monolithic
>kernel architecture. Anyway, I have no idea about monolithic kernel
>architecture and what differ from microkernel architecture.
>Best regards,
>Richard

The difference are in what kernel does. Monolitic kernel always sits
in the memory with its different parts providing different services
(memory management, file system, etc.). Its disadvantage - modern
OSes are quite complex, so the kernel itself becomes a very complex
peice of software (it took a lot of people around the world to develop
Linux). As a result, it might be argued it is impossible to create
using "Cathedral" development form.

Microkernel is a very small piece of code that does only one thing: it
knows when and where to find and load the module whose services
are needed at the moment. All services are done by the modules.
Its disadvantage - it is slower then monolitic kernel (I am going to
get flamed here, this is one of the subjects for "holy war''). Another
thing - I suspect it is a nightmare to check all possible interaction
between the modules - witness Hurd - it is still not usable at this
point.

Hope it answers your question.

Eugene.

 
 
 

What are difference between Monolithic kernel architecture & Microkernel architecture

Post by Peter Samuels » Thu, 26 Aug 1999 04:00:00



Quote:> I am interested in the Linux kernel. I knew the Linux kernel use
> monolithic kernel architecture. Anyway, I have no idea about
> monolithic kernel architecture and what differ from microkernel
> architecture.

You need to understand the concept of "kernel-mode" and "user-mode"
code.  On any decent CPU there are different privilege levels the CPU
can be in at a given time; on the Intel 386 series, for example, there
are four, called Ring 0 (highest) through Ring 3 (lowest).  On any
modern operating system, ordinary user code has to run in a
less-privileged state to prevent it from doing things it is not
authorized for, things like accessing arbitrary memory or arbitrary I/O
ports, or changing memory mappings.  The operating system kernel, or at
least part of it, has to run in a more-privileged state, so that it
*can* access I/O, change memory mappings, etc.  On the 386, if you're
in Ring 0 you get to define with some granularity the things that code
in the other rings can and can't do.

When user code needs to do something the CPU privilege level doesn't
allow, it must make a system call to ask the OS to do it on its behalf.
This switches the CPU from its "user mode" (Ring 3 for Linux/Intel) to
its "kernel mode" (Ring 0 for Linux/Intel).  The kernel takes over and
services the system call, then switches privilege levels back to user
mode and lets the user process continue to run.  When an I/O device or
a system timer triggers a CPU interrupt, again the CPU jumps into
kernel mode and does whatever needs to be done (schedule another
process to run, manage the I/O device, etc).

Now with a monolithic kernel design it is almost that simple.  The
entire kernel runs in kernel mode, i.e. at the higher CPU privilege
level.  With a microkernel design, on the other hand, you have a
minimal "microkernel" which runs in privileged mode, and the rest of
the OS kernel consists of "servers" which run in less-privileged modes
(whatever is needed to get the job done) and are somewhat independent
of the microkernel and of each other.  The microkernel arbitrates
between "ordinary" user processes and the kernel servers.  Servers
would include device drivers, filesystem drivers, modules for memory
management, etc.  They typically communicate with each other by use of
"message passing", that is, sending a packet of some type of
information using infrastructure provided by the microkernel.

There is much research and debate about which approach is better.
Micros have the theoretical advantage of greater separation between
components, which means it should be easier to develop and debug an
individual component, but disadvantages like the speed penalty and code
complexity of message passing.  As for Linux, Linus defends the mono
approach by noting that a well-designed and well-coded mono kernel can
really be just as modular as a microkernel.

--
Peter Samuelson
<sampo.creighton.edu!psamuels>

 
 
 

1. SMP, OOP & Microkernel Architectures

Yes. It really comes down to the fact that C without library support (as
is the case in kernel code) is considerably more feasible than C++
without library support. As a further reference, please see:

http://www.tux.org/lkml/#s1-4

In fact, reading the entire FAQ would doubtless be of great service to
you:

http://www.tux.org/lkml/

HTH,
--ag

[x-posted to comp.os.linux.development.system]

--
Artie Gold, Austin, TX  (finger the cs.utexas.edu account for more info)

--
He looked like hell, but the devil was smiling.

2. chown in 2.5.8pre3

3. Joint USENIX Symposia: Microkernels and other Kernel Architectures and Symposium on Distributed and Multiprocessor Systems

4. Rebuilding kernel w/boot disk (RedHat 5.1)

5. Microkernel, Monolithic kernel, Modular kernel

6. .rhosts goes where?

7. Joint USENIX Symposia: Microkernels and Other Architectures and Experiences with Distributed and Multiprocessor Systems (SEDMS IV)

8. FreeBSD fdisk / label editor

9. a question linux kernel (monolithic vs microkernel)

10. Differences between NT and UNIX SCSI driver architectures and Media Changers

11. Monolithic Vs. Microkernel

12. Switching kernel architectures?

13. add support for PC-9800 architecture (kernel)