Linked by Thom Holwerda on Sun 16th Apr 2006 15:36 UTC
OSNews, Generic OSes Right in between a car crash and Easter, I knew I had to write a Sunday Eve Column. So here I am, digesting vast quantities of chocolate eggs (and I don't even like chocolate), craving for coffee (for me about as special as breathing), with the goal of explaining to you my, well, obsession with microkernels. Why do I like them? Why do I think the microkernel paradigm is superior to the monolithic one? Read on.
Order by: Score:
QNX
by mOOzilla (-1.24) on Sun 16th Apr 2006 15:55 UTC
mOOzilla
Member since:
2006-04-11
Fans: 0

Hot configurable, plugable and easier to develop for without giving away source (Gfx drivers perhaps)

RE: QNX
by proforma (0.08) on Tue 18th Apr 2006 05:07 UTC in reply to "QNX"
proforma Member since:
2005-08-27
Fans: 0

Well Microsoft Windows Vista may not be a microkernel, but it is doing a lot of simular things and I think that is great.

Most of all the drivers are now in the UserMode and 64-bit Vista has a different core even. I think Microsoft is moving in that direction starting with Vista and even in 64-bit mode they are moving even faster in that direction.

o Drivers can crash and not crash the OS (just restart and go). Vista may be able to restart automatically.
o Drivers can be upgraded without rebooting.
o Drivers can be easier to create(program) in usermode.
o Drivers can be easier to test in usermode.

Oh yeah!
by sigzero (2.2) on Sun 16th Apr 2006 16:11 UTC
sigzero
Member since:
2006-01-03
Fans: 0

Well I like Vi and spaces over emacs and tabs! So there!

RE: Oh yeah!
by DoctorPepper (2.32) on Mon 17th Apr 2006 18:11 UTC in reply to "Oh yeah!"
DoctorPepper Member since:
2005-07-12
Fans: 0

But...but what about those of us that like Vi and TABS????

RE[2]: Oh yeah!
by egarland (2.96) on Mon 17th Apr 2006 20:42 UTC in reply to "RE: Oh yeah!"
egarland Member since:
2005-08-05
Fans: 0

Well.. you guys are just freaks... nobody likes you.

v Well my OS is better than your OS
by mOOzilla (-1.24) on Sun 16th Apr 2006 16:16 UTC
RE: Well my OS is better than your OS
by espinafre (1.59) on Mon 17th Apr 2006 18:38 UTC in reply to "Well my OS is better than your OS"
espinafre Member since:
2006-01-15
Fans: 0

I'm not sure why the parent was downmodded so swiftly. Please notice the sarcasm in his comment; I see it as an attack to the OS holy wars. Let's try not to be so obtuse.

OS X, QNX, and Tomfoolery
by kadymae (1.68) on Sun 16th Apr 2006 16:18 UTC
kadymae
Member since:
2005-08-02
Fans: 6

However, I think the circumstances have changed a lot since those days. Monolithic made sense 16 years ago, but with today's powerful computers with processors acting as $300 dust collectors most of the time, the advantages of a muK simply outweigh its inevitable, minute, and in user experience probably immeasurable, performance hit.

IIRC, the reason OS X is measurably slower at some tasks is because of the microkernel factor. (I seem to remember some sort of kerfluffle about X serves and SQL queries.)

But, on the other hand, there is the legendary stability of QNX.

(in the Netherlands, we say, 'automatic is for women'; no offence to the USA where automatic gearboxes are much more popular, since you guys across the pond have longer distances to cover)

Y'know, that statement really implies that women are inferior. Next time you see a guy push a small person out of a tight orifice, let me know. ;)

And the reason we have so many automatics over here, is that the US generally has non-existant public transportation, which makes for long slow commutes, and 90 minutes of stop and go with a manual gearbox will have your left knee screaming in pain.

(BTW, I drive standard transmission.)

it's why I prefer a straight Martini Bianco over weird cocktails (again, the end result is the same, but I'll leave that up to your imagination)

"Where are my clothes?! Wait. Whose bathtub is this?"

RE: OS X, QNX, and Tomfoolery
by galvanash (3.64) on Sun 16th Apr 2006 16:34 UTC in reply to "OS X, QNX, and Tomfoolery"
galvanash Member since:
2006-01-25
Fans: 0

IIRC, the reason OS X is measurably slower at some tasks is because of the microkernel factor. (I seem to remember some sort of kerfluffle about X serves and SQL queries.)

