I recently had a debate with one of the other geeks I work with. She was saying that she believes MacOSX is the way forwards and that its better then linux in pretty much all area’s and that microkernels rule. It wasn’t quite that strongly worded but she was definitely having a fairly serious go at me being a linux supporter (what made it worse from my perspective is that she is / was also a big gentoo supporter so the “defection” stung more). In answer to her points I ended up writing the below email which I think some of you might be interested to read.
———————————————————-
Subject: Microkernsl
heya,
after our discussion the other day I decided that I didn’t know enough about
them, and I was also curious as to where my “instinctive” dislike of them had
come from. I was also interested in assessing your three main reasons for
loving OSx, those you stated as:
1. stability
2. it “just works”
3. security
So I set of in search of the microkernel….
The first thing I found, which partly explained my aversion was the “original”
flamewar between torvalds and ast as shown at this link:
http://people.fluidsignal.com/~luferbu/misc/Linus_vs_Tanenbaum.html
Funnily enough Linus in this old exchange suggests that he acknowledges
microkernels as potentially being better, BUT, that he hasn’t seen a decent
implementation. This wasn’t making me feel any better about attacking you on
the issue. :)
I continued looking though and found that Linus wrote a book, in which he
“apparently” attacked OSX, this seemed on topic so I tracked this down, it
turns out that Linus was misquoted, but the following link does show that he
doesn’t like microkernels:
http://www.itworld.com/News/2001/4/LWD010410maccomments/
This was the first indication that he no longer even thought microkernels are
good.
I then started to track down OSX, and was surprised to find numerous
references to the fact that OSX is NOT a microkernel. It is in fact a hybrid
kernel. Apparently one of the real issues with microkernels is their speed
compared to monolithic ones, and as a result many “microkernels” actually
start dumping a lot of userland into kernelland to speed it up, osx is no
exception and thus it can’t call itself a microkernel. This at least
clarified some of my confusion over the userland / kernelland conversation
yesterday as it was quite clear to me that OSX wasn’t a pure microkernel
implementation. A relevant link on this is:
http://www.oreillynet.com/cs/user/view/cs_msg/2719
By now I was interested in what Linus actually DID think about microkernels
and, if he had issues with them, precisely what those issues were. It was
surprisingly hard to get that information, I stumbled across things like:
http://www.ussg.iu.edu/hypermail/linux/kernel/0202.3/0464.html
which suggested that he thought they were basically too slow, wasting time
shuffling data around between rings rather then actually DOING stuff, but I
still wasn’t getting a clear picture. It was interesting to note though that
Alan Cox and some others did like one aspect of microkernels (while being
fairly derrogatory about the rest) and that is security. Apparently because
of the structured rings, and having to pass things cleanly between them, this
leads to an increase in security but at the cost of performance.
Finally I stumbled on :
http://www.sindominio.net/biblioweb/telematica/open-sources-html/node86.html
which clearly states what linux doesn’t like about microkernels and why he
took the approach he did with Linux.
Now I turned to microkernel implementations and found:
http://os.inf.tu-dresden.de/L4/LinuxOnL4/overview.shtml
which amusingly enough was a microkernel implementation on linux, and
according to every resource I could find, supposedly the best micro kernel
around.
wikipedia’s take can be found:
http://en.wikipedia.org/wiki/Kernel_(computers)
and basically says that there is still no successful microkernel
implementations.
What was interesting through all of this was that there was a lot of research
done in the early 90’s around the concept of microkernels, but despite some
papers showing (actually they are not necessarily definitive but are often
quoted as such) that microkernels could run as fast as monolithic one, no one
has EVER implemented one that could. Furthermore if you cast an eye over the
list of monolithic kernels and the list of micro kernels you probably won’t
even recognise any microkernels unless you are an old school geek, they are
just not successful. Now you might claim that they are not successful because
not many people have worked on them, but that is patently not true, a LOT of
money and time was spent trying to make them work, but they just havn’t. Now
I don’t take quite as hard line as linus on them, but it was very notable
just how few success stories I uncovered during my little search last night.
On an amusing side note about the only area where microkernels can claim
success seems to be security, and so there I have to apologise and say that I
was wrong, though I do feel it worthwhile to point out that OSX is not a
microkernel.
I think its also worthwhile pointing out that it is not just Linus that feels
this way. Almost EVERY notable, hardcore OS programmer seems to have a fairly
negative attitude towards them, interestingly enough, including people like
Theo De Raat:
http://slashdot.org/article.pl?sid=00/12/11/1455210&mode=thread
So, to go back to your statements:
1. stability.
I am sure that osx is “Stable”, or appears that way for the desktop, but then
its not really fair to compare it to linux in that context as linux is not
aimed at the desktop (at least not according to most people). Instead a much
better comparison would be to compare osx under heavy load, doing server
tasks. So i started trying to get info on where osx had been deployed in a
server environment and how it had fared. Now if you can, please point me to
information like this, because, after countless google searchs for “osx
deployment enterprise” and the like I couldn’t really find any decent
information, the best was:
http://www.macnewsworld.com/story/33706.html
So I will simply say on this point that for the desktop space it might well be
stable, but then so is Linux, though I will grant you that it probably takes
a bit more knowledge to get Linux desktop to the same level of stability /
functionality as OSX comes OOB.
2. “it just works”.
One of the interesting things you said yesterday was that there is only “one”
version of the kernel at any point in time. Given that, I pose the thought,
is it any wonder it “just works” ? I mean linux has so many ports, so many
kernel versions, its the largest project of its kind in the world and growing
at an astounding rate. I suggest that if there was ONE kernel that all
vendors used then that kernel would also “just work”, it is a direct result
of how linux is written that the kernel is comparatively fragmented and
consequently not as well tested / supported in “one” form. Also bear in mind
that osx only has to support a very limited number of hardware devices, ALL
of which apple has control over. This is in stark difference to the x86 world
of PC’s where there are incredible variety of hardware, which no one person
has control over. So yeah, OSX just works for its hardware, but then if you
have any desire / need for some other hardware, it doesn’t work at all. Again
I will also point out that linux can also “just work”, but it takes more
effort / knowledge.
3. security
There were more security implications then I thought about the microkernel
design and a lot of people seem to think this makes them more secure, these
people know way more the me so i will have to go along with what they say,
though I did find it interesting that the openbsd crowd, including theo, all
think that monolithic is just as good. Still to quickly take it into
specifics, I did some searching and osx has won a few awards in various study
groups for being the most secure OS, but something that these groups /
surveys have failed to take into account (as pointed out by others not me) is
the ratio. Ie almost all of the surveys get a list of vulns / or security
breaches at firms and tally them up and present them. What they seem to
ignore is that right now there are almost no server implementations of osx,
so naturally the pure numbers will be lower. Additionally osx has just not
got the interest that the current unix based alternatives do and consequently
hasn’t had the kind of battering that security community puts anything that
is popular through.
I would hope, and expect, that osx security is good, after all the microkernel
design lends itself to this, but as osx is not a pure microkernel there is a
real risk that some of the userland stuff they have thrown into kernelland
will have security problems and that they will have their fair share of
issues over the coming years.
sorry about the long winded reply, but I was quite interested in micro kernels
a year or so ago, and our debate rekindled that.