Micro Kernel

microkernel:
An approach to operating system design emphasizing small modules that implement the basic features of the system kernel and can be flexibly configured. (1999-08-02)

But in reality, the performance of Micro Kernel is often poor enough and the implementation is complicated enough that still today most Operating Systems are written using Monolithic Kernel.

OTOH, the MIT Exo Kernel operating system is said to be very fast.

OTOH, BeOS and QNX are microkernel based and are very fast. In fact, I am considering removing the above remark due to its blaring incorrectness. The reason most people are using monolithic kernels is legacy.

Mach, Windows Nt Kernel, Gnu Hurd and XNU (kernel of Mac Osx) are examples of Micro Kernel. -- Takuya Murata

XNU is not a Micro Kernel, it is a kernel obtained by merging the Mach Micro Kernel with parts of the BSD kernel and parts specific to Darwin, all running in kernel space.

Windows Nt Kernel is also not actually a microkernel, although it was marketed as a microkernel when microkernels were fashionable. For example, the NT executive (aka the kernel) is implemented above a hardware abstraction layer. In a true microkernel OS, the kernel itself is the hardware abstraction layer. And now, since the graphics and GUI components have been moved into kernel space, NT is even less of a microkernel OS.

The use of microkernels in 'real' operating systems like Darwin is a bit weird. The big idea of microkernels is that the kernel can be split up into independent parts ('servers') which communicate with each other and applications through message-passing; crucially, these are genuinely separate user-level processes, so they are protected from one another's bugs, can crash or be shut down without taking down the system, can be dynamically replaced at runtime, etc. In Darwin etc, the whole kernel is still a single kernel-level entity, with the microkernel compiled in; the microkernel is simply being used to provide a flexible and consistent infrastructure for the rest of the kernel. This is all down to performance reasons, i think.


The best example I've seen of a true Micro Kernel is the Ell Four microkernel (whose main author has unfortunately passed away). They ported Linux to run on top of this kernel (L4/Linux) and there is a rewrite-in-C++ project going on, etc.

L4 has only three abstractions (or two, depending on how you count). It has only 7 API functions! A far cry from Windows with its HAL, or Mach, or even normal Linux. :)

I actually think the 'big idea' of microkernels is that the system's kernel should contain only the concepts, and the functionality, which *absolutely must* be in the kernel in order to build a secure, high-performance system. Many first-generation microkernels like Mach include a lot of stuff in the microkernel which doesn't strictly need to be there. Microkernels like L4 are much closer to this ideal, and perform much better as a result. L4 includes almost nothing besides threads, address-space construction and IPC. Everything else can be built efficiently out of these in user-mode servers.

Here are some research papers from 1997 about L4 and the design of efficient microkernels:

The Performance of Micro Kernel-Based Systems citeseer.ist.psu.edu

Micro Kernels Can And Must Be Small citeseer.ist.psu.edu

Smallness (and fastness) have been achieved in some modern microkernels like L4. The failure of Mach and other first-generation microkernels is not due to a fundamental flaw in the microkernel idea. The flaws were implementation-specific. They were large and complicated and that's why they were slow.

Why do microkernels matter? Because a properly-designed microkernel system can be as fast as a monolithic kernel, and yet provide significantly more safety and flexibility. -- Wylie Garvin


One of the most successful microkernel operating systems is QNX. The performance of the Qnx Operating System is certainly not "poor". It is also reliable enough to be used in safety critical systems such as nuclear power stations, aircraft control systems, vehicle and traffic control systems, medical equipment, etc.

Interesting point: the QNX kernel is small enough to fit into the first-level processor cache.

Qnx Neutrino is the name of the microkernel in QNX's flagship products. It's pretty good stuff.


Is there any truth to the rumor that MACH really stands for Micro Kernel Architectures Considered Harmful?

e_s


Just to add, Windows NT is a hybrid Micro Kernel. The communications between ring 0 and ring 1 (the two core abstract rings in it's design) is done through message passing. Ring 1 in pure microkernels shouldn't have direct hardware access but it does in NT. This is for one reason only - latency and the fact that PC hardware is shit and very hard to do IO with through passing messages. The graphics interface is through the HAL which is ring 1 and the UI is at the same level but can only pass messages to the GDI HAL. It's as secure as any other OS structured in this way. In many ways it's superior as from a usability point of view in its target markets, it's spot on.


I think Andrew Tanenbaum should be mentioned on this page, but I can't figure out how.

He had a famous "discussion" with Linus Torvalds regarding the various merits and drawbacks of microkernels. See www.dina.dk .

He also released his Micro Kernel based minix 3 operating system. www.minix3.org .


See original on c2.com