OSX is not a true muK by academic standards. It is a "modified microkernel" (in much the same way as the Windows NT kernel is, which is also sometimes mislabeled as a muK). It does not at all work the way Thom's article describes, as the BSD server makes direct function calls into the kernel and does no message passing at all. It is for all intents and purposes a monolithic kernel.

If your interested in how OSX is designed under the hood, read the paper at the following url:

http://www.usenix.org/events/bsdcon02/full_papers/gerbarg/gerbarg_h...

RE[2]: OS X, QNX, and Tomfoolery
by kadymae (1.68) on Sun 16th Apr 2006 17:27 UTC in reply to "RE: OS X, QNX, and Tomfoolery"
kadymae Member since:
2005-08-02
Fans: 6

Galvanash, thanks for the link. Fascinating read. I wasn't aware of the extent to which the OS X kernel had evolved away from being a microkernel.

RE: OS X, QNX, and Tomfoolery
by Slapo (1.72) on Sun 16th Apr 2006 16:46 UTC in reply to "OS X, QNX, and Tomfoolery"
Slapo Member since:
2005-07-06
Fans: 0

'the legendary stability of QNX'
Not only is it damn stable, but I have found it to be very fast. Runs off a CD almost as fast as from the HDD as well. Talking about QNX Neutrino 6.2.1.

RE: OS X, QNX, and Tomfoolery
by Thom_Holwerda (Staff) on Sun 16th Apr 2006 17:22 UTC in reply to "OS X, QNX, and Tomfoolery"
Thom_Holwerda Member since:
2005-06-29
Fans: 20

"Where are my clothes?! Wait. Whose bathtub is this?"

Nah, Martini's different. More like: "Thom, did we really get kicked off of a graveyard last night?" "Yes..." while thinking, thank god girl you didn't mention that other thing in front of this 30-man crowd that together composes my social life...

:/.

v RE: OS X, QNX, and Tomfoolery
by rapont (1.8) on Mon 17th Apr 2006 01:00 UTC in reply to "OS X, QNX, and Tomfoolery"
Sounds great, but still...
by jjezabek (2.75) on Sun 16th Apr 2006 16:19 UTC
jjezabek
Member since:
2005-08-07
Fans: 0

Someone/something has to do the hard stuff. Imagine a userspace driver, which doesn't crash, but for some reason writes garbage to your screen. It can't get automatically restarted, because from a microkernel POV everything is in best order. So you either have to restart the server using a remote machine (and hoping that the NIC driver is fine) or simply reboot. I'd say most users will go for the second option.
So - a buggy driver in userspace isn't much better than a buggy driver in kernelspace.
But yes, I agree, writing drivers in userspace is probably way less difficult than in kernelspace; that's probably the single most important difference.

Timer
by _tef (5) on Sun 16th Apr 2006 16:24 UTC
_tef
Member since:
2006-04-16
Fans: 0

The timer has to be in the kernel. How else would the scheduler function?

:D

RE: Timer
by CaptainPinko (3.36) on Sun 16th Apr 2006 18:43 UTC in reply to "Timer"
CaptainPinko Member since:
2005-07-21
Fans: 0

There has been talk in nanokernels of making the scheduler user-space to so that different apps could use different schedulers. For example there could be problems with not being MP-safe so you'd want to have finer control, or some legacy code that makes certain exceptions, or a myriad of other reasons.

The timer has to be in the kernel. How else would the scheduler function?

Cooperatively? Don't laugh. That's an option and if you can plug-in various schedulers it could be useful, especially for something like Wine emulating Windows 3.11, or if you have some real time (RT) tasks and non-RT. Where you could put the on-RT scheduler as a process with the RT-scheduler.

I don't recall where I read this, but I believe it was in some paper on a branch of the L4 project.

Microkernels in theory and practice
by felipe_alfaro (2.2) on Sun 16th Apr 2006 16:28 UTC
felipe_alfaro
Member since:
2006-04-16
Fans: 0

The problems with microkernels is than, in theory, they really look good. However, in practice, running a file system in user-space adds no benefit: if it crashes, how can you restart it? If the memory manager bails out, how can you create a new process and allocate memory for it? The networking subsystem is a good candidate for a user-space subsystem, but what about a diskless-workstation that boots from an NFS export? What would happen if the networking subsystem crashed?

More and more pieces of Linux are being pushed out to userspace. One nice example is used, of FUSE. udev is a central place in Linux device management, but even if it crashes or malfunctions, you can revert to the well-known mknod tool.

CaptainPinko Member since:
2005-07-21
Fans: 0

file system in user-space adds no benefit: if it crashes, how can you restart it?

