Page 1 of 2

Monolithic Vs Micro Kernel

Posted: Fri Nov 08, 2002 4:33 pm
by suhmaamiar
hi there

which one is a better design for a distributed operating
system ?

A monolithic OR A Micro Kernel ?

any comments, tips or reference to related reading ?

many thanks

suhmaamiar

Re:Monolithic Vs Micro Kernel

Posted: Fri Nov 08, 2002 5:45 pm
by somebody
what is the difference??

Re:Monolithic Vs Micro Kernel

Posted: Sat Nov 09, 2002 7:26 am
by Jared
I wouldn't recommend a monolithic kernel for any purpose unless you want a coding, porting, debugging nightmare

Re:Monolithic Vs Micro Kernel

Posted: Sat Nov 09, 2002 4:24 pm
by Okiesmokie
>> what is the difference??
There is a good comparison of micro and monolithic kernels at: http://osdev.neopages.net/tutorials/comparison.php

Re:Monolithic Vs Micro Kernel

Posted: Sat Nov 09, 2002 7:45 pm
by Tom
I think that FritzOS might be a Mono-/-Micro Mix.

Ok people with mature OSes ( Tim, Pype )...
Would that be a good idea?

If you say it's your OS...what would be good/bad about that mix?

Re:Monolithic Vs Micro Kernel

Posted: Mon Nov 11, 2002 6:40 am
by Tim
[]I wouldn't recommend a monolithic kernel for any purpose unless you want a coding, porting, debugging nightmare
What?? Could you back this up at all? Have you ever debugged either a monolithic or micro kernel?

Commonly-used microkernel OS: QNX
Commonly-used monolithic kernel OSes: everything else
I think that FritzOS might be a Mono-/-Micro Mix.

Ok people with mature OSes ( Tim, Pype )...
Would that be a good idea?
Sure, that can work. For example, I've got all hardware and file system (and eventually network transport)drivers in kernel mode (for speed), yet I'm putting the window and console servers in user-mode processes.

Re:Monolithic Vs Micro Kernel

Posted: Mon Nov 11, 2002 7:35 am
by Pype.Clicker
Jared wrote: I wouldn't recommend a monolithic kernel for any purpose unless you want a coding, porting, debugging nightmare
coding nightmare ? i don't see why, really ... microkernel arcxhitecture allow you to focus on one thing at a time.

porting nightmare ? look at Mach, a microkernel can easiliy be extended with a OS-emulator API so that you can have a linux/windows/whatever behaviour.

debugging nightmare ?
definitively not as you'll have fewer code in kernel mode (thus fewer code that can lead to a system crash.

Re:Monolithic Vs Micro Kernel

Posted: Mon Nov 11, 2002 4:51 pm
by suhmaamiar
i guess linux has a monolithic kernel and if it is
hard to debug a monolithic kernel then why the
author of linux has chosen this architecture ?

Re:Monolithic Vs Micro Kernel

Posted: Mon Nov 11, 2002 7:48 pm
by Tom
Monolithic kernels are fast, and easy to make.

Re:Monolithic Vs Micro Kernel

Posted: Tue Nov 12, 2002 1:59 am
by grey wolf
a well-designed microkernel can be faster. but, unfortunately, it's harder to design :(

Re:Monolithic Vs Micro Kernel

Posted: Tue Nov 12, 2002 6:24 am
by Tim
The monolithic/microkernel argument goes on and on. On the x86, monolithic kernels will be faster, all other things being equal, because with a microkernel, any operation that is handled by another task involves a context switch (interrupt/register save&restore/iret) and an address space switch (mov cr3 and/or invlpg).

For example, look at Windows NT and BeOS. Both of these have been marketed as microkernels, yet both of their kernels use the monolithic design, since a microkernel introduces too much slowdown. Even NT's GUI has been in kernel space since NT 4 -- moving the GUI into ring 0 gave them a big speed increase.

Re:Monolithic Vs Micro Kernel

Posted: Tue Nov 12, 2002 7:20 am
by Pype.Clicker
agree with tim for mature OS, but for early stage development, microkernels will help you finding out bugs.

the ideal (imho) design would be a componentized OS where the component can be loaded as a separate task (DPL3) or as a kernel extension (DPL0), so that you can try your code before giving it fast access to the highway 2 hell ...

Re:Monolithic Vs Micro Kernel

Posted: Tue Nov 12, 2002 10:35 am
by Tom
Isn't Win95/98[me=Tom]a Micro Kernel or a Mix because it has some kernel files that need to be loaded at bootup ???[/me]

Re:Monolithic Vs Micro Kernel

Posted: Tue Nov 12, 2002 11:40 am
by Tim
Tom: No.

Time for some micro/monolithic kernel revision. A microkernel design is one where the privileged component (the code that runs in ring 0 on x86) is as small as possible, and usually just contains startup, task switching and inter-process communication code. All other system services run as user-mode processes, each protected in their own address space. A crash in one system process will take down that process and (hopefully) no others. System calls take the form of messages sent between processes; each system call requires a switch away from the calling process and to the server process, via ring 0.

A monolithic kernel is one where most or all system services run in ring 0. A crash in the kernel can take down the whole system. System calls take the form of inter-ring calls (interrupts or call gates) and require a switch to ring 0.

Examples of microkernel operating systems are Minix, QNX, Mach, L4.

Examples of monolithic kernel operating systems are Windows (all versions), most Unixes, BeOS. I'd say that all versions of MacOS fall under the monolithic category, even though AFAIK MacOS X is based on Mach.

In my opinion, MS-DOS/BIOS call under the exokernel category: hardware access is provided by library code loaded into the user process instead of via privileged device drivers.

Re:Monolithic Vs Micro Kernel

Posted: Tue Nov 12, 2002 4:38 pm
by suhmaamiar
tim, pls explain , what do you mean by RING 0 ?

and does any body know any book which discuss
these matters in detail ?

i really want to study this before i start working
on my os

thanks

suhmaamiar