Micro-kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Jeroen Jacobs

Micro-kernel

Post 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
Tristan

Re: Micro-kernel

Post 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.
K.J.

Re: Micro-kernel

Post 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.
shadowwolf

Re: Micro-kernel

Post 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
Chris Giese

Re: Micro-kernel

Post 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.
Tim

Re: Micro-kernel

Post 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.
K.J.

Re: Micro-kernel

Post 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.
sith

Re: Micro-kernel

Post by sith »

Hi,

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

But thanks to everybody for responding...

Jeroen Jacobs
K.J.

Re: Micro-kernel

Post 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.
PatchWorKs

Re: Micro-kernel

Post by PatchWorKs »

Whatever5k

Re: Micro-kernel

Post 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.
Post Reply