inside the mac os x kernel
DESCRIPTION
A presentation by Lucy, at the 24th Chaos Communication Congress, Berlin, 28 Dec 2007. http://events.ccc.de/congress/2007/Fahrplan/events/2303.en.html http://lanyrd.com/2007/chaos-communication-congress-24c3/scgypr/TRANSCRIPT
![Page 1: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/1.jpg)
Inside the Mac OS X Kernel
Debunking Mac OS Myths
lucy28 Dec 2007
![Page 2: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/2.jpg)
microkernel
Mach
FreeBSD
C++64 bit
Open Source
UNIX
![Page 3: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/3.jpg)
microkernel
Mach
FreeBSD
C++64 bit
Open Source
UNIX
On the Mac, this kernel is called Mach
Paul Thurrott, http://www.winsupersite.com/reviews/macosx_puma.asp
![Page 4: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/4.jpg)
microkernel
Mach
FreeBSD
C++64 bit
Open Source
UNIX
http://developer.apple.com/internet/
with its stable open-source core based on FreeBSD 5.0
![Page 5: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/5.jpg)
microkernel
Mach
FreeBSD
C++64 bit
Open Source
UNIXMac OS X for UNIX UsersThe power of UNIX with the simplicity of Macintosh.
FeaturesOpen source, UNIX-based foundation
• SMP-optimized kernel based on FreeBSD 5 and Mach 3.0
• 64-bit virtual memory based on the LP64 model
• Standard libraries and utilities for easy porting of Linux, UNIX, and POSIX source code
• Hand-tuned, standards-compliant scalar and vector math libraries
• UNIX GUI support via native toolkits and included X11 server
• Open source code available via the Darwin project
Standards-based networking• Complete IP-based architecture supporting
IPv4, IPv6, and L2TP/IPSec VPN • Rich zero-configuration discovery and naming
via Bonjour and Dynamic DNS• Interoperable file serving via NFS, AFP,
SMB/CIFS, and FTP • Powerful Apache services (httpd, DAV, PHP)• Open Directory services built on LDAP and
Kerberos for single sign-on
Comprehensive UNIX user environment• Standards-based graphics built on PDF
(Quartz), OpenGL, H.264, and MPEG-4 (QuickTime)
• Xterm-compliant Terminal integrated with Aqua user interface
• Choice of shells (bash, ksh, csh) and scripting languages (Perl, Python, Tcl, Ruby)
• Enhanced with Spotlight searching, Xgrid queuing, and Automator workflows
• Comprehensive UNIX/Linux utilities (emacs, vim, gnutar, make)
• Xcode 2 developer tools with GCC 4.0 for optimized code generation and ISO/IEC 14882:2003 C++ support
Technology BriefMac OS X for UNIX Users
Mac OS X version 10.4 Tiger combines a robust and open UNIX-based foundation with the richness and usability of the Mac interface, bringing UNIX technology and 64-bit power to the mass market. Apple has made open source and standards a key part of its strategy to deliver an industrial-strength operating system that is both innovative and easy to use.
There are over 15 million Mac OS X users—scientists, animators, developers, system administrators, and more—making Mac OS X the most widely used UNIX-based desktop operating system. In addition, Mac OS X is the only UNIX-based environment that natively runs Microsoft Office, Adobe Photoshop, and thousands of other consumer applications—all side by side with traditional command-line, X11, and Java applications. Mac OS X is also the foundation for Mac OS X Server, which makes open source software easy to administer. Tight integration with Apple hardware, from the sleek PowerBook G4 to the award-winning Xserve G5, is making Mac OS X the platform of choice for an emerging generation of UNIX users.
http://images.apple.com/macosx/pdf/MacOSX_UNIX_TB_v2.pdf
UNIX-based foundation
![Page 6: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/6.jpg)
microkernel
Mach
FreeBSD
C++64 bit
Open Source
UNIX
Steve Jobs, WWDC 2007
“Leopard is 64 bit top to bottom.”
![Page 7: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/7.jpg)
microkernel
Mach
FreeBSD
C++64 bit
Open Source
UNIX
Miles Nordin, http://www.linuxjournal.com/article/6105
Obsolete Microkernel Dooms Mac OS X to Lag Linux in Performance
![Page 8: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/8.jpg)
Mac OS
Macintosh
1985 1990 1995 2000
128 KBM68K3.5”
single tasking
![Page 9: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/9.jpg)
Macintosh
1985 1990 1995 2000
128 KBM68K3.5”
single tasking
System 7
PowerPCmultitasking
![Page 10: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/10.jpg)
Mac OS
Macintosh
1985 1990 1995 2000
128 KBM68K3.5”
single tasking
System 7
PowerPCmultitasking
Copland ?
![Page 11: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/11.jpg)
Jobs
Jobs
1985
Apple
NeXT
![Page 12: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/12.jpg)
![Page 13: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/13.jpg)
Jobs
Jobs
1985
Gassée
1991
Gassée
Apple
NeXT
Be
![Page 14: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/14.jpg)
![Page 15: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/15.jpg)
Jobs
Jobs
1985
Gassée
1991
Gassée
1996
?Apple
NeXT
Be
+ ?
![Page 16: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/16.jpg)
+
Jobs
Jobs
1985
Gassée
1991
Gassée
1996
JobsApple
NeXT
Be
![Page 17: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/17.jpg)
http://www.hawkwings.net/wp-content/uploads/2006/07/stevesellsNeXT.jpg
![Page 18: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/18.jpg)
http://www.photonhunter.co.uk/~art/computers/nextscreenshot.gif
![Page 19: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/19.jpg)
NEXTSTEP
NeXTNEXTSTEP 1.0
UNIX basepreemptive multitasking
memory protectionDisplay PostScript
68K
NEXTSTEP 3.1
i386PA-RISCSPARC Apple acquisition
RhapsodyPowerPC
Mac OS X 10.0
1985 1990 1995 2000 2005
i386
![Page 20: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/20.jpg)
XNU
Mach BSD I/O-Kit
X is not UNIX
![Page 21: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/21.jpg)
Monolithic Kernel
libc
kernel mode
user mode
App App App
hardware
MM schedHW IPC
VFS
API
secdev
net
![Page 22: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/22.jpg)
Microkernel
libc
kernel mode
user mode
App App App
hardware
MM schedHW IPC
VFS
API
secdev
net
![Page 23: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/23.jpg)
BSD Single Server
BSD
libc
kernel mode
user mode
App App App
hardware
MM schedHW IPC
VFS
API
secdev
net
![Page 24: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/24.jpg)
4
3
0
write();
user
kernel
write() {
}
monolithic
![Page 25: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/25.jpg)
ipc();
4
3
0
ipc();
user
kernel
ipc() {
}
microkernel
![Page 26: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/26.jpg)
ipc();
4
3
0
ipc();
user
kernel
ipc() {
}
microkernel
BSD
write() {
}
![Page 27: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/27.jpg)
ipc();
4
3
0
ipc();
user
kernel
ipc() {
}
microkernel
![Page 28: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/28.jpg)
BSD Single Server
MM schedHW IPC
VFS
API
secdev
libc
kernel mode
user mode
App App AppBSD
hardware
net
![Page 29: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/29.jpg)
Co-location
MM schedHW IPC
VFS
API
secdev
libc
kernel mode
user modeApp App AppBSD
hardware
net
![Page 30: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/30.jpg)
Mach
4
3
0
4
3
0
4
3
0
task task task4
0
RAM
ROM
VGA
I/OI/OI/O
• memory management
• scheduling
• inter-process communication
![Page 31: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/31.jpg)
Mach IPC4
3
0
4
3
0
![Page 32: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/32.jpg)
Mach Interface Generator (MIG)
4
3
0
4
3
0
main() { func(1,2,3);}
func(a,b,c) {
}
MIGgenerated
code
func(a,b,c) { msg.a = a; msg.b = b; msg.c = c; send(msg);}
receive(msg);a = msg.a;b = msg.b;c = msg.c;func(a,b,c);
![Page 33: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/33.jpg)
signalPOSIXthread
process
Mach + BSD
task thread exceptionMach
BSD
schedulerMM IPC
VFS BSD sockets
/dev
syscalls
int/exc
kerneluser
fork() open() ...
mach message
syscalls
int 0x80
%eax>0 <0
![Page 34: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/34.jpg)
Drivers
driver.c driver2.c
![Page 35: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/35.jpg)
Drivers
driver.c
#ifdef
#ifdef
#ifdef#ifdef
#ifdef
![Page 36: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/36.jpg)
I/O-Kit
special.ccgeneric.cc
![Page 37: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/37.jpg)
![Page 38: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/38.jpg)
![Page 39: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/39.jpg)
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>msdosfs</string> <key>CFBundleIdentifier</key> <string>com.apple.filesystems.msdosfs</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>msdosfs</string> <key>CFBundlePackageType</key> <string>KEXT</string> <key>CFBundleShortVersionString</key> <string>1.5</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.5</string> <key>IOKitPersonalities</key> <dict/> <key>OSBundleLibraries</key> <dict> <key>com.apple.kpi.bsd</key> <string>8.0.0</string> <key>com.apple.kpi.libkern</key> <string>9.0.0d3</string> <key>com.apple.kpi.mach</key> <string>8.0.0</string> <key>com.apple.kpi.unsupported</key> <string>8.0.0</string> </dict></dict></plist>
Info.plist
<key>OSBundleLibraries</key> <dict> <key>com.apple.kpi.bsd</key> <string>8.0.0</string> <key>com.apple.kpi.libkern</key> <string>9.0.0d3</string> <key>com.apple.kpi.mach</key> <string>8.0.0</string> <key>com.apple.kpi.unsupported</key> <string>8.0.0</string> </dict>
![Page 40: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/40.jpg)
BootingPC/BIOS
MBR
?
BIOS
640KBRAM
Video
1 MB
0 MB
![Page 41: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/41.jpg)
BootingEFI
GPT EFI
2 GBRAM
Video
4 GB
0 GB
HFS+
HFS+
/System/LibraryCoreServices/boot.efiCaches/com.apple.kernelcaches/Extensions
mach_kernel
![Page 42: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/42.jpg)
http://clc.its.psu.edu/Labs/Mac/Resources/blastimageconfig/images/SigBuild/Intel-Sig-BootPicker.JPG
![Page 43: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/43.jpg)
libSystem.dylib: Mach-O universal binary with 4 architectures
Mach-O$ file libSystem.dylib
libSystem.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppclibSystem.dylib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64libSystem.dylib (for architecture i386): Mach-O dynamically linked shared library i386libSystem.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/lib/usr/lib64
C:\WINDOWS\SYSTEMC:\WINDOWS\SYSTEM32C:\WINDOWS\SYSTEM64
/mach_kernel: Mach-O universal binary with 2 architectures/mach_kernel (for architecture i386): Mach-O executable i386/mach_kernel (for architecture ppc): Mach-O executable ppc
$ file /mach_kernel
![Page 44: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/44.jpg)
Rosetta
hardware
XNU
userkernel
libSystem
libA libB libC
ppci386
hardware
XNU
libSystem
libB
PowerPC app
libC
Rosetta (byte swapping)
Rosetta (byte swapping)
PowerPC app
libA
Rosetta (dynarec)
Rose
tta
(dyn
arec
)
![Page 45: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/45.jpg)
Architectures
i386
i386PA-RISCSPARC
PowerPC(i386)68K
1990 1995 2000 2005
![Page 46: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/46.jpg)
3/1 Splitkernel
user
Windows, Linux, ...
4 GB
3 GB
0 GB
useruseruser
![Page 47: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/47.jpg)
userkerneluserkernel
4/4 Split
Mac OS X Intel
4 GB
0 GB
switcher
![Page 48: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/48.jpg)
userkerneluser
4/4 Split
Mac OS X Intel
4 GB
0 GB
switcher
![Page 49: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/49.jpg)
x86_64
kernel
intr handler2^47
04 GB userkernelkernel
![Page 50: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/50.jpg)
x86_64
kernel
intr handler2^47
04 GB user
![Page 51: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/51.jpg)
x86_64
user
intr handler2^47
04 GB
![Page 52: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/52.jpg)
iPhone
• ARM
• Custom Bootloader
• No real KEXTs
• Kernel Cache
![Page 53: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/53.jpg)
![Page 54: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/54.jpg)
![Page 55: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/55.jpg)
![Page 56: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/56.jpg)
![Page 57: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/57.jpg)
What Makes XNU Great
![Page 58: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/58.jpg)
What Makes XNU Great
#8dtrace
![Page 59: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/59.jpg)
What Makes XNU Great
#7kernel cache
![Page 60: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/60.jpg)
What Makes XNU Great
#6Separation between Mach, BSD, I/O-Kit
![Page 61: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/61.jpg)
What Makes XNU Great
#5POSIX Conformance
![Page 62: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/62.jpg)
What Makes XNU Great
#4Mach Message API
![Page 63: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/63.jpg)
What Makes XNU Great
#3I/O-Kit
![Page 64: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/64.jpg)
What Makes XNU Great
#2Stable KEXT ABI
![Page 65: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/65.jpg)
What Makes XNU Great
#1Universal Binaries
![Page 66: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/66.jpg)
Buzzwordsagain
![Page 67: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/67.jpg)
Mach
• The Mac OS X kernel is not “Mach”.
• The Mac OS X kernel is XNU.
• XNU consists of Mach, BSD and I/O-Kit.
![Page 68: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/68.jpg)
Microkernel
• The OS X kernel is not a microkernel.
• The Mach codebase can be used as a microkernel.
• XNU is a monolithic kernel.
• BSD and most drivers are in kernel mode.
![Page 69: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/69.jpg)
FreeBSD Kernel
• The Mac OS X kernel is not based on the FreeBSD kernel.
• XNU contains some FreeBSD code.
![Page 70: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/70.jpg)
C++
• XNU is not written in C++.
• I/O-Kit is written in Embedded C++.
• Mach and BSD are written in C.
![Page 71: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/71.jpg)
64 bit
• The Mac OS X kernel is not 64 bit.
• It supports 64 bit user land applications.
• The kernel code is 32 bit with tiny 64 bit parts for user support.
![Page 72: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/72.jpg)
Open Source
• The Mac OS X kernel and most of the UNIX bits are Open Source.
• But there is no live repository.
• Some code is missing.
• But it can be compiled into a working system.
![Page 73: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/73.jpg)
• Mac OS X is “UNIX”.
• But only since Leopard.
• It passed the POSIX Conformance Test.
• It may use the “UNIX” trademark.
• It does not contain AT&T UNIX code.
![Page 74: Inside the Mac OS X Kernel](https://reader033.vdocuments.mx/reader033/viewer/2022061212/54964452b4795966288b48d3/html5/thumbnails/74.jpg)
Awesome
• But Mac OS X is awesome.
• That’s a fact.
lucy