Image Image Image ImageImage
Creative Services for
Roughly Drafted
Daniel Eran

Image Image

Unraveling the Mac OS X Microkernel Myth
According to proponents of this myth, Mac OS X is in grave danger because it has a microkernel and Linux doesn't. They're wrong; here's why.

Page 1 | 2 | 3

What is Linux?
Technically, Linux is really just a fat kernel, not a full operating system. That makes Linux directly comparable to the BSD kernel, or the vaporous HURD project, or XNU, the NeXT-Apple Mach-BSD hybrid kernel. Linux was written from scratch by a large community to provide a free alternative to AT&T's commercial Unix.

There was a need for Linux in part because AT&T had embroiled BSDi in a lawsuit that left BSD Unix, the only complete and free Unix alternative, with a questionable future. By the time the lawsuit was resolved, Linux had established itself as a third major alternative.

Since GNU's HURD kernel failed to materialize, the userland software completed by the GNU Project was paired with the Linux kernel. The most hardcore of nerds actually refer to the whole package as GNU/Linux; to everyone else, anything related such a distro is simply called Linux.

Userland software designed for a Unix-based environment is highly portable, so software built for Linux is generally quite easy to port to BSD, Solaris, Mac OS X, or any other Unix-like system, regardless of the significant differences that may exist in their underlying kernel design. Apple's Darwin pairs the XNU kernel with a lot of the same userland software found in a common Linux distro.

The portability of kernel specific components, such a device drivers, is a different story. Linux, BSD, and Apple's XNU all implement drivers in very different ways, so you can't use a SCSI driver designed for Linux in Mac OS X, or vice versa.

Why is Apple Still Using the Mach Kernel After Mach failed?
The Mach kernel didn't fail; it was the Mach microkernel project that failed. Neither NeXT nor Apple ever used Mach as a microkernel.

Recall that at the time of NeXT's decision to use Mach in NeXTSTEP, Mach wasn't being developed as a microkernel with an external, operating system in userland. Rather, Mach 2.5 simply injected some new ideas on how a microkernel might work into an existing, fat kernel space.

Mach 2.5 was a fat kernel, not the problematic microkernel with horrific performance problems that Mach 3.0 turned out to be.

All the ideological criticisms lobbed back and forth between Linux creator (and fat kernel advocate) Linus Torvalds and Andrew Tanenbaum (the creator of the Minix microkernel) have nearly nothing at all to do with Mach as it is used in Mac OS X.

More Nails in the Coffin
Once again, just for good measure: Mac OS X is not based on a microkernel architecture, and has never used Mach as a microkernel. Apple's XNU kernel is larger than many monolithic kernels, and does not suffer from the intractable performance failure the world associates with Mach microkernel research.

Apple has incorporated progress the Mach project made in development of Mach 3.0, but nothing changed: Mac OS X still does not have a microkernel architecture. Its XNU kernel is not implemented as a microkernel. Apple does not use Mach as a microkernel.

XNU incorporates many technologies from Mach which makes it different than traditional fat kernels such as BSD or Linux. The microkernel myth confuses the facts by associating [anything related to Mach] with [the failure of the Mach microkernel project], which sought to remove BSD from Mach. Since Mac OS X's version of Mach is full of BSD, this false association is rooted in either ignorance or FUD (or both), depending on who is reweaving the myth.

So there you have it: the Mac OS X Microkernel Myth falls apart on the simple discovery that Mac OS X has no microkernel.

Does Mac OS X Need a Linux Kernel?
The idea that Mac OS X has a microkernel that desperately needs to be replaced is therefore based a rather shaky foundation. Regardless, myth weavers seem to present other, compelling reasons to replace XNU with Linux:

  • Linux is so buzzworthy
  • Linux is apparently so much faster
  • Linux has so much more support as a standard

These issues will be considered further in:

Unraveling The Copy/Paste Development Myth
Unraveling The Mac OS X Needs a Linux Kernel Myth

| | Digg


More Journal Entries | More Tech Articles | Get Tech Support | My Resume | Links | Contact RoughlyDrafted

Articles Copyright © 2006 Daniel Eran. All rights reserved.
Suggestions and comments welcome. Contact RoughlyDrafted.

Read more about:
Click one of the links above to display related articles on this page.