I don't see the problem. Just restart and block and process that makes an I/O until it's back a running.


If the memory manager bails out, how can you create a new process and allocate memory for it?

Kill any process allocated by that manager, but any app controlled by another can continue living. You could make an ultra-stable manager for essential functions, and a more powerful-but-complex-so-harder-to-debug one for user apps.


what about a diskless-workstation that boots from an NFS export? What would happen if the networking subsystem crashed

Well it could run off the data it has in memory and/or just block until the connection is re-established. You could have a process that stores the details of your account monitor the connection process, and when the connection dies have it refeed the data that is needed to regain passwords.

felipe_alfaro Member since:
2006-04-16
Fans: 0

I don't see the problem. Just restart and block and process that makes an I/O until it's back a running.

Usually, restarting a process involves reloading the binary from disk, so if the file system is just to get restarted, how can you load it back from disk to memory? You could keep its text in memory, but what about corrupted data structures?

I still don't see any advantages of a microkernel system. Just look at Windows NT 4.0 and how they integrated back the graphic drivers back into kernel space due to performance problems. The fact is that, in Windows NT 3.5, a crash in the graphics subsystem left the system unusable. Well, it could keep serving files, but it was impossible for anyone to log in to the system.

RE: Microkernels in theory and practice
by Cloudy (2.68) on Sun 16th Apr 2006 21:32 UTC in reply to "Microkernels in theory and practice"
Cloudy Member since:
2006-02-15
Fans: 9

There's a misunderstanding here. The fault handling that supposedly comes from microkernels isn't keeping the failure of a component from causing the system to fail. Rather, it's keeping the failure of a component confined within that component.

All microkernels do, from an architectural point of view is enforce fault confinment through the use of seperate address spaces.

The problem is that the cost they introduce to provide that separation is higher (usually *much* higher) than the benefit gained.

A very good article...
by Brendan (2) on Sun 16th Apr 2006 16:31 UTC
Brendan
Member since:
2005-11-16
Fans: 2

Some notes:

The "clock" is probably a source of periodic interrupt used by the scheduler for pre-emptive task switching and timing (things like a "sleep()" function). It probably has nothing to do with "time and date". Because the scheduler relies on this clock (and everything else relies on the scheduler instead of this clock), building support for it into the microkernel is a very sane thing to do.

A micro-kernel is not necessarily "fail-safe". For example, if the hard disk driver crashes then you'll loose all of the data stored in swap space, and having a micro-kernel won't help to retrieve it. Another example would be the virtual file system - if it crashes then any software that was relying on it will loose their open file handles, etc. The same applies to everything that retains "client state". With a lot of work a micro-kernel can be more "fail-safe", but you need systems in place to take care of each type of failure. Without these extra systems it's not much better than a monolithic kernel (of course "protection" is a different subject).

Well my OS is better than your OS
by mOOzilla (-1.24) on Sun 16th Apr 2006 16:37 UTC
mOOzilla
Member since:
2006-04-11
Fans: 0

Come on get some humor implants! It was a joke!

v Bypassing Windows Authentication check
by mOOzilla (-1.24) on Sun 16th Apr 2006 16:38 UTC
The ONLY way to ensure GPL
by stephanem (0.4) on Sun 16th Apr 2006 16:40 UTC
stephanem
Member since:
2006-01-11
Fans: 0

Is to have a monolithic kernel because as soon as you move to a muK, drivers, modules, filesystems all can become closed source - you are forced to export a "stable" kernel API that Linus and co JUST WON'T DO

RE: The ONLY way to ensure GPL
by Brendan (2) on Sun 16th Apr 2006 16:52 UTC in reply to "The ONLY way to ensure GPL"
Brendan Member since:
2005-11-16
Fans: 2

Not having a stable kernel API means constant source code maintenance - you can't write a piece of software this week and know that it will still work next week because someone might change the kernel API on the weekend.

RE: The ONLY way to ensure GPL
by JMcCarthy (9.24) on Sun 16th Apr 2006 17:13 UTC in reply to "The ONLY way to ensure GPL"
JMcCarthy Member since:
2005-08-12
Fans: 2

Good ganja?

You should consider sharing your views with GNU. Who would've thought they'd be wrong?

Drivers, modules, etc. can very will become proprietary with a monolithic GPL kernel. Infact, there only about a dozen examples for Linux.

RE: The ONLY way to ensure GPL
by jessta (3.76) on Mon 17th Apr 2006 04:21 UTC in reply to "The ONLY way to ensure GPL"
jessta Member since:
2005-08-17
Fans: 3

