List of Figures

1-1Microsoft Windows NT 3.13
1-2Copland architecture7
1-5The timeline of NeXT's operating systems14
1-7Mac OS 826
1-8Mac OS 927
1-10Yellow Box running on Microsoft Windows XP30
1-11An approximation of the Mac OS X timeline32
1-12Mac OS X Public Beta35
2-1The high-level architecture of Mac OS X45
2-7A Universal Binary containing PowerPC and x86 Mach-O executables68
2-12Hierarchical structure of the iTunes application bundle77
2-14Standard frameworks on Mac OS X85
2-15Standard umbrella frameworks on Mac OS X86
2-19The Mac OS X graphics and multimedia architecture91
2-20The key constituents of Quartz92
2-21An overview of Quartz Extreme95
2-22An overview of Quartz Extreme with Accelerated 2D96
2-23Interfaces to OpenGL in Mac OS X97
2-24Image processing with Core Image98
2-25Core Image and Core Video in the QuickTime video-rendering pipeline98
2-27A Core Data stack112
2-34The Mac OS X security architecture133
2-40Xgrid architecture148
2-41Xsan architecture151
3-1Architecture of a dual-processor Power Mac G5 system158
3-2HyperTransport I/O link162
3-3The PowerPC 9xx family and the POWER4+173
3-4Caches and buffers in the 970FX176
3-6Address translation in the 970FX MMU183
3-8PowerPC UISA and VEA registers189
3-11PowerPC OEA registers195
3-13The core of the 970FX203
3-14The 970FX instruction pipeline205
3-15The FPU and FXU/LSU issue queues in the 970FX209
3-21Darwin 32-bit ABI runtime stack235
3-23Examples of stack usage in functions235
3-24Examples of stack usage in functions (continued from Figure 3-23)236
3-29Overview of function rerouting by instruction patching249
3-30Unconditional branch instruction on the PowerPC249
3-37simg5 output261
4-1Defining a Forth word: syntactic requirements and conventions281
4-5The Towers of Hanoi: layout and relative dimensions of on-screen objects304
4-9Actual photo of the Towers of Hanoi program in Open Firmware314
4-15A window created using Open Firmware primitives324
4-19An AppleRAID software RAID configuration345
4-20The EFI architecture368
4-21Booting an operating system through EFI371
4-23A GPT-partitioned disk375
5-1A high-level view of Mac OS X system startup388
5-2Low-level processor initialization389
5-8High-level processor initialization406
5-11Bootstrapping kernel subsystems422
5-12High-level virtual memory subsystem initialization424
5-14I/O Kit initialization436
5-17BSD initialization444
5-22Slave processor initialization471
5-25Guidelines and caveats for creating launchd-compliant daemons478
5-28A high-level depiction of launchd's operation485
5-29The sequence of operations performed by /etc/rc486
5-30The sequence of operations performed by /etc/rc (continued from Figure 5-29)487
5-31Overview of session launching by launchd488
5-33Important steps performed by the loginwindow application492
5-34The handling of user logout, system restart, and system shutdown by loginwindow494
5-35Single-user bootstrap through launchd495
6-9A high-level view of exception processing in the xnu kernel543
6-11Processing of traps, interrupts, and system calls548
6-12Details of system call processing in Mac OS X555
6-13Mapping an incoming system call number to an index in the first-level system call dispatch table557
6-15An example of system call argument munging565
6-35The Mac OS X auditing system621
6-37The composition of a debug code in the kdebug facility626
6-44The low-memory global data area651
6-54Software dependencies in the kernel build process679
7-1An overview of the Mac OS X process subsystem688
7-4A processor set containing two processors694
7-5A processor set with two processors on its active queue695
7-11Functions for creating kernel threads713
7-12The shuttle and thread data structures in Mac OS X 10.0715
7-13The shuttle and the thread within a single structure in Mac OS X 10.3715
7-25User-space processing of the fork() system call749
7-27Kernel-space processing of the fork() system call753
7-29Kernel-space processing of the vfork() system call757
7-31Pthread creation in the system library761
7-38Scheduling-related initializations during system startup776
7-46A nonexhaustive call graph of functions involved in thread execution and scheduling790
7-57The operation of the execve() system call813
7-60User stack arranged by the execve() system call823
8-1An overview of the Mac OS X memory subsystem839
8-5The Mac OS X implementation of the Mach VM architecture848
8-6Details of the Mac OS X Mach VM architecture850
8-7The Mach pager interface in Mac OS X857
8-8Symmetric copy-on-write using shadow objects863
8-9Asymmetric copy-on-write using copy objects864
8-10The structure of a resident page869
8-13Initialization of the hardware-independent part of the Mach VM subsystem879
8-22dyld's operation while loading a non-split-segment file934
8-23dyld's operation while loading a split-segment file935
8-26Structure of the LC_PREBOUND_DYLIB load command941
8-30An overview of the Mac OS X malloc implementation954
8-32Internal bookkeeping of tiny allocations (32-bit)959
8-34Internal bookkeeping of small malloc allocations (32-bit)965
8-35Processing of the malloc() function in the system library967
8-43An overview of memory allocation in the Mac OS X kernel981
8-44An overview of memory deallocation in the Mac OS X kernel982
8-48Setting up the vnode pager during the open() system call1002
8-49Setting up of the vnode pager for a newly created vnode1003
8-50Kernel processing of the mmap() system call1004
8-51An overview of a page-in operation1006
8-52Paging in from a vnode1007
8-53An overview of a page-out operation1008
8-54Paging out to a vnode1009
8-56An overview of 64-bit support in Mac OS X1017
9-2The layout of a complex Mach message1035
9-5An overview of Mach IPC implementation in Mac OS X1041
9-7A view of the internal structure of a Mach port1045
9-10The allocation of a port right1053
9-12An overview of the kernel processing for sending a Mach IPC message1059
9-13An overview of the kernel processing for receiving a Mach IPC message1061
9-14Initialization of the IPC subsystem1062
9-30Creating a MIG-based client and server system1107
9-31Invocation of Miscellaneous Server routines by a client1109
9-35Kernel functions involved in Mach exception delivery1119
9-40Implementation of the signal mechanism in the kernel1139
9-41Program-visible data structures involved in file descriptor passing1148
9-47Communication in a Distributed Objects client-server system1166
9-64Creating and adding run-loop input sources1202
9-69An overview of Mac OS X synchronization mechanisms1211
9-76Interfaces for advisory-mode file locking1231
10-1An overview of the I/O Kit1238
10-2The I/O Kit class hierarchy1240
10-12Kext management1268
10-14The kernel's sysctl hierarchy1277
10-21The sequence of I/O Kit driver methods called in a driver's lifecycle1287
10-22Processing involved in user-program-induced framebuffer rotation1289
10-27Relevant contents of the IOExternalMethod structure corresponding to getOrientationUC()1300
10-39Dissection of a kernel panic dump1323
10-40Logging in Mac OS X1326
10-42Objects that implement target-side KDP1329
10-43A KDB setup1332
11-3A disk partitioned using the Apple partitioning scheme1351
11-4An overview of disk arbitration1354
11-8An I/O Kit stack depicting a disk device and its partitions1363
11-10A typical read request's journey to a disk device1365
11-11How a file descriptor leads to a file in Mac OS X1375
11-12An overview of the vnode/vfs layer's role in the operating system1377
11-13A mounted file system and its vnodes1379
11-14Configuration information for file system types supported by the kernel1380
11-18Mac OS X file system APIs1387
11-19Structure of a symbolic link on the MS-DOS file system on Mac OS X1390
11-20Implementation of the WebDAV file system1399
11-21Architecture of the Spotlight system1412
11-23An overview of the fsevents mechanism's implementation1419
11-24Event generation in the fsevents mechanism1421
11-30An overview of the kauth mechanism1447
11-31Kauth scopes and actions1448
11-32An overview of the scope and listener data structures in the kauth mechanism1450
11-33Authorization in the vnode scope1452
11-34The design of a simple vnode-level file system activity monitor1454
12-1A disk containing two HFS+ volumes1478
12-2The structure of an HFS+ B-Tree node1485
12-3The structure of an HFS+ B-Tree header node1486
12-4The structure of an HFS+ B-Tree record1487
12-5The contents of a hypothetical HFS+ B-Tree1489
12-6The structure of an HFS+ volume1492
12-9An HFS wrapper volume containing an embedded HFS+ volume1503
12-13Searching in the Catalog B-Tree1513
12-14An overview of accessing a file's contents1514
12-17Searching in the Extents Overflow B-Tree1521
12-19Searching in the Attributes B-Tree1525
12-21Unicode filenames in Mac OS X1533
12-22Algorithm for determining ownership rights to a file system object1537
12-23Processing of the F_FULLFSYNC file control operation1540
12-24The VFS-layer journaling interface in Mac OS X1541
12-25An overview of the file-system-independent journal used by HFS+1543
12-30Layout of the HFS+ metadata zone1562
12-31Transitions between Hot File Clustering stages1564
12-32Searching in the Hot Files B-Tree1566