How Long Will Apple Keep the MACH Microkernel?
The subject of kernels is normally both too technical, and too boring, for your average user. However I feel that in light of recent events this issue should be examined. So, to help everyone out, I am going to try and explain (briefly) what the big fuss is all about and why you should care. First though, we need to start with some definitions.
What is a kernel?
The easy answer is a kernel is the core of any operating system. DOS, Windows, UNIX, OS X and Linux all have some type of kernel. The implementations change but the basic concept remains the same. A kernel interfaces directly with the system’s hardware and is the lowest level of software. There are two types of kernels, micro-kernels and monolithic-kernels.
What is the difference between a micro and monolithic kernel?
There are two main schools of thought on the issue of which type of kernel is “best”. The first group (to which Apple belongs) advocates a micro-kernel system. The second (to which Unix and Linux belong) favor monolithic-kernels. These differing approaches can be likened to two different kings in two different cities.
The first king is very reclusive and sits in a small castle with high walls and a few top advisors. The king tells the advisors what to do and they go outside of the small (but well defended) castle and issue orders to the knights, merchants and common-folk. The king never leaves his castle and since only his most trusted advisors are allowed in the king is very safe from attack. However, because each advisor has to pass through several guard points (with a full cavity search at each stop) it can sometimes take a little while before the king’s orders can go out or news can come in.
The second king is much different. He doesn’t really live in a castle so much as it is a large mansion with beautiful grounds. Strongly defended walls encompass the entire city instead of just the castle. This makes the king and the populace very secure from outside attacks. And since this king is very friendly he goes throughout his city meeting and talking with all of his subjects. Any command he, or his many trusted aides, give are instantly obeyed. This makes his city very efficient. However, should any enemy agents manage to penetrate the outer walls, then they can quite easily assassinate the beloved king. In which case order breaks down and the entire city riots.
Which should be used?
A micro-kernel is highly portable, easily scalable and very secure. This security comes at the price of speed though. The monolithic kernel isn’t as secure, but is always faster. Micro-kernels tend to be slower (from 50% in the worst case to only 10% in the best case) than the more integrated monolithic kernel. So, it ultimately comes down to which is more important, security and stability, or speed?
Why should I care?
As I mentioned previously, Apple currently uses the Mach micro-kernel. This is a result of Jobs turning NextStep into OS X and in the process keeping what was under the hood. However a big proponent of the Mach kernel, Avie Tevanian, is no longer with Apple. As a result Apple might switch to the same monolithic kernel that most Linux distros use. This would be a tremendous change in the way OS X operates. If Apple does make the switch then they will enjoy a nice boost in speed. It is possible that when 10.6 or 10.7 comes around then Jobs will announce the change. I don’t think they would have enough time to squeeze it into 10.5, but I could be wrong. That would be just like Jobs to announce a kernel change along with a new chip from Intel that would drastically boost OS X’s speed. It could happen sooner than we think.