There is currently nothing preventing the making of drivers and modules closed source. As long as they aren't distributed with the kernel then the GPL doesn't apply.

- Jesse McNelis

v Closed drivers are evil?
by mOOzilla (-1.24) on Sun 16th Apr 2006 16:42 UTC
RE: Closed drivers are evil?
by smitty_one_each (1.4) on Sun 16th Apr 2006 23:54 UTC in reply to "Closed drivers are evil?"
smitty_one_each Member since:
2005-07-07
Fans: 0

Linux is dead in the water for consumer boxes if you want EVERYTHING to be open source.
What you say holds true if everyone plays along.
Additionally, in the same spirit of your sentiment, only men could vote in the US until the 19th Ammendment.

needs more cowbell
by SEJeff (3.52) on Sun 16th Apr 2006 16:46 UTC
SEJeff
Member since:
2005-11-05
Fans: 7

I have to agree with felipe_alfaro. On technical merits alone, microkernels stomp monolithic kernels into the ground. In practice (and code) it is the other way around.

The #1 problem with the microkernel design... can we say latency? With any microkernel, the latency issue is horrendous. XNU, the kernel in Mac OS X, doesn't have as much of a latency issue because it is more hybrid than minix 3 or L4. I guess this makes XNU more of a hybrid microkernel, but not even minix 3 is 100% microkernel based. Scheduling and race conditions can also be more of an issue in microkernels as everything runs in userspace.

http://www.minix3.org/vmware.html minix 3 vmware player image

RE: needs more cowbell
by Pixie (1.28) on Sun 16th Apr 2006 17:56 UTC in reply to "needs more cowbell"
Pixie Member since:
2005-09-30
Fans: 0

I have to agree with felipe_alfaro. On technical merits alone, microkernels stomp monolithic kernels into the ground. In practice (and code) it is the other way around.

When you say in practice are you refering to those of AmigaOS, MorphOS, AROS, QNX and many others? I always liked best the idea and practice of micro kernels

RE[2]: needs more cowbell
by SEJeff (3.52) on Sun 16th Apr 2006 19:27 UTC in reply to "RE: needs more cowbell"
SEJeff Member since:
2005-11-05
Fans: 7

I am politely saying that Linux which is a monolithic kernel, beats every supposed microkernel I can personally find. Andrew Tannenbaum (whom I deeply respect) says microkernel design is better and I don't disagree with him. However, his code (minix 3) is still inferior from many angles versus the Linux kernel. Is there a microkernel that even matches the Linux kernel performance wise?

I somehow doubt I will ever see a microkernel that will come close to the speed of RTLinux (realtime linux).

I am really trying to not start a flamewar here.

RE[3]: needs more cowbell
by Thom_Holwerda (Staff) on Sun 16th Apr 2006 19:29 UTC in reply to "RE[2]: needs more cowbell"
Thom_Holwerda Member since:
2005-06-29
Fans: 20

I somehow doubt I will ever see a microkernel that will come close to the speed of RTLinux (realtime linux).

QNX's Neutrino kernel. QNX is probably the most advanced muK system out there.

RE[4]: needs more cowbell
by hobgoblin (2.32) on Mon 17th Apr 2006 03:21 UTC in reply to "RE[3]: needs more cowbell"
hobgoblin Member since:
2005-07-06
Fans: 0

hmm, a real-time os. while im not fully up to speed, whats the performance of a linux kernel rigged for real time running?

v needs more XML
by mOOzilla (-1.24) on Sun 16th Apr 2006 16:46 UTC
v OSNews is BROKEN
by mOOzilla (-1.24) on Sun 16th Apr 2006 16:57 UTC
RE: OSNews is BROKEN
by Sauron (1.42) on Mon 17th Apr 2006 05:56 UTC in reply to "OSNews is BROKEN"
Sauron Member since:
2005-08-02
Fans: 0

Works fine in NetPositive. Your Firefox is broken ;)

RE[2]: OSNews is BROKEN
by mOOzilla (-1.24) on Mon 17th Apr 2006 08:26 UTC in reply to "RE: OSNews is BROKEN"
mOOzilla Member since:
2006-04-11
Fans: 0

After further investigation I see OSNews does not work if It does not get the Referrer header, Which I do not send.

And why I hate microkernels..
by ivans (3.12) on Sun 16th Apr 2006 17:04 UTC
ivans
Member since:
2005-12-03
Fans: 5

