From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 2 01:54:38 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82F4416A4D7 for ; Fri, 2 Jul 2004 01:54:38 +0000 (GMT) Received: from smtp106.mail.sc5.yahoo.com (smtp106.mail.sc5.yahoo.com [66.163.169.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 5DE1B43D41 for ; Fri, 2 Jul 2004 01:54:38 +0000 (GMT) (envelope-from q_dolan@yahoo.com.au) Received: from unknown (HELO ?172.22.1.10?) (q?dolan@203.13.70.60 with plain) by smtp106.mail.sc5.yahoo.com with SMTP; 2 Jul 2004 01:53:24 -0000 In-Reply-To: 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> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <98F7E51E-CBCA-11D8-9145-000D9335C6A0@yahoo.com.au> Content-Transfer-Encoding: 7bit From: Q Date: Fri, 2 Jul 2004 11:53:21 +1000 To: Justin Walker X-Mailer: Apple Mail (2.618) cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD and MacOS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2004 01:54:38 -0000 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 _______ / _\