Monolithic Vs 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.
suhmaamiar

Monolithic Vs Micro Kernel

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

Re:Monolithic Vs Micro Kernel

Post by somebody »

what is the difference??
Jared

Re:Monolithic Vs Micro Kernel

Post by Jared »

I wouldn't recommend a monolithic kernel for any purpose unless you want a coding, porting, debugging nightmare
Okiesmokie

Re:Monolithic Vs Micro Kernel

Post by Okiesmokie »

>> what is the difference??
There is a good comparison of micro and monolithic kernels at: http://osdev.neopages.net/tutorials/comparison.php
Tom

Re:Monolithic Vs Micro Kernel

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

Re:Monolithic Vs Micro Kernel

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Monolithic Vs Micro Kernel

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

Re:Monolithic Vs Micro Kernel

Post 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 ?
Tom

Re:Monolithic Vs Micro Kernel

Post by Tom »

Monolithic kernels are fast, and easy to make.
grey wolf

Re:Monolithic Vs Micro Kernel

Post by grey wolf »

a well-designed microkernel can be faster. but, unfortunately, it's harder to design :(
Tim

Re:Monolithic Vs Micro Kernel

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Monolithic Vs Micro Kernel

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

Re:Monolithic Vs Micro Kernel

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

Re:Monolithic Vs Micro Kernel

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

Re:Monolithic Vs Micro Kernel

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