Oh joy. Here it goes again - the ever lasting story of how never-succesful academic bullshit called "microkernel" never made it into the mainstream OSes. And how world would have been a safer place, with no drivers fooling around in ring0, if Cutler/Torvalds/whomever had listened to mr. Tanenabaum and alike.

The microkernel propaganda is mostly composed of three common FUDs:

1) microkernels are more "stable", because having ALL kernel code besides scheduler/dispatcher, IPC and some basic interrupt routing in ring3 (aka user-mode)

WRONG. If any crucial OS component (such as Memory Manager or FileSystem driver) fails - the whole OS fails as well. Being in ring0 (like the monolithic kernels do it) makes it just crash faster.

2) microkernels are more modular/maintanable/simple/blahblah

Writing modularized code is the basic tenet of software engineering, and it's called separation of policy from mechanism, and has NOTHING to do with the kernel being monolothic or not.

For example - Linux kernel is highly modular, either from the standpoint of compile time flags, or dynamically expandable functionality via LKMs. Just look at the design goals behind the VFS(used by any filesystem driver) and LSM (Linux Security Modules - utilized by SELinux, DTE..) to know what I mean..

NT kernel (W2K, WS2K3, XP, Vista..) is also very modular - the basic kernel schedulable primitives are encapsulated into so-called "executive components" (MM, I/O, essentialy anything besides scheduler) but are still all being compiled into one big fat binary called NTOSKRNL.EXE. The point is that it's the code that separates different abstraction policies, not the postcompiled modules organization.

3) It's easier to write drivers for microkernel.

Because they should, by definition, be living in ring3, and could be debugged in gdb or VS, and not in null-modem connected kernel debugger :-) And that's the reason why printer drivers are in userland ever since W2K, why Vista will have so-called UMDF (User-Mode Driver Foundation) that will enable most, for OS nonessential, cheap hardware to have it's drivers running in ring3 (if you have XP SP2, check out the WDFMGR.EXE's process description ;)

And the cons against microkernel? Spending most of your CPU cycles doing context switches and IPC for simple stuff such as page fault handling and ISR dispatching.. That's the reason why there are NO general-purpose commercially-successful microkernel OSes - that's right, all Win NT-based, Linux, *BSD, Solaris, HP-UX, AIX, MacOS (aka Darwin - it contains Mach but it is not used as a microkernel, there are the FBSD, IOKIT and drivers stuff in ring0 too!) are monolithic. And those who aren't, (QNX, EKA2 - SymbianOS nanokernel) are so not because of the "increased stability and security", but because it enables them to have predictable interrupt latency.

Sorry for bad english.

RE: And why I hate microkernels..
by Ronald Vos (1.64) on Sun 16th Apr 2006 17:16 UTC in reply to "And why I hate microkernels.."
Ronald Vos Member since:
2005-07-06
Fans: 0

Please take note that ring0 and ring3 are Linux-only terms, and meaningly outside discussions of the Linux kernel only. Besides, the NT Kernel and Mac OS X kernel aren't monolithic, but hybrid.

RE[2]: And why I hate microkernels..
by ivans (3.12) on Sun 16th Apr 2006 17:30 UTC in reply to "RE: And why I hate microkernels.."
ivans Member since:
2005-12-03
Fans: 5

Please take note that ring0 and ring3 are Linux-only terms, and meaningly outside discussions of the Linux kernel only

LOL, read the Intel manuals dude - it's OS-agnostic term meaning "privilege level", and has roots in MULTICS (IIRC it had 8 od them ;)

Besides, the NT Kernel and Mac OS X kernel aren't monolithic, but hybrid.

Wrong again - NT is even more monolithic than Linux, since it has GUI (win32k.sys) in kernel-mode. Read the relevant literature (Solomon/Russinovich for examble).

As for the MacOS - it does contain the Mach microkernel - but, as I said, it's not used as a microkernel. See what the author of upcoming "MacOS X Internals" book says on this topic:

http://www.kernelthread.com/mac/osx/arch_xnu.html

XNU's Mach component is based on Mach 3.0, although it's not used as a microkernel. The BSD subsystem is part of the kernel and so are various other subsystems that are typically implemented as user-space servers in microkernel systems.

The term "hybrid microkernel" is IMHO just a marketing propaganda dating from mid 1990s when NT 4.0 was released. NT is even more monolithic than traditional UNIXen.

RE[3]: And why I hate microkernels..
by Thom_Holwerda (Staff) on Sun 16th Apr 2006 17:37 UTC in reply to "RE[2]: And why I hate microkernels.."
Thom_Holwerda Member since:
2005-06-29
Fans: 20

Wrong again - NT is even more monolithic than Linux, since it has GUI (win32k.sys) in kernel-mode. Read the relevant literature (Solomon/Russinovich for examble).

Wowwow there, NT is a hybrid kernel. It started out as a true muK (Tanenbaum even compared MINIX to NT), but slowly but surely more things were added into kernelspace. The fact that the GUI is placed in kernelspace does not change the fact that NT is a hybrid kernel. Wikipedia has this to say on it:

"The architecture of the Windows NT operating system line is highly modular, and consists of two main layers: a user mode and a kernel mode. Programs and subsystems in user mode are limited in terms of what system resources they have access to, while the kernel mode has unrestricted access to the system memory and external devices. The kernels of the operating systems in this line are all known as hybrid kernels as their microkernel is essentially the kernel, while higher-level services are implemented by the executive, which exists in kernel mode."

http://en.wikipedia.org/wiki/Architecture_of_the_Windows_NT_operati...

And with Vista, a lot of parts are moved out of kernelspace again, back into userspace where it belongs. So when Vista comes, the NT kernel has grown more towards its muK origins.

RE[4]: And why I hate microkernels..
by ivans (3.12) on Sun 16th Apr 2006 17:54 UTC in reply to "RE[3]: And why I hate microkernels.."
ivans Member since:
2005-12-03
Fans: 5

Wowwow there, NT is a hybrid kernel. It started out as a true muK (Tanenbaum even compared MINIX to NT), but slowly but surely more things were added into kernelspace.

No, NT is NOT a microkernel, and was never designed to be one. It has

1) ring0 drivers
2) all non-essential kernel services, which are traditionally implemented as user-mode (ring3) servers in pure microkernels such as Mach, are in ring0
3) it has even super-nonessential stuff in ring0 such as GUI, traditionally in ring3 on *NIX

