Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jul 2004 11:53:21 +1000
From:      Q <q_dolan@yahoo.com.au>
To:        Justin Walker <justin@mac.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: FreeBSD and MacOS
Message-ID:  <98F7E51E-CBCA-11D8-9145-000D9335C6A0@yahoo.com.au>
In-Reply-To: <FAA25E7E-CB94-11D8-AFC7-00306544D642@mac.com>
References:  <40E1CAAD.3000303@minimum.se> <40E1CF00.2090601@netli.com> <1088557263.3528.102.camel@host-83-146-2-180.bulldogdsl.com> <72A1AE29-CA60-11D8-988E-000A95C969C6@zumbrunn.com> <9B616D82-CB28-11D8-9145-000D9335C6A0@yahoo.com.au> <FAA25E7E-CB94-11D8-AFC7-00306544D642@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/07/2004, at 5:29 AM, Justin Walker wrote:
> On Jun 30, 2004, at 23:33, Q wrote:
>
>> Darwin still uses a Mach kernel design, although Apple has made some  
>> significant modifications to its implementation to reduce message  
>> passing overhead and latency etc, making it something of a hybrid and  
>> no longer a pure micro-kernel.
>
> To get pedantic, the Darwin kernel of Mac OS X is not a microkernel.   
> Although it used the code-base of Mach 3.0 as a starting point, it is  
> monolithic, as were the pre-3.0 versions of Mach.  In fact, I doubt at  
> this point that you could get any micro-kernel functionality to work  
> based on Darwin.

Correct, the Darwin kernel is not a micro-kernel (I never said it was),  
but it is not monolithic either, to be pedantic it is actually a  
"hybrid kernel" (1) or modified micro-kernel because it shares the  
message passing design of a micro-kernel, but includes otherwise  
"non-essential" components in kernel space.

(1)  
http://en.wikipedia.org/wiki/ 
Monolithic_kernel#Hybrid_kernels_.28modified_microkernels.29

>> As a result the Darwin Mach kernel is not the traditional Mach mix of  
>> userspace/kernelspace RPC connected components, instead the kernel is  
>> linked into a single address space, using kernel extensions (loadable  
>> modules) in a similar way FreeBSD does.  However these extensions are  
>> implemented using a highly object oriented API (IOKit) for  
>> interacting with the kernel, instead of the traditional struct  
>> passing procedural approach used in FreeBSD.
>
> The device driver model (IOKit) is C++, using the "embedded C++"  
> constraints to avoid a huge C++ runtime in the kernel.  Other  
> extensions (file system and network plugins), however, are not.

This is true, I should have been more specific, I was attempting to  
highlight the most obvious difference without going into too much  
detail.

>> The portions of the FreeBSD kernel that Apple have adopted can be  
>> found as part of the XNU project (the darwin kernel) from Apple's  
>> Opensource website
>> http://www.opensource.apple.com/darwinsource/
>> The CVS tags should still be intact on the files in question.
>>
>> While FreeBSD provides a sizable chunk of Darwin's BSDness, it still  
>> has a decent amount of legacy NeXT/BSD code in it as well.
>
> I'm not sure precisely what you mean here, but the Darwin kernel has  
> been completely rewritten since the days of NeXT.  There may be minor  
> bits of NeXT code left, but I don't think it's much.

Ok, let me rephrase, I'm referring specifically to BSD kernel code.  
While there is a sizable amount of "BSD" code taken primarily from  
FreeBSD in the darwin kernel, there is still a reasonable amount of  
original "BSD" code (4.3/4.4BSD) that has come indirectly into the code  
base (via NeXT, you can tell by the license body) and not directly from  
the FreeBSD source tree.  That's not to say there is much difference in  
a lot of cases, but any FreeBSD specific alterations will not be  
represented in these portions of the code. The UFS/FFS code is a prime  
example. A lot of the UFS/FFS code in both FreeBSD-5 and Darwin is  
quite different due to evolutionary changes in FreeBSD (eg. snapshots,  
UFS2, softupdates), but there are also some files that have been  
virtually unaltered from 4.4BSD and in these cases it wouldn't really  
matter where they came from.

The point I was making is that there is still a bit of a mixture of  
sources that make up the BSD'ness of Darwin, and as a result there are  
still some notable parts of FreeBSD missing.

>> Some of the things that have been adopted from FreeBSD/NetBSD in the  
>> Darwin kernel include:
>>
>> Crypto support
>> Filesystem support for CD9660, DEVFS, NFS, VFS, MEMDEV (Curiously  
>> this doesn't include UFS/FFS support)
>> IP & IPV6 TCP stack support including BPF & IPFW
>> Most of the BSD/Posix/SYSV system calls (sysctl, fork, exec, ktrace,  
>> mmap, etc) and corresponding MAN pages.
>
> Sounds like you've been doing some homework :-}

Yes, you might say that I have developed a rather healthy interest in  
the topic recently.

-- 
Seeya...Q

                -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

                           _____  /  Quinton Dolan - q_dolan@yahoo.com.au
   __  __/  /   /   __/   /      /
      /    __  /   _/    /      /        Gold Coast, QLD, Australia
   __/  __/ __/ ____/   /   -  /            Ph: +61 419 729 806
                     _______  /
                             _\




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98F7E51E-CBCA-11D8-9145-000D9335C6A0>