What Is Darwin (and How It Powers Mac OS X)
Pages: 1, 2, 3
File System and Network Support
Darwin's file system and networking support comes from its rich BSD heritage. Its VFS design enables features like long filenames, URL-based volume mounting, and journaling to take place. Darwin's file system can handle just about anything you throw at it: Mac OS Extended/Standard, UFS, UDF, NTFS, and FAT. As the web becomes more and more pervasive, complementary networking support for file system support is a must have, and don't worry--you won't be disappointed.
If you've ever tried to set up networking on a Windows box, you know that it can often be a nightmare. At one point, you might have been changing all sorts of settings on multiple tabs that opened new windows, which also had tabs that had multiple properties with a poor help system. But with Darwin, there's none of that. Darwin's BSD-based extensible network protocol stack gives rise to OS X features such as Bonjour, a zero-configuration networking implementation that eliminates just about all of the hassles that are normally associated with networking. It really can't get much simpler than that. Although features like these are easy to take for granted, they really are gems in Darwin's overall design.
Darwin and Open Source
Apple releases a new version of Darwin on their open source site for each major update to OS X, and it's not long after Apple's release that the folks at OpenDarwin.org provide a corresponding build of OpenDarwin. OpenDarwin is essentially Apple's latest release with modifications to give it some extra features that Apple doesn't provide. These additional features are usually things like X11 GUI support, device drivers, utilities, and support for legacy hardware--basically features that don't directly support Mac OS X.
Although the releases of Darwin under the versions less than 2.0 of the APSL (Apple Public Source License) were criticized by the FSF, the APSL as of version 2.0 does qualify as a free software license, and this is the license that most of Darwin is released under. The FSF, however, considers the APSL 2.0 to still have two primary flaws: it allows linking with other files that can be entirely proprietary, and it is generally incompatible with the GPL. I don't think we'll be seeing any trade secrets like QuickTime, Spotlight, or the Cocoa frameworks being open sourced anytime (ever), so don't hold your breath on this one.
You can download Apple's version of Darwin or OpenDarwin if you want to tinker around and get into the guts of Mac OS X. If you're interested in trying out yet another possibility that comes with some additional bells, whistles, and software mods, take a look at GNU-Darwin--a project that aims to be the "most free" version of Darwin.
The Intel Switch
When Steve Jobs announced the Intel switch, a lot of people freaked out and wondered how on earth an entire OS could be turned around to run on a different architecture in such a short amount of time. Little did they know that Darwin had been leading the way by compiling for x86 alongside of Mac OS X since the conception of OS X--a practice that no doubt provides a significant boost to the overall effort. In fact, you can read about Darwin's 1.0 build right here in an old Advogato diary entry. I guess if you couldn't be there, then this is the next best thing. In the entry you'll even see a reference to fat binaries (universal binaries), a technology we've been hearing a lot about lately that also dates back to the days of NeXT.
For a good grin, check out I've Personally Heard Steve Say They Would Never Do That--a weblog entry that comments on an old Wired news article from 2000. It has some interesting quotes regarding the Intel switch in light of what we now know today.
Now Ya Know
Now you'll never have to wonder what that friendly little message you see in Terminal ("Welcome to Darwin!") ever means again. Hopefully this background has provided you with a better understanding of how Mac OS X works, where it comes from, and how it powers OS X. Now get out there, download the Darwin source, and take a look at how OS X works under the hood.
Matthew Russell is a computer scientist from middle Tennessee; and serves Digital Reasoning Systems as the Director of Advanced Technology. Hacking and writing are two activities essential to his renaissance man regimen.
Return to the Mac DevCenter
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 15 of 15.
-
UDF write support in OS X?
2005-09-29 18:56:10 blalor [Reply | View]
Does OS X (Finder, Disk Utility) support writable UDF media, such as CD-R(W)s? It seems like this should be a given, but I haven't been able to figure out how to format a blank CD-RW with a UDF filesystem. Incremental backups to CD-R media would be so much easier...
-
Free Software Foundation
2005-09-29 15:03:51 phr3d [Reply | View]
I believe the link located on the first page of this document should be Free Software Foundation not Free Software Federation. -
Free Software Foundation
2005-09-30 14:15:04 Matthew Russell |
[Reply | View]
Yep. You are right -- must have slipped my eye during proofing since it was in a hyperlink. We just corrected it. Thanks for pointing that out.
-
How To Get Answers to Really Technical Questions
2005-09-28 12:20:14 Matthew Russell |
[Reply | View]
Wow! I love all of this excitement over such a geeky technical topic!
I response to the recent inquiries, I'd say that your best bet for getting really definitive answers (and maybe even some additional guidance) would be to send Apple's Darwin team a question on their Q&A site: http://developer.apple.com/darwin/news/DarwinQA_TOC.html
It looks like they've been pretty responsive in the past.
I'd imagine that the OpenDarwin team would also be more than happy to respond with some words of advice. (http://www.opendarwin.org/) Try joining the mailing list. If you get some good answers, please post them here for everyone.
-
Tweaking kernel
2005-09-28 12:04:35 valsjo [Reply | View]
Very good info!
Though, I would like more info about if it is possible to tweak/recompile the kernel and install that one instead of Mac OS X Tiger kernel; like you can do with Linux kernels.
Apple doesn't say much about this.
If I look at other sites about Darwin, often they just talk about how to install a completeley new Darwin system, but not if you can "replace" Apple's kernel with another one.
O'reiily: more technical articles, likes this one, about Darwin/Mac OS X are most welcome! -
Tweaking kernel
2006-01-05 08:20:11 xyzxyz [Reply | View]
Some people may wonder why one would want to replace the mach kernel.
I for one want to run CNC software on my Mac that requires RTAI, a realtime modification that requires intercepting interrupts before they are handled by the kernel. There is currently no patch to the MACH kernel to support this realtime software.
Alan -
Tweaking kernel
2005-09-29 05:29:05 Mafretete [Reply | View]
Yes, you can replace the Mac OS X kernel and compile one yourself. For example, it was not possible to spoof your MAC address with Mac OS X <= 10.3, but you could modify the Darwin source code to allow this and use the recompiled kernel with Mac OS X. -
Tweaking kernel
2005-09-28 16:40:44 DanielEran [Reply | View]
Recompiling the kernel is a common topic for Linux users because its kernel design requires recompiling everytime you add driver support for a device. This is not a desired feature.
The point of kernel extensions in the I/O Kit is to allow Mac OS X's kernel to dynamically load device drivers as needed when booting. Linux can't do this. Do you want to muck with compiling your kernel when you change your hardware? Yikes!
Also, "kernels" aren't some kind of module you can pop in and out. Even within Linux, there are scores of dependancies between applications and the specific version of the Linux kernel. And you obviously can't drop in another kernel in place of Linux and expect your system to somehow work.
By the same token, it is innane to suggest that it would be possible (or useful) to replace the Darwin kernel with Linux (or the NT kernel, or even BSD). It would be problematic even to get the Tiger (Darwin 8) kernel to work in Jaguar (Darwin 7).
Darwin's use of Mach makes it significantly different from most other Unix/Linux distributions. The windowserver (and everything else!) is closely integrated with Mach's messaging structures; you simply could not replace Mach with a more conventional style kernel without redesigning the entire architecture of Mac OS X.
And why would you want to? Linux does not have some magical advantage in performance over Darwin when similarly tasked and similarly equiped.
Sure you can customize the Linux kernel and build in support for specific things and trim out features that result in a faster, tuned system fit for a specific purpose, but that (a tunable server system) isn't what Apple is trying to provide at all.
Linux, conversely, will never approach the ease of use, familiarity, consistancy and integration that Apple has aimed for when engineering Mac OS X's architecture.
The idea of a "kernel" is a bit of an abstraction anyway. There is not a clear line between what is exactly the kernel and other components that interact very closely with it.
-
Tweaking kernel
2005-09-28 22:03:32 John_Fieber [Reply | View]
The point of kernel extensions in the I/O Kit is to allow Mac OS X's kernel to dynamically load device drivers as needed when booting. Linux can't do this.
Um, Linux has had dynamically loadable kernel modules for a long time. So has FreeBSD. So has Solaris and about every other contemporary Unix I can think of. -
Tweaking kernel
2005-09-29 05:18:48 Mafretete [Reply | View]
The problem with Linux is that you cannot ship a precompiled kernel module - it would not work with a slightly different kernel. On Mac OS X, most kernel extensions for OS X 10.3 still work in OS X 10.4, even though 10.4's kernel is much newer.
-
Will Darwin continue to be open source?
2005-09-28 03:56:31 Mafretete [Reply | View]
One thing about the Intel switch hasn't been discussed here:
Apple needs (and wants) to protect the Intel version of Mac OS X, so that it will only run on genuine Apple computers and not on otherwise compatible industry standard PCs. To do so, they will have to put some kind of protection in the kernel. It will be much easier for hackers to disable this protection if they have access to the kernel source code (via Darwin). So has Apple already confirmed that Darwin will stay open source even after the Intel switch? -
Kernel source may not be enough to port OS X
2005-09-28 08:56:25 Reedo [Reply | View]
If the restriction of OS X to Apple hardware uses code embedded in the hardware (which Apple makes), then the kernel source may be as open as can be. One key in a cryptographic pair could be in the hardware, say, and the other could be in the kernel source. Running OS X on a non-Apple PC might require a mod chip like people have done with the XBox. Plus, as this article indicates, not all of OS X is open source now anyway, so whatever interesting parts of OS X handle the Apple hardware restriction may just be in a closed-source portion, with some bare hooks into the kernel. -
Kernel source may not be enough to port OS X
2005-09-28 15:36:46 Mafretete [Reply | View]
But there's a big difference between Linux on the XBox and Mac OS X on PCs. Linux on the XBox has to "persuade" the hardware to run it. The hardware contains the protections and prevents other OSes from running.
When you run Mac OS X on Intel, the hardware does not prevent OS X from running in any way. Instead, the OS has to detect that it's not running on a Mac. Every protection built into the kernel can be easily disabled if you have the kernel source. So there are only two possibilities: 1.) Apple puts the restrictions in (many) closed-source portions, e.g. Quartz, or 2.) Apple does no longer release the kernel source.
-
Thanks!
2005-09-27 20:44:03 Macam [Reply | View]
I just wanted to say thanks for putting the article together. Although more experienced hands may find a lot of this to be old hat, for those of us who are still trying to dig deeper into these types of things, articles like these are a great resource, especially with the accompanying links.