There is no way to communicate between, lets say, Memory Manager and the Scheduler via formal IPC (msg_send() and msg_receive() in Mach) - they are ALL inside one statically compiled nonseparable module.

Wikipedia article is somewhat clueless, and paradoxical IMHO:

The kernels of the operating systems in this line are all known as hybrid kernels as their microkernel is essentially the kernel, while higher-level services are implemented by the executive, which exists in kernel mode.

So it basically this sentence says: kernel = microkernel, but upper-level services are still ring0, like the microkernel itself :-)

But if both higher-level services and the "microkernel" are in the same privilege level, they must be in the same address space, meaning no protection, no security, no mutual IPC - ie. no microkernel design at all ;)

As i said - calling NT a hybrid microkernel is just a marketing propaganda from the 90s, when the term microkernel was hot stuff.

RE[3]: And why I hate microkernels..
by hustomte (1.35) on Sun 16th Apr 2006 19:49 UTC in reply to "RE[2]: And why I hate microkernels.."
hustomte Member since:
2006-01-07
Fans: 0

"...and has roots in MULTICS (IIRC it had 8 od them ;) "

Actually 16, but then again, they didn't actually use all of them

RE[4]: And why I hate microkernels..
by ivans (3.12) on Sun 16th Apr 2006 20:19 UTC in reply to "RE[3]: And why I hate microkernels.."
ivans Member since:
2005-12-03
Fans: 5

Actually, it did had 8 hardware rings

http://www.multicians.org/mgr.html#ring

It's really funny that most OSes today are still being built on 1960s technology ;)

RE[2]: And why I hate microkernels..
by bleurgh (3.5) on Sun 16th Apr 2006 18:03 UTC in reply to "RE: And why I hate microkernels.."
bleurgh Member since:
2006-04-16
Fans: 0

ring0 - ring3 are intel terminology. x86 have 4 privilege rings, whereas most processors only have 2 (kernelmode and user mode). This is where the terminology comes from, not Linux.

RE[2]: And why I hate microkernels..
by Soulbender (3.48) on Mon 17th Apr 2006 06:29 UTC in reply to "RE: And why I hate microkernels.."
Soulbender Member since:
2005-08-18
Fans: 15

"Please take note that ring0 and ring3 are Linux-only terms"
Uh, no. They are operating system design terms where the actual number of rings depends on the processor.

"Besides, the NT Kernel and Mac OS X kernel aren't monolithic, but hybrid."
Agreed, and so is the Linux kernel.

RE[3]: And why I hate microkernels..
by Cloudy (2.68) on Mon 17th Apr 2006 07:22 UTC in reply to "RE[2]: And why I hate microkernels.."
Cloudy Member since:
2006-02-15
Fans: 9

