Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Get To Know Mach, the Kernel of Mac OS X

Hemos posted more than 9 years ago | from the getting-to-know-all-about-you dept.

Operating Systems 413

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.

cancel ×

413 comments

Sorry! There are no comments related to the filter you selected.

This is a tough fight (4, Funny)

Anonymous Coward | more than 9 years ago | (#12543304)

The apple metrosexuals vs the greasy bearded GNU/linux hippies! Who will win!

Re:This is a tough fight (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12543318)

You will! You do not fail it! All hail Steve Job's dirty shit-covered cock! We love it! We want it! We need it!

Re:This is a tough fight (-1, Flamebait)

DaHat (247651) | more than 9 years ago | (#12543319)

Yes... all the while the forces of Microsoft with their glasses and sweaters laugh as their two arch rivals destroy each other... leaving the minions of Gates to rule the world!!!

Re:This is a tough fight (0)

Anonymous Coward | more than 9 years ago | (#12543353)

their two arch rivals

Mozilla and the DoJ?

Re:This is a tough fight (0)

Anonymous Coward | more than 9 years ago | (#12543480)

"Who will win!"

Microsoft, as usual.

Re:This is a tough fight (2, Funny)

Creepy Crawler (680178) | more than 9 years ago | (#12543601)

Who will Win?!?!

Tune in next week to the same article (poasted at a later dupe-date for your conveinance) and FIND OUT!

We're also to believe that the Apple Metrosexuals plan to use a hypnotizing-GayRay against the dirty hippies!

SAME TIME SAME CHANNEL!

MicroKernel, of course (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12543316)

Linux is great. Almost. But Andy Tannenbaum was right and Linux Torvalds was wrong. Real shame about the Hurd.

apple is shitty (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12543325)

apple is overpriced crap thats no more reliable than a Dell -MikeTROLL

RMS, Is That You? (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12543329)

An anonymous reader writes "Linux is a kernel, not an operating system.

This sounds like the propaganda RMS has been saying the last 10 years in order to get people to say GNU/Linux.

Should start saying Apple/Mach now?

Re:RMS, Is That You? (1, Flamebait)

h00pla (532294) | more than 9 years ago | (#12543492)

Linux is a kernel, not an operating system

Yeh, please stop saying this. It's not true and nobody cares about this argument anymore.

Re:RMS, Is That You? (-1, Flamebait)

megaskins (199874) | more than 9 years ago | (#12543639)

Besides, everyone knows that using Macs will make you gay. . .

Re:RMS, Is That You? (0)

Anonymous Coward | more than 9 years ago | (#12543507)

I'm going with GNU/Apple/Mach, just to be safe.

commence the horse beating (5, Funny)

hector_uk (882132) | more than 9 years ago | (#12543331)

commence the dead horse beating. i start : mach owns.

Re:commence the horse beating (0)

Anonymous Coward | more than 9 years ago | (#12543366)

my mach kernel is bigger than your kernel.

Re:commence the horse beating (0)

Anonymous Coward | more than 9 years ago | (#12543371)

no way d00d, m4ch sux0rs!

GNU/Hurd ROOLZZZ!!!!

(was that too juvenile? oh wait, this is slashdot)

Re:commence the horse beating (1)

hector_uk (882132) | more than 9 years ago | (#12543450)

but as the name suggest mach go's at the speed of sound, therefor it owns you supremely according to the /. poster logic :D-\ :D-/ :D-\ :D-/ :D-\ :D-/ :D-\ :D-/ :D-\ :D-/ /me dances on the linux kernel

Re:commence the horse beating (0)

Anonymous Coward | more than 9 years ago | (#12543644)

"GNU/Hurd ROOLZZZ!!!!"

I believe you mean "L4 ROOLZZZ" as GNU/Hurd isn't a kernel, it's a collection of programs designed to run inconjunction with a microkernel. GNU/Hurd used to use Mach for this, though they've now switched to the much faster L4 microkernel.

Re:commence the horse beating (0)

Anonymous Coward | more than 9 years ago | (#12543473)

Slowest Unix on market, Mach is. Poop is I/O and multiprocessing.

Re:commence the horse beating (1)

hector_uk (882132) | more than 9 years ago | (#12543484)

star wars you not are in you yoda are not also

Re:commence the horse beating (5, Funny)

skraps (650379) | more than 9 years ago | (#12543490)

Bottom line, Mach is the most advanced manual shaving system in the world. The Mach3 Turbo is the world's first triple-blade razor, with three blades positioned independently to shave you progressively closer in a single stroke.

Re:commence the horse beating (0)

Anonymous Coward | more than 9 years ago | (#12543574)

You forgot the thing that makes the Mach3 Turbo the most advanced manual razor: the electric pulses designed to raise your hair in order to get a closer shave.

Re:commence the horse beating (1)

beddess (91414) | more than 9 years ago | (#12543607)

this is one of the best that i've seen in years

Re:commence the horse beating (1, Offtopic)

minimunchkin (838824) | more than 9 years ago | (#12543660)

Take the blade off and you have the world's finest lady pleasuring device. Trust me, it works.

That's the reason Apple's come in those colours... (2, Funny)

Anonymous Coward | more than 9 years ago | (#12543345)

So people can do the

You got a light Mac?
No, but I've got dark brown NeXT machine.

joke.

MirrorDot (4, Informative)

cirisme (781889) | more than 9 years ago | (#12543348)

Huge PDF on Slashdot. This can't end well. Mirror [mirrordot.org]

Re:MirrorDot (0)

Anonymous Coward | more than 9 years ago | (#12543391)

Looking at how many bittorrent articles there are, why dont they just post a torrent

Re:MirrorDot (2, Insightful)

Skye16 (685048) | more than 9 years ago | (#12543414)

Because a lot of us are behind restrictive firewalls at work and can't use BT. It's sad. :(

Re:MirrorDot (2, Funny)

Milo of Kroton (780850) | more than 9 years ago | (#12543426)

Why is .pdf matter? Does not the American Slashdotter not read the article, true?

Re:MirrorDot (0)

Anonymous Coward | more than 9 years ago | (#12543441)

But it's on Wiley's servers. We hate Wiley 'cause they trashed Jobs, remember?

Re:MirrorDot (1)

DJStealth (103231) | more than 9 years ago | (#12543457)

Wiley is a big publisher, I'm sure they have the bandwidth for it.

Monolithic (-1)

epiphani (254981) | more than 9 years ago | (#12543349)

Maybe I'm mixing terms here, but I was under the impression that linux is NOT monolithic - its quite modular. Monolithic translates to no modules, correct?

Just because linux gives you the options of going modular or monolithic whereas most BSD based kernels do not (you will use modules, period) doesnt nessecarily make it a monolithic kernel by design.

Both methods have their advantages, and I personally have always like the BSD kernel method, but the advantages of being capable of building a monolithic kernel with linux have served me well as well. I think linux has a nice balance.

Re:Monolithic (5, Informative)

mmkkbb (816035) | more than 9 years ago | (#12543405)

Monolithic translates to no modules, correct?

I can't believe people are modding you up for this.

The Linux kernel is monolithic. Linux modules do not run in user-mode. They are loaded into the kernel proper.

mkLinux was an Apple-sponsored effort to run Linux on Mach. The Linux kernel was modified to run in user-mode; it basically became an executable. In fact, you could run multiple instances of the same kernel (or different kernels) simultaneously.

Re:Monolithic (-1, Redundant)

uss_valiant (760602) | more than 9 years ago | (#12543422)

mod parent up, GP down.

Re:Monolithic (5, Informative)

wangmaster (760932) | more than 9 years ago | (#12543416)

That is monolithic as well, but not using the term in the same way. Monolithic essentially means made from a single piece. This CAN refer to modules as well, as the kernel modules aren't built into the kernel binary, but in the case of monolithic vs. microkernel, it doesn't refer to how the kernel is built. Rather it refers to the execution of the operating system kernel. A modular Linux kernel loads as a single executable that then loads modules into it's process space as needed to do things. This is essentially a monolithic kernel. The OS runs as a single process. Microkernel's have the OS split as seperate processes, mostly outside the core microkernel (which has the job of facilitating message passing between all these processes, and lowlevel process management). The Microkernel may or may not do I/O, sometimes seperate processes do. Hope that helps.

Re:Monolithic (1, Interesting)

Anonymous Coward | more than 9 years ago | (#12543421)

So if linux adds new capability than you should be able to just add that subroutine in the a directory and it just works. Well nope. You have to compile the entire kenrel to get new features.

Re:Monolithic (5, Informative)

gowen (141411) | more than 9 years ago | (#12543461)

Well nope. You can insert newly compiled modules into a previously compiled kernel to get new features (that's how the many proprietory video drivers work, for example.) But those are
a) running in kernel space, not user space
b) communicated with by predefined hooks, rather than a generic message passing interfacing.

That's why linux modules, which are superficially like elements of a microkernel, are not really like them at all.

I'm Feeling Left Out (-1, Troll)

eno2001 (527078) | more than 9 years ago | (#12543622)

Now that you mention message passing... Anyone want to have at me with the Structured vs. Object-Oriented Programming? I say that Structured programming rules and OPP drools!!!! How about it?

Re:Monolithic (2, Informative)

Anonymous Coward | more than 9 years ago | (#12543437)

> Maybe I'm mixing terms here, but I was under the impression
> that linux is NOT monolithic - its quite modular. Monolithic
> translates to no modules, correct?

No: Both the modules and the rest of the kernel run in the same address space, so Linux is monolithic.

A microkernel approach puts some (most, for second-generation microkernels like L4) traditional kernel features into user space, where they cannot hurt the kernel directly, by overwriting memory.

Re:Monolithic (1)

PoopJuggler (688445) | more than 9 years ago | (#12543438)

Monolithic means it does the bidding of the One Great Monolith that lives on Europa.

Re:Monolithic (1)

Thud457 (234763) | more than 9 years ago | (#12543453)

Although the Linux kernel now supports modules, there are a lot of features traditionally built-in that really should be split off. I mean, really, do the schedualler, line cache, and sphygmometer need to be built into the kernel?!!!

Re:Monolithic (1, Interesting)

Anonymous Coward | more than 9 years ago | (#12543465)

I could be wrong, and I'm sure I'll be told if I am...but the issue is related to what happens at compilation and runtime. In most instances the Linux kernel with the exception of items setup and KLMs are built into a single monolithic kernel, all drivers and kernel related items are in one system. There is no dynamic loading and unloading under this model. But in the case of Mach and even the rest of the OS X system everything that can be put off till later usually is by only loading what is immediately necessary. The kernel is a small item which loads everything else as it needs it instead of being built with everything it may need at compile time.

Mach pushes decisions about what it needs off until runtime instead of compile time and this translates into smaller footprints and quicker startup in most cases. Whereas linux only makes limited use of KLMs and that means most decisions have to be made at build-time and is not put off.

Re:Monolithic (1)

uler (583670) | more than 9 years ago | (#12543468)

No, Linux is monolithic by design, with the option to use modules. Monolithic does not necessarily translate to no modules. It refers mainly to the underlying design of the kernel.

Re:Monolithic (1, Interesting)

Anonymous Coward | more than 9 years ago | (#12543469)

Linux is not 100% monolithic, it does use modules, so it's more like 99% monolithic. The main difference between a microkernel and a monolithic kernel is that the microkernel runs most things in userspace, which is more safe and more interchangeable, but generally thought to be less efficient.

Basically the microkernel is the most beautiful design, I don't think anyone could disagree with that. But a monolithic kernel gets the job done, so it's not like it's bad either.

The apple design is, however, what i'd call bad. They've taken a microkernel (Mach), and implemented a monolithic kernel beneath it, to run their legacy apps!!! It's ugly!

Re:Monolithic (1)

iggymanz (596061) | more than 9 years ago | (#12543471)

Not the way the term is used in computer science, it's not enough to have a modular design or loadable modules for device drivers, but to have a small core that abstracts OS services in an OS agnostic way to higher layers, and that loads the higher layers as needed.

Re:Monolithic (4, Informative)

william_w_bush (817571) | more than 9 years ago | (#12543487)

monolithic in this case also means interface-monolithic.
basically all the interfaces are defined as symbols to the linker, and all interfaces are defined c-native.

the micro-kernels are meant to use message passing and more abstracted interfaces, as well as separate address spaces to ensure a bad module does not take down the entire kernel. Think of it like the modules run as only semi-privileged applications, handling their hardware and then giving control back to the micro-kernel which does as little as possible to arbitrate control and schedule between the subsystems and user-mode applications. Drivers are no longer fully privileged, and the entire user-space can be considered a subsystem of the kernel.

it's different, and kinda hard to design for, but i can't wait for hurd to release a linux compat layer.

Re:Monolithic (3, Informative)

mrm677 (456727) | more than 9 years ago | (#12543522)

Linux modules all run in the same address space. Module functionality is invoked with a function call. A microkernel typically uses a message-passing approach and modules are isolated from one another. A small context switch must occur when invoking something in a microkernel module. Hence the overhead of a microkernel is much greater than a monolithic kernel. However many argue that the overheads are worth the organization and safety advantages that the microkernel gives you-- especially nowadays where for typical appliations, the OS accounts for a tiny fraction of overall runtime.

Re:Monolithic (4, Informative)

bfields (66644) | more than 9 years ago | (#12543541)

Maybe I'm mixing terms here, but I was under the impression that linux is NOT monolithic - its quite modular. Monolithic translates to no modules, correct?

No, you're mixing terms.

  • We say something has a modular design if it's divided into pieces that communicate with each other through small well-defined API's.
  • Linux's kernel modules are bits of kernel code that can be loaded into the kernel at runtime. Usually these modules are also examples of modularity, but they don't have to be. Modules have full access to the kernel's memory, so can do anything the kernel can.
  • In a microkernel drivers, filesystems, etc., all live in a completely separate address space from the kernel, so if, for example, a driver goes bonkers and starts writing to random pieces of memory, the kernel is protected. This forces the design to be somewhat "modular", but again isn't quite the same thing.

So, the linux kernel supports kernel modules, and its design is to some degree "modular" (as any project that size would have to be), but noone would claim it to be a microkernel.

--Bruce Fields

Re:Monolithic (0)

Anonymous Coward | more than 9 years ago | (#12543585)

You are completely wrong, dumbass.

Mono vs. micro has nothing to do with modules. They are irrelevant.

It has to do with how system services are provided. In linux (mono) you get a huge amount of services all provided in "kernel space".

In micro, you get small groups of services provided by "user space" daemon processes.

Most BSD's are also mono. Douchebag.

Monolithic v modular (1)

lheal (86013) | more than 9 years ago | (#12543608)

"Monolithic" and "microkernel" refer to the structure of the kernel program, not to how it's loaded.

Linux drivers (and other "modules") are stored as separate files on disk, or can be compiled in to the kernel. Either way, once they are loaded they form part of the kernel, with all of the rights they need to do whatever they want to your system.

In microkernel architectures, the OS has many layers and a mechanism for keeping them separate, so that the disk driver can't write directly to the screen or affect user processes.

The Linux kernel uses programmer resources liberally to keep separation. There is more and more modularity in Linux as time goes on, but Linus won't ever go fully microkernel because it takes too much away from performance. Better to use "free" programmer time than slow down Linux.

FUD: a Linux module could be or could contain a virus that would have full access to your machine.

Reality: a malware module might mess up your machine, but it would need a really sneaky method of propagation to move to another machine. It basically would have to be part of some distibution to make it onto a significant number of computers.

The malware module problem is also partly why kernel modules should be open source. If you can't see the source, you really don't know what it's doing.

Complete Book reference (4, Informative)

DoctoRoR (865873) | more than 9 years ago | (#12543368)

This appendix on Mach is from the newest edition of the classic "Operating System Concepts," Seventh Edition by Silberschatz, Galvin, and Gagne (Wiley). ISBN: 0-471-69466-5. Published December 2004.

There are also free online chapters for FreeBSD and Nachos.

Link to Wiley's purchase page (given that we are /. them): http://www.wiley.com/WileyCDA/WileyTitle/productCd -0471694665.html [wiley.com]

Ahhh!! Nachos!!! (3, Funny)

LanMan04 (790429) | more than 9 years ago | (#12543440)

*Commence horrible flashback to "OS Design" class as an undergrad*...

Not in book 5th edition -Old Article (1)

acomj (20611) | more than 9 years ago | (#12543488)

Interestingly the chapter was pulled in the 5th edition.. but the chapter was offered online at the time of publishing (it was in my OS class file).

acording to the preface from 5th "coverage of the Mach operating system (old chapter 20), which is a modern os.... is available on line."

Back into relevance? The new article doesn't mention MAC OSX which doesn't mean it completely out of date.

It should be noted that appe hired Avie Tevanian to modify the MACH kernal and boost its performace.

http://everything2.com/index.pl?node=Avie%20Tevani an [everything2.com]

Re:Complete Book reference (1)

LarsWestergren (9033) | more than 9 years ago | (#12543615)

Operating System Concepts (and Operating System Concepts with Java [wiley.com] ) are both great books. However, I think Gary Nutt's Operating Systems [colorado.edu] is actually even better. I found it easier to read (or maybe I've gotten better... it was a while since I read OSC). Nutt's book has a lot of interesting lab exercises at the end of each chapter that you can do either on Windows or Unix/Linux. I found this really helps you understand and remember the concepts.

design is better, performance is worse (4, Interesting)

iggymanz (596061) | more than 9 years ago | (#12543372)

The modular design of microkernels makes for easier design & debugging, and with some designs the freedom to make user space services that can only be in privileged space in monolithic designs, but does one want to pay the overhead for all that message passing? Now that we are getting into parallel processing at the consumer level with multicore and hyperthreaded chips, maybe the answer is yes.

qnx does just fine with a u-kernel and message pas (1)

Thud457 (234763) | more than 9 years ago | (#12543505)

How did qnx avoid the problem of message-passing overhead? (Other than being tuned to a specific architecture until recently.)

Re:qnx does just fine with a u-kernel and message (0)

Anonymous Coward | more than 9 years ago | (#12543530)

I suggest you go read some about the concepts of latency vs throughput...

Re:qnx does just fine with a u-kernel and message (4, Interesting)

RickHunter (103108) | more than 9 years ago | (#12543545)

  1. QNX has been multi-platform for quite a while.
  2. QNX uses shared memory to pass messages. Its message passing is very lightweight, and the resulting performance is far better than Linux.

In this day and age, there is no reason to use a macrokernel unless your hardware lacks the features needed for a microkernel. QNX has proved this quite nicely.

Re:qnx does just fine with a u-kernel and message (2, Funny)

fistfullast33l (819270) | more than 9 years ago | (#12543584)

Andrew Tenenbaum, is that you?

Re:qnx does just fine with a u-kernel and message (2, Informative)

iggymanz (596061) | more than 9 years ago | (#12543621)

QNX is a real time operating system - its message passing only has good performance when there's not too many different types of messages to pass. The desktop versions of QNX work if you are only doing a couple things, like browsing and doing email. But if you try to do the things that a Linux distro could easily do, like burning a CD while writing to USB device and compiling a new kernel and running a dozen windows, it'll choke up: it's NOT suitable for a general purpose desktop.

Re:design is better, performance is worse (2, Informative)

Halo1 (136547) | more than 9 years ago | (#12543643)

The modular design of microkernels makes for easier design & debugging, and with some designs the freedom to make user space services that can only be in privileged space in monolithic designs, but does one want to pay the overhead for all that message passing?

No, which is why Apple's XNU runs in one address space for the most part (I don't even know whether there are parts which don't), and most message passing has been reduced to plain function calls. They still have the design advantages of something which is conceptually built from different subsystems with clean interfaces though.

Why warn us? Super Slashdot Effect (5, Funny)

licamell (778753) | more than 9 years ago | (#12543382)

Warning: link is to a PDF"

Um, if you want to warn anyone maybe you should warn the sys admin of the server that hosts the PDF file that you just put a link to on the main page of slashdot. I think they'll care a little more about the super slashdot effect (I'm coining that term for when a non-html file is linked to from slashdot - be it pdf, mpg, avi, etc.) than we will about taking the extra time to load.

Re:Why warn us? Super Slashdot Effect (0)

Anonymous Coward | more than 9 years ago | (#12543427)

maybe you should warn the sys admin of the server that hosts the PDF file

Pfff, any decent sys admin watches his access log 24/7. He should notice a spike any second now...

Re:Why warn us? Super Slashdot Effect (3, Insightful)

Alpha_Traveller (685367) | more than 9 years ago | (#12543562)

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?

As always... (5, Insightful)

jtpalinmajere (627101) | more than 9 years ago | (#12543383)

... 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.

Missing poll option: (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12543387)

emacs. 'nuff said

Here's an idea for some news - (4, Funny)

Kipsaysso (828105) | more than 9 years ago | (#12543392)

Let's ask what OS is better. The Apple and Linux people will go at each others throats and will in the end agree that they hate Window$.

Smucks.

mach inject (4, Informative)

Kaamoss (872616) | more than 9 years ago | (#12543397)

I thought the article was more than relativly informative. Personally I love my mac and I think it's about time people stop fighting over which OS is better, use the right tool for the job, be that Linux, mac, windows, whatever. Anyways, figured I'd throw in a link to some other cool stuff about mach. http://rentzsch.com/papers/overridingMacOSX [rentzsch.com] The page deals with code injection and function overriding within MAC OS X. I think something like it was on here not too long ago but it's also pretty interesting stuff, I'd suggest the read.

Right tool for the job (2, Funny)

aardwolf64 (160070) | more than 9 years ago | (#12543533)

use the right tool for the job, be that Linux, mac, windows, whatever

Yes. For instance, if you're wanting to test out the effects of the latest greatest spyware, use Windows and IE to do anything on the Internet.

Mac OS X is Mach, but it is not a Microkernel (5, Interesting)

dumbnose (190140) | more than 9 years ago | (#12543402)

Mac OS X uses Mach, but it also uses a FreeBSD kernel and compiles them together. This eliminates the runtime characteristics of a Microkernel. This is actually quite common.

So, even though it uses Mach, you can't call it a Microkernel.

Re:Mac OS X is Mach, but it is not a Microkernel (4, Interesting)

arete (170676) | more than 9 years ago | (#12543503)

I suppose it's possible I'm underinformed, but I believe the "BSD subsystem" of OSX is not compiled "into the kernel" and is entirely a compatibility layer on top of it.

I suspect this is exactly how to never violate the microkernel design and still have BSD compat.

Re:Mac OS X is Mach, but it is not a Microkernel (1, Redundant)

marcosdumay (620877) | more than 9 years ago | (#12543557)

"I suppose it's possible I'm underinformed, but I believe the "BSD subsystem" of OSX is not compiled "into the kernel" and is entirely a compatibility layer on top of it."

Uh hu! Apple has finished Hurd!?

Re:Mac OS X is Mach, but it is not a Microkernel (0)

Anonymous Coward | more than 9 years ago | (#12543586)

OS X does *not* have a FreeBSD kernel!!!! I don't understand why this bit of nonsense is so obsessively held, except that it's then used to justify any insane demand from "the community" because "they owe us". The Unix userland is the FreeBSD part.

Re:Mac OS X is Mach, but it is not a Microkernel (2, Informative)

kilpatjr (65285) | more than 9 years ago | (#12543590)

What? no, that's not right.
It uses the FreeBSD userland utilities, but not the kernel. You can't just compile them together. I mean, it's possible to take parts related to one, like the XYZ bootloader and use it to start the ZYX kernel, you can't just plug in modules or code. The ABIs and APIs are different.
In this case, MacOS doesn't even do that. They just use a lot of the user utilities and such.

Linux the OS that is not an OS? (3, Informative)

TheViffer (128272) | more than 9 years ago | (#12543420)

Linux is a kernel, not an operating system.

Google's definition of Linux [google.com]

I think you have more of a chance to start a discussion on that statement then you do in regards to which kernel is "better".

Re:Linux the OS that is not an OS? (1)

freedom_india (780002) | more than 9 years ago | (#12543479)

Google can "define" anything. It does not mean everything Google links to is correct.

Linux is STILL a kernel and not a pure operating system per se.

Re:Linux the OS that is not an OS? (1)

Mother Sha Boo Boo (883424) | more than 9 years ago | (#12543515)

I think you have more of a chance to start a discussion on that statement then you do in regards to which kernel is "better".

For sure. But I always thought that Linux was indeed only a kernel for the GNU OS, which in some point in the future could be replaced by HURD. Someday.

Tannenbaum Vs Torvalds (0, Troll)

medgooroo (884060) | more than 9 years ago | (#12543423)

If only they posted on /. GNAA-tastic.

Re:Tannenbaum Vs Torvalds (1)

medgooroo (884060) | more than 9 years ago | (#12543604)

I feel hurt. Not a troll, merely pointing out that the editorialising at the end of the article quite blatantly is. sheesh.

Xnu, not mach (5, Informative)

oudzeeman (684485) | more than 9 years ago | (#12543445)

Apple's kernel is called XNU (Xun's not Unix). It is based on Mach with a BSD compatibility layer included at the kernel level (as are various other subsytems usually implemented at a server level in true microkernels), not as a 'mach server'. It does not use Mach as a microkernel. Xnu is a essentially a monolithic kernel. The Mach code takes care of inter-process communication, virtual memory, preemptive multi-tasking, etc. The BSD codebase of XNU handles user ids, file permissions, TCP/IP stack, sockets, filesystems

stop spreading the myth that Xnu is a microkernel

Not a "compatibility layer" (4, Interesting)

argent (18001) | more than 9 years ago | (#12543558)

It is based on Mach with a BSD compatibility layer

It's not just a "compatibility layer". A Mach system consists of multiple servers providing services to each other and to applications. The BSD server in XNU is an essential part of the system... it's the ringleader, and calls the shots from boot onwards.

Great OS Book - but what's Steve up to now? (4, Funny)

kriegsman (55737) | more than 9 years ago | (#12543454)

Operating System Concepts is a great book for learning about what an OS is and the design choices that go into building one. We used that book way back in my college days, and it's one of the few textbooks I actually kept. Here's an excerpt from the (linked PDF) chapter on Mach:
Mach 2.5 is also the basis for the operating system on the NeXT workstation, the brainchild of Steve Jobs, of Apple Computer fame.

So... does anyone here know what Steve Jobs and Mach have been up to since their halcyon days at NeXT?

OT: PDF link clicking extension (2, Informative)

mindaktiviti (630001) | more than 9 years ago | (#12543466)

Firefox has an extension for PDF Downloading which gives you the option to download a pdf link, in case opening pdfs in browsers bothers anyone.

PDF Download [mozilla.org]

Debate? what debate? (3, Insightful)

Toby The Economist (811138) | more than 9 years ago | (#12543482)

"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

Re:Debate? what debate? Yes (1)

omb (759389) | more than 9 years ago | (#12543543)

Yes there is, I am debating you!

Re:Debate? what debate? (2, Funny)

Slashcrap (869349) | more than 9 years ago | (#12543573)

There is no debate. It has been well accepted that micro-kernels are the way to go.

Which is why nowadays it's impossible to find a widely used OS that isn't based on a microkernel!

Mac != Mach (3, Interesting)

frankie (91710) | more than 9 years ago | (#12543500)

Although Darwin does use Mach at the heart, it also has large chunks of the BSD kernel bolted on to avoid Mach's typical performance hit. Consequently, OS X really isn't microkernel, and you can't do all the cool microkernel tricks (load or unload almost anything dynamically, drivers can't crash the OS, etc).

This approach doesn't make much logical sense to me, but it's what Steve and Avie wanted, and somehow, amazingly, it still just plain works.

mach vs posix (4, Informative)

dyfet (154716) | more than 9 years ago | (#12543512)

Mach was never originally engineering for posix compliance, and yet the two main operating systems built from it, osx (and darwin), and hurd, each have tried hard to tame and make mach behave posix compliant. This has sometimes produced interesting compatibility issues, especially in the contenous issue of posix threading, and has resulted in compatability layers which weigh down the system further.

Given this compatibility effort, mach is not a fair comparison, either in hurd or osx, for comparing the merits and performance between that of monolithic and microkernel achitectures because so much extra stuff was added to a design never intended for posix. Something like QNX4 and later, designed both as a microkernel and for posix, or perhaps a pure mach system running applications designed specifically for mach, might be a more fare basis to compare the value of microkernel vs monolithic architectures.

Mach on hurd is easier to grasp and test since many of the lower level mach kernel services are still represented and usable there. Apple seems to be trying to eliminate visibility of as many of the lower level mach services from application developers as possible. Yet, there are still many things that can only be done in the mach kernel on osx or darwin (such as threads that can be cancelled on socket operations or sleeps). If one wanted a bsd/posix compliant environment, I think Apple would have been far better off starting from PPC/xBSD or Linux kernels, rather than trying to rope and rebuild mach to fit into something it was never originally designed for.

They're both better! (4, Insightful)

Pedrito (94783) | more than 9 years ago | (#12543520)

"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?

Re:They're both better! (1)

alta (1263) | more than 9 years ago | (#12543616)

I agree with you on almost all of those examples... Except for one. Pepsi can't hold a candle to Coke! I'm from the south (AL), if I ask for a coke you better not bring me a damn pepsi. Gimme my coke or go get a freakin' SWEET ICED tea.

Re:They're both better! (0)

Anonymous Coward | more than 9 years ago | (#12543625)

Here here, a voice of reason in a sea of pointless conflict.

Re:They're both better! (1)

beddess (91414) | more than 9 years ago | (#12543632)

nope coke is better.

Re:They're both better! (1)

bemenaker (852000) | more than 9 years ago | (#12543635)

AMEN BROTHER!!!

MacOS / Darwin / xnu isn't a pure microkernel (5, Insightful)

Lemming Mark (849014) | more than 9 years ago | (#12543553)

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).

Massive microkernel (1, Interesting)

Anonymous Coward | more than 9 years ago | (#12543561)

Mach must be one of the largest microkernels around. It's also a bit of a cheat - it keeps all the drivers and such inside it. Which means that it's easier to write, perhaps a smidgen quicker, but you loose most of the advantages of such a way of doing things.

I would have thought that you could implement much of Linux in userspace. Certainly file systems and the IP stack could be done easily, leaving just the hardware drivers in there. At that point, you get something that's not a great deal different from the way Mach does it.

This article is troll. (4, Funny)

Anonymous Coward | more than 9 years ago | (#12543566)

Period.

Google html version (0)

Anonymous Coward | more than 9 years ago | (#12543593)

MOD PARENT UP (1)

FhnuZoag (875558) | more than 9 years ago | (#12543618)

(n/t)

Let's secretly watch (5, Funny)

Anonymous Coward | more than 9 years ago | (#12543627)

as we switch Steve Job's kernel beans with new Roaster's Light Linux Beans.

Now, let's see if he notices!

XNU vs Linux. (1, Insightful)

jvd (874741) | more than 9 years ago | (#12543646)

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.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>