Get To Know Mach, the Kernel of Mac OS X
An anonymous reader writes "Linux is a kernel, not an operating system. So what is Mac OS X's kernel? The Mach microkernel. The debate around Monolithic (Linux) and Micro (Mach) kernels continues, and there is a great chapter online about the Mach system from the very good book 'Operating System Concepts'. Which design is better? I report, you decide." Warning: link is to a PDF.
... benefits and detriments exist for both monolithic and micro flavors. I doubt a conclusion could ever be made about which one is 'better'... because it all depends on context. "How will the system be used?" "What kind of environment will the system be operating under?" "What are the performance goals of the system?" "What types of hardware will the system(s) need to support?"
Each system has benefits... but they almost always rely on the existence of certain assumptions.
Because a lot of us are behind restrictive firewalls at work and can't use BT. It's sad. :(
"The debate around Monolithic (Linux) and Micro (Mach) kernels continues..."
There is no debate. It has been well accepted that micro-kernels are the way to go.
--
Toby
"Which design is better?"
What's better? PHP or Python? What's better Pepsi or Coke? The answer is always the same. It depends what your goals/needs/desires are. Neither is "better" in the all encompassing good or bad definition unless you qualify it. Which one's better for performance? Probably the monolithic kernel. Which one's better for security? Probably the micro-kernel. But even then, you have to qualify both of those. Performance of what? Security of what?
I'm sick of all these stupid "which is better?" religious wars that geeks are always so interested in having. What's better? C++ or Java? What's better? IE or Mozilla?
They're all better because the more there are, the more choices you have. There, is that a satisfactory answer?
That's a statement not a criticism by the way ;-)
In general, monolithic kernels run in a single address space and use direct procedure calls / variable accesses to pass data and control flow between subsystems. This is true even if they support loadable modules (like Linux). Any driver or other subsystem in your kernel can (if it wants) access any other part of the kernel.
Although Mach itself is a microkernel, the "xnu" kernel which Darwin / MacOS X uses also hosts other components *in the same address space*. Some of the subsystems (e.g. the BSD subsystem) are large and resemble monolithic systems themselves. The overall system is not a "pure" microkernel, with lots of code moved out of privileged mode. Equally, it's not quite like a traditional monolithic UNIX because of the use of Mach and the other Darwin-specific components (e.g. a (relatively?) stable binary interface for drivers).
Or heck, how about at least telling us how big the PDF file is, so I know the size of the monster I *might* have to download?
"Love is like pi - natural, irrational, and very important." (Lisa Hoffman)
Apple's XNU (Darwin), is simply superior in many ways. With the OS X kernel you simply get the best of both worlds, the best things of a monolithic BSD kernel, while a lot of advance features of the Mach microkernel.
Apple's XNU is the way kernels will be in the future. The future is Hybrid kernels. Stop arguing.
Insanity: doing the same thing over and over again and expecting different results.
There is a debate. It has not been completely accepted that micro-kernels are the way to go.
I'm not quite sure why you think an inert, unmoving stick of plastic roughly shaped like a pencil would be a fine device to pleasure a lady with. There are plenty of other options in various textures (and some that vibrate) built just for that purpose.
--
Evan
"$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
Here is your answer: For the most part, Mac people don't even know what the heck a kernel is. Linux people are nearly required to.
My beliefs do not require that you agree with them.
Linux is in spirit a monolithic design, and MacOS is in spirit a mach-based microkernel design.
In reality, though, both MacOS X and Linux have departed from the architectures in mostly pragmatic ways. OS X is not a "pure" microkernel in the mach sense.
you're crazy, a RTOS is designed to handle that kind of load. On a submarine or on your PC. That's what real-time means. Next time XMMS starts stuttering when doing a compile, remember that you're using a non-RTOS
Python, and mozilla are both significantly better than what you compared them too. And C++ vs Java is like monolithic kernel vs cheddar cheese, they aren't designed as or used for the same things at all, so of course neither is "better".
The only comparison of yours that really works is coke vs pepsi. And obviously the answer is coke.
Your point about simple system calls is pretty wrong. Sure, the simplest system call that has no real body will execute twice as fast without extra context switching, but if the system call is non-trivial, then the context switch overhead becomes a small percentage of the time. So at worst, it's twice as slow, and at best, it's just as slow. ;) Thus is the folly of microbenchmarking--it doesn't measure system performance, just how fast you can do one thing. The real problem with microkernels is that you can always do in a macrokernel what you can do in a microkernel, it's just more engineering effort in the kernel and possibly requires a reboot.
What's interesting is the utter irrelevance of the slashdot posting to the book excerpt. Slashdot talks as if it's a detailed article on the internals of Darwin, which is the OSX kernel, NOT MACH. Darwin is based on Mach, yes, but it's not Mach. And the article never once mentions OSX, or Apple, or Macs. One must seriously wonder...is the ability to read included in the job requirements for a slashdot editor?
Actually that's an EXCELLENT point... by your rationale we should actually stop calling it OS-X and just call it Mach, since the kernel apparenlty gets to name the whole OS. Oh wait, you say that the rest of the OS took a lot of hard work to develop? Maybe calling Linux just plain GNU would make more sense.
Jeremy
Ahem, the point the poster was making was about modern desktop computers going multicore, in which case you cannot discount the possibility that the message will be going from an OS process active on one core to an OS process active on another core. This can potentially involve zero context switches. So "AT BEST" would not be twice as slow...
I hate flamewars, but as been said by many people many times, RMS does not get to define opensource. OpenSource existed long before RMS, and will exist after his demise. If you want to talk about fighting for open code, remember that the Regents of UCB fought for opensource code in a court case, and can say that they won.
RMS is very important, but he's a zealot, and a lot of people don't agree with his views (I for one don't on a lot of issues). Don't get caught up in the whole Saint iGNUcious thing.
Some of us apple fan boys happen to have extensive backgrounds (and educations!) in Computer Science, and OS Theory in general. Linux isn't the only playground of the smart and educated.
I just had to comment, your post is very refreshing and what I remember the OLD days of Slashdot being like.
It really isn't so hard to say, all OSes have really cool things about them, and we should talk about these cool things, as they enrich the OSes we develop for or use.
Why can't something Microsoft does actually be cool, or something Apple does actually be outstanding, or a *nix project create a whole new paradigm that is fantastic.
Anyway, thanks for the feeling of the old days when people didn't bite immediately when keywords like Microsoft, Apple, BSD, or Linux were used.
Take care...