You say that like it's a good thing, but hybrid is the worst of both worlds. All the overhead of message passing with all of the memory collision issues of single address space.

RE: And why I hate microkernels..
by Pixie (1.28) on Sun 16th Apr 2006 17:58 UTC in reply to "And why I hate microkernels.."
Pixie Member since:
2005-09-30
Fans: 0

And the cons against microkernel? Spending most of your CPU cycles doing context switches and IPC for simple stuff such as page fault handling and ISR dispatching.. That's the reason why there are NO general-purpose commercially-successful microkernel OSes - that's right, all Win NT-based, Linux, *BSD, Solaris, HP-UX, AIX, MacOS (aka Darwin - it contains Mach but it is not used as a microkernel, there are the FBSD, IOKIT and drivers stuff in ring0 too!) are monolithic. And those who aren't, (QNX, EKA2 - SymbianOS nanokernel) are so not because of the "increased stability and security", but because it enables them to have predictable interrupt latency.

I know, I know, that's one of the reason all *miga OSs out there feels so slow... :roll:

Microkernels can be fast/performant
by Ronald Vos (1.64) on Sun 16th Apr 2006 17:12 UTC
Ronald Vos
Member since:
2005-07-06
Fans: 0

For example Exec is mentioned on wikipedia as an 'atypical microkernel', which is part microkernel, part hybrid.

http://en.wikipedia.org/wiki/Kernel_%28computer_science%29#...

Also, from what I've read some nanokernels with limited amounts of features do fine.

Projects like Gnu HURD are, in my humble opinion, destined to fail if they persist in aiming for a 'theoretically pure' implementation anyway; I believe hybrids to feature the best of both worlds. If you use services and modules, you can get performance, customisability, hotreloadability and overseeable complexity at multiple levels all at the same time. No surprise the kernels most used in practice feature either modules or services.

If you want performance, you'd be better off using exokernels anyway. I'm surprised this hasn't escaped from academia yet.

RE: Microkernels can be fast/performant
by Pixie (1.28) on Sun 16th Apr 2006 18:02 UTC in reply to "Microkernels can be fast/performant"
Pixie Member since:
2005-09-30
Fans: 0

If you want performance, you'd be better off using exokernels anyway. I'm surprised this hasn't escaped from academia yet.
Don't let EyeAm hear you! ;)

Opinionated but fair
by joecool (2.17) on Sun 16th Apr 2006 17:14 UTC
joecool
Member since:
2006-02-19
Fans: 0

I definitely like how the article does not only present positive traits of the microkernel, but also describes the corresponding negative traits. In addition, I think that's the first time I read that very interesting Linus vs. Tanenbaum thread. Great read overall.

It's easy
by JMcCarthy (9.24) on Sun 16th Apr 2006 17:15 UTC
JMcCarthy
Member since:
2005-08-12
Fans: 2

It's easy to fall in love with the premise of microkernels when you've never actually designed&implemented one.

v It's easy
by mOOzilla (-1.24) on Sun 16th Apr 2006 17:18 UTC
multiple processors
by evert (3.76) on Sun 16th Apr 2006 17:29 UTC
evert
Member since:
2005-07-06
Fans: 0

I guess a microkernel makes better use of multiple CPU's. So it should scale better.

RE: multiple processors
by renox (2.8) on Sun 16th Apr 2006 18:22 UTC in reply to "multiple processors"
renox Member since:
2005-07-06
Fans: 1

Maybe, but I'm not convinced: spreading the work too thin can be a pitfall of parallelisation: CPU contains cache and if a system request goes to several CPUs in a micro-kernel, there could easily be data shared between CPU increasing cache-contention, which reduce efficiency.

Schedulers tries to put related thread on the same CPU, while at the same time balancing the load, this is a tricky balance and I'm not sure micro-kernel helps here.

RE[2]: multiple processors
by somebody (3.24) on Sun 16th Apr 2006 18:56 UTC in reply to "RE: multiple processors"
somebody Member since:
2005-07-07
Fans: 0

Yep, doing too much of something can be even worster than doing nothing.

Part for all naysayers about monolithic tree
On the other hand (at least in my simple mind)
Monolithic kernel could simply put out generic `muK` protocol handlers (drivers) that would act on and control outside drivers, like for example `muK` network adapter handle and provide complete protocol needed. This driver would need to act as protocol server and handle the pluged outsiders.

Hierarchy of Linux kernel is just a file system, nothing else. So why couldn't some drivers provide external `muK` capabilities?

Something being monolithic doesn't mean it couldn't be extended with some sub branches that would provide `muK` protocols and handling. Now, one network driver provides and can control few network cards that are in his domain. This would just control more generic domain.

