Page 1 of 1

Micro-kernel

Posted: Sun Jan 13, 2002 10:20 am
by Jeroen Jacobs
Hi,

I'm trying to understand micro-kernels (without success).
I really don't see the difference between a monolithic kernel and a microkernel.

Assume the following example in a monolithic system (linux?) :

A program wants to read from a file :
program calls int 80h (linux syscall) -> VFS layer -> Ext2 driver -> block device driver.

is this correct ?

Now how does this happen in a microkernel environment ? I heard that microkernels use "mailboxes" to exchange information (which sounds like a nice concept but I really don't understand how this is accomplished in a real OS like Mach or NT or BeOS).

Can someone please give me some more info on this ??

Thnx in advance,


Jeroen Jacobs

Re: Micro-kernel

Posted: Sun Feb 17, 2002 9:28 am
by Tristan
Have a look at www.qnx.com. This is an excellent example of a micro-kernel. It also has some very good documentation of the differences between monolithic and micro kernels.

Re: Micro-kernel

Posted: Sun Feb 17, 2002 10:21 am
by K.J.
Well, I think that micorkernels load device drivers like an everyday program instead of part of the OS(like Windows and Linux).

K.J.

Re: Micro-kernel

Posted: Mon Feb 18, 2002 3:01 pm
by shadowwolf
KJ is mostly right...

Monolithic Kernels hold device drivers in the Kernel Space ( ie the kernel ) of the OS.

Micro Kernels hold all of the device drivers like regular programs in User Space of the OS.

The biggest differences are:
Monolithic Kernel --
  Doesn't always need Specialized Device Drivers
  Sometimes requires recompiling of the Kernel when you add new hardware
  Huge system failures when device drivers hang
  Installation of drivers is rarely a simple task

Micro Kernel --
  Device Drivers are actually just programs
  Slower startup since the OS kernel must initialize each driver individually
  System failures are minimal when device drivers hang
  Installation of drivers generally is no more difficult than installing a normal application

Re: Micro-kernel

Posted: Mon Feb 18, 2002 5:15 pm
by Chris Giese
>Now how does this happen in a microkernel environment ? I heard that microkernels use "mailboxes" to exchange information (which sounds like a nice concept but I really
don't understand how this is accomplished in a real OS like Mach or NT or BeOS).

A monolithic kernel is one big executable file. The
different parts communicate by function calls and global
variables. An errant pointer in one module could trash the
entire kernel.

In a microkernel, things like drivers and filesystems run
as separate tasks ("servers"), running in their own address
space, at user privilege if possible. What's left of the
kernel handles only threads, address spaces, and inter-
process communication (IPC). Mailboxes are one form of IPC.

Because a microkernel requires IPC, it's harder to write
than a monolithic kernel. In theory, it's slower than a
monolithic kernel but more reliable. In practice, they're
equally reliable, and the speed difference is not too great.
The L4 people (I think) figured out that first-generation
microkernels like Mach were slow because they were BIG,
not because of IPC.

Re: Micro-kernel

Posted: Tue Feb 19, 2002 3:21 am
by Tim
The biggest differences are:
Monolithic Kernel --
? Doesn't always need Specialized Device Drivers
? Sometimes requires recompiling of the Kernel when you add new hardware
? Huge system failures when device drivers hang
? Installation of drivers is rarely a simple task
These depend greatly on the quality of the kernel (I'm not sure what you mean by the first point though).

Constrast Linux with Windows 2000. Windows 2000 doesn't need to be recompiled, and installing/deinstalling drivers is easy because of the full plug-and-play architecture. (Earlier versions of Windows NT were less friendly in this respect.) However, buggy drivers are still a problem, because they have full access to the whole system.

On the other hand Linux drivers are a huge mess (IMHO). ;)
Micro Kernel --
? Device Drivers are actually just programs
? Slower startup since the OS kernel must initialize each driver individually
? System failures are minimal when device drivers hang
? Installation of drivers generally is no more difficult than installing a normal application
Not sure what you mean about the "slower startup". Monolithic kernels still need to initialise each driver at startup (or, at least the drivers which are needed). In fact, a good microkernel could initialise drivers in parallel if possible: for example, the mouse and the network card don't depend on one another, so they could get started up in parallel.

Re: Micro-kernel

Posted: Sat Mar 02, 2002 4:22 pm
by K.J.
Look at An Overview of Monolithic and Micro Kernels at my website under Docs and Tutorials:
http://surf.to/osdev

K.J.

Re: Micro-kernel

Posted: Sun Mar 03, 2002 4:34 am
by sith
Hi,

Your site seems to be off-line... :(

But thanks to everybody for responding...

Jeroen Jacobs

Re: Micro-kernel

Posted: Sun Mar 03, 2002 5:45 am
by K.J.
Hmm, my web host does seem to be down. Hopefully they'll be back up in a hour or two.

K.J.

Re: Micro-kernel

Posted: Sun Mar 03, 2002 7:41 am
by PatchWorKs

Re: Micro-kernel

Posted: Sun Mar 03, 2002 11:34 pm
by Whatever5k
In a microkernel, the FS and MM correspond by sending messages. To produce and send these messages is the job of the lower layer.