freebsd-advocacy Digest, Vol 248, Issue 1

Robert Watson rwatson at
Sat Aug 2 11:50:31 UTC 2008

On Tue, 29 Jul 2008, Szilveszter Adam wrote:

> On Mon, Jul 28, 2008 at 08:02:23PM +0200, Salvatore Albanese wrote:
>> We must remind that apple experimented with UNIX many years ago and now use 
>> the Darwin distro for MAC OS X. This is a big statement! Imagine a BSD 
>> distro that is so easy even windows users find it confortable. 20% of the 
>> windows market moved to MAC OX S in that last 18 months.
> While I agree that decent, and enthusiastic (but not zealot) advocacy is a 
> good thing, I think it is very important to say the truth.
> It is just too frequently that I here statements that essentially say: 
> "MacOS X is just FreeBSD with an Apple GUI on it". That's just not true. The 
> Darwin kernel is a Mach kernel (something that the BSDs do not have and did 
> not have with the exception of the failed attempt xMach) which is very 
> different from the BSD kernel. Darwin only implements some (many) APIs and 
> borrows some code from the BSDs (like the network code, but boy, there is 
> hardly an OS that does not have BSD-derived TCP/IP code somewhere in it) and 
> contains userland applications that were ported from the BSDs. But that does 
> not make it a BSD system. Otherwise, it would be truly difficult to explain 
> why it took so long for FreeBSD to grow suport for the PPC arch, when Darwin 
> was already out there :-)

I'd be a bit cautious about saying XNU is a Mach kernel.  XNU is not a 
microkernel, but it contains a lot more Mach code than FreeBSD does. 
However, XNU contains massive amounts of FreeBSD code, including countless IPC 
models, security parts, VFS, network stack, distributed file systems, etc. 
Saying that "Mac OS X is just FreeBSD with an Apple GUI" is certainly false on 
face value, but it's not correct to say that the kernel isn't in significant 
part FreeBSD-derived.  Here's what I find in my most recent XNU kernel source 
drop from Apple:

   21M of code labeled explicitly as BSD, largely from FreeBSD but heavily

   16M of code labeled explicitly as Mach, largely from OSF Mach, but heavily

   676K of code labeled explicitly as Security, actually the TrustedBSD MAC
   Framework from FreeBSD, with modifications.

   2.7M of device driver code in the IOKit tree, mostly from Apple.

   2M of "libkern" -- mostly Apple code (C++ parts for IOKit) and zlib.

And then some loose ends, such as libsyscall, which is really userspace code 
but stored in the kernel source tree, configuration files, GDB macros, etc.

The above is just the XNU drop, so excludes the large number of additional 
loadable kernel extensions (kexts), which include a lot of device drivers 
(largely Apple and vendor code), but also things like smbfs (pretty much 
verbatim FreeBSD code).

> If you want to brag about FreeBSD technology used in a mainstream product, 
> then by all means mention Firefox 3, because that is already quite 
> impressive.

This is true, but if you measure the proportion of Firefox code that is 
FreeBSD vs the proportion of XNU code that is FreeBSD, we definitely have more 
of a showing in XNU, making up a significant part of the product :-).  One 
shouldn't underestimate Apple's work to improve our code and produce new 
facilities, some of which has come back to FreeBSD, but likewise they gained a 
lot by using all that FreeBSD code, not to mention hiring a lot of FreeBSD 
developers to work on the product.

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the freebsd-advocacy mailing list