But in my daily reality.
I don't miss microkernel a bit. So far NVidia driver was the only one I ever installed so far. I just buy most compatible machine that suits my needs and that's it.

RE: multiple processors
by nick (2.08) on Mon 17th Apr 2006 06:15 UTC in reply to "multiple processors"
nick Member since:
2006-04-17
Fans: 0

A microkernel does not inherently make better use of
multiple CPUs than a monolithic kernel. Often quite the
reverse, in fact.

A monolithic kernel isn't a single "process" or
"thread" (although there can be threads that run solely
in kernel mode). The kernel is called by, and performs
work on behalf of, user processes.

Now say that we have a 16 CPU system with 1 user
process on each CPU and each one would like to allocate
a page of memory. The kernel is notified about this
allocation request somehow (via a page fault, usually),
then asks the memory manager to find a page, return it
to us.

In the Linux kernel, in the common case, all processes
can concurrently enter the memory manager, and none
will have to take a lock which blocks another, because
each can just take a page from per-CPU freelists.

In a microkernel, there would be 16 requests queued up
for the memory manager process, which runs on one CPU
and processes them one at a time. If you would like to
have 16 memory manager threads, then they can now run
concurrently, but they will still block one another
when taking IPC requests off the queue.

Actually, the memory manager *is* something that a high
performance microkernel is likely to multi-thread
and/or put a light-weight per-CPU allocator in front of
the IPC call (oops, no longer a microkernel!)

RE[2]: multiple processors
by Cloudy (2.68) on Mon 17th Apr 2006 07:20 UTC in reply to "RE: multiple processors"
Cloudy Member since:
2006-02-15
Fans: 9

When you start talking about MPs, you have to be careful to distinguish between the two strategies of MP resource scheduling design. While it is common, especially the first time an OS is ported to an SMP to have a 'big kernel lock' and funnel all requests to a certain processor, that's an implementation detail and not an artifact of micro versus macro kernel.

RE[3]: multiple processors
by nick (2.08) on Mon 17th Apr 2006 09:58 UTC in reply to "RE[2]: multiple processors"
nick Member since:
2006-04-17
Fans: 0

No that's got nothing to do with what I was talking
about.

I just provided an example to illustrate why a micro
kernel is not inherently more SMP scalable than a
monolithic kernel.

In other words, a monolithic kernel can be just as
threaded / scalable as any microkernel.

Separate vs integrated (monolithic) components
by walnut tree (2.13) on Sun 16th Apr 2006 17:30 UTC
walnut tree
Member since:
2005-11-15
Fans: 0

I like the idea of an application or device that does one thing and does it well. But in the technology field, "convergence" is the name of the game. And this is partly being driven by consumers who want functionality in neat all-in-one packages rather than as separate components.

It's not always bad though. I prefer a simple mobile phone, but I can see the appeal of a phone with MP3 player and (basic) digital camera. Would you rather have one integrated device or carry three separate devices?

On paper, the microkernal design seems simple and elegant. The modular structure gives you the impression of a plug-and-play system where new functionality can be dropped in without having to re-engineer the whole OS - whether it's actually like that in real life though is another thing.

Cloudy Member since:
2006-02-15
Fans: 9

The problem is that on paper everyone's block diagram of their system looks modular and elegant. In practice, microkernels don't give you any modularity. They simply throw more of the crap outside the 'kernel' than was in it before. It's the same crap in a different bag. But now it has all the extra overhead of talking to the microkernel to get things done.

great article
by JrezIN (3.2) on Sun 16th Apr 2006 17:36 UTC
JrezIN
Member since:
2005-06-29
Fans: 2

Great article.

In my experience, microkernel systems have better stability and are usually faster to general-propose operations (no really talking about automation systems, like car-building Robots' operation systems, and similar situations...), like a desktop operational system. Maybe it's the kind of standard organization that the system works around; but still in the end, better systems (talking about the practical results).

Another problem these days that microkernels help with, are licensing problems. Since binary compatibility is much easier to maintain as the kernel itself doesn't change too much. So, as the system "talks" a single language, code don't need to "touch" other (license's) code and the user don't need to worry about this kind of problems, it's easier to have everything "just working"...

Well - not everyone agrees
by ratatask (1.32) on Sun 16th Apr 2006 17:55 UTC
ratatask
Member since:
2006-01-28
Fans: 0

I suggest the OP (and others too) read
http://fred.cambridge.ma.us/c.o.r.flame/msg00025.html