Volume 1 |
|
|
|
xxv | |
|
|
xxxi | |
|
|
xxxiii | |
|
Chapter 1 Origins of Mac OS X |
|
|
1 | (42) |
|
1.1 Apple's Quest for the Operating System |
|
|
2 | (7) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
7 | (2) |
|
|
9 | (1) |
|
|
9 | (6) |
|
|
10 | (3) |
|
|
13 | (2) |
|
|
15 | (9) |
|
1.3.1 Rochester's Intelligent Gateway |
|
|
16 | (1) |
|
|
17 | (1) |
|
|
18 | (5) |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
24 | (7) |
|
|
25 | (2) |
|
|
27 | (4) |
|
|
31 | (12) |
|
1.5.1 Mac OS X Server 1.x |
|
|
31 | (1) |
|
1.5.2 Mac OS X Developer Previews |
|
|
31 | (3) |
|
1.5.3 Mac OS X Public Beta |
|
|
34 | (2) |
|
|
36 | (7) |
|
Chapter 2 An Overview of Mac OS X |
|
|
43 | (112) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
46 | (2) |
|
|
47 | (1) |
|
2.3.2 The Benefits of Darwin |
|
|
47 | (1) |
|
2.3.3 Darwin and Mac OS X |
|
|
48 | (1) |
|
|
48 | (9) |
|
|
49 | (1) |
|
|
50 | (3) |
|
|
53 | (1) |
|
2.4.4 The libkern Library |
|
|
54 | (1) |
|
|
55 | (1) |
|
2.4.6 The Platform Expert |
|
|
56 | (1) |
|
|
57 | (1) |
|
2.5 A User-Space View of the File System |
|
|
57 | (4) |
|
2.5.1 File System Domains |
|
|
57 | (2) |
|
2.5.2 The /system/Library/ Directory |
|
|
59 | (2) |
|
2.6 The Runtime Architecture |
|
|
61 | (13) |
|
|
62 | (4) |
|
|
66 | (1) |
|
|
67 | (7) |
|
|
74 | (2) |
|
2.8 Bundles and Frameworks |
|
|
76 | (13) |
|
|
76 | (5) |
|
2.8.2 Property List Files |
|
|
81 | (1) |
|
|
82 | (4) |
|
|
86 | (3) |
|
|
89 | (1) |
|
2.10 Application Services |
|
|
90 | (11) |
|
2.10.1 Graphics and Multimedia Services |
|
|
91 | (10) |
|
2.10.2 Other Application Services |
|
|
101 | (1) |
|
2.11 Application Environments |
|
|
101 | (16) |
|
|
102 | (1) |
|
2.11.2 The X Window System |
|
|
103 | (1) |
|
|
103 | (4) |
|
|
107 | (6) |
|
|
113 | (1) |
|
|
113 | (1) |
|
|
114 | (1) |
|
|
114 | (2) |
|
|
116 | (1) |
|
|
117 | (4) |
|
|
118 | (1) |
|
2.12.2 Resolution-Independent User Interface |
|
|
118 | (1) |
|
2.12.3 Productivity Features |
|
|
119 | (1) |
|
2.12.4 Universal Access Support |
|
|
120 | (1) |
|
|
121 | (10) |
|
|
122 | (2) |
|
2.13.2 Compilers and Libraries |
|
|
124 | (1) |
|
|
125 | (4) |
|
|
129 | (2) |
|
|
131 | (14) |
|
2.14.1 Kernel-Space Security |
|
|
133 | (1) |
|
2.14.2 User-Space Security |
|
|
134 | (5) |
|
2.14.3 System Administration |
|
|
139 | (4) |
|
2.14.4 The Auditing System |
|
|
143 | (2) |
|
|
145 | (8) |
|
|
146 | (4) |
|
|
150 | (3) |
|
|
153 | (2) |
|
Chapter 3 Inside an Apple |
|
|
155 | (108) |
|
|
156 | (10) |
|
3.1.1 The U3H System Controller |
|
|
157 | (2) |
|
3.1.2 The K2 I/O Device Controller |
|
|
159 | (1) |
|
3.1.3 PCI-X and PCI Express |
|
|
159 | (3) |
|
|
162 | (2) |
|
3.1.5 Elastic I/O Interconnect |
|
|
164 | (2) |
|
3.2 The G5: Lineage and Roadmap |
|
|
166 | (8) |
|
3.2.1 Fundamental Aspects of the G5 |
|
|
167 | (2) |
|
3.2.2 New POWER Generations |
|
|
169 | (2) |
|
3.2.3 The PowerPC 970, 970FX, and 970MP |
|
|
171 | (2) |
|
|
173 | (1) |
|
|
174 | (50) |
|
|
174 | (1) |
|
|
175 | (6) |
|
3.3.3 Memory Management Unit (MMU) |
|
|
181 | (4) |
|
3.3.4 Miscellaneous Internal Buffers and Queues |
|
|
185 | (1) |
|
|
186 | (2) |
|
|
188 | (6) |
|
|
194 | (3) |
|
|
197 | (5) |
|
|
202 | (10) |
|
|
212 | (7) |
|
|
219 | (3) |
|
3.3.12 64-bit Architecture |
|
|
222 | (2) |
|
3.3.13 Softpatch Facility |
|
|
224 | (1) |
|
|
224 | (16) |
|
|
225 | (1) |
|
|
226 | (4) |
|
|
230 | (8) |
|
3.4.4 Function Parameters and Return Values |
|
|
238 | (2) |
|
|
240 | (23) |
|
3.5.1 A Recursive Factorial Function |
|
|
241 | (3) |
|
3.5.2 An Atomic Compare-and-Store Function |
|
|
244 | (2) |
|
|
246 | (10) |
|
3.5.4 Cycle-Accurate Simulation of the 970FX |
|
|
256 | (7) |
|
Chapter 4 The Firmware and the Bootloader |
|
|
263 | (118) |
|
|
263 | (3) |
|
4.1.1 Varieties of Firmware |
|
|
264 | (1) |
|
4.1.2 Preferential Storage |
|
|
265 | (1) |
|
|
266 | (5) |
|
|
268 | (1) |
|
4.2.2 Modern Boot ROM (PowerPC) |
|
|
269 | (2) |
|
|
271 | (1) |
|
|
272 | (7) |
|
4.4.1 Interacting with Open Firmware |
|
|
274 | (4) |
|
4.4.2 Open Firmware Emulators |
|
|
278 | (1) |
|
|
279 | (10) |
|
|
279 | (1) |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
282 | (6) |
|
|
288 | (1) |
|
|
289 | (9) |
|
|
292 | (4) |
|
|
296 | (1) |
|
|
297 | (1) |
|
4.7 Open Firmware Interfaces |
|
|
298 | (2) |
|
|
299 | (1) |
|
4.7.2 The Client Interface |
|
|
299 | (1) |
|
4.7.3 The Device Interface |
|
|
300 | (1) |
|
|
300 | (24) |
|
4.8.1 Dumping NVRAM Contents |
|
|
300 | (1) |
|
4.8.2 Determining Screen Dimensions |
|
|
301 | (1) |
|
4.8.3 Working with Colors |
|
|
302 | (1) |
|
4.8.4 Drawing a Color-Filled Rectangle |
|
|
303 | (1) |
|
4.8.5 Creating an Animated Solution to the "Towers of Hanoi" Problem |
|
|
303 | (11) |
|
4.8.6 Fabricating and Using a Mouse Pointer |
|
|
314 | (3) |
|
|
317 | (3) |
|
4.8.8 Implementing a Clock |
|
|
320 | (2) |
|
|
322 | (1) |
|
|
323 | (1) |
|
4.9 Firmware Boot Sequence |
|
|
324 | (4) |
|
|
326 | (1) |
|
|
327 | (1) |
|
|
328 | (12) |
|
|
328 | (2) |
|
|
330 | (1) |
|
|
331 | (9) |
|
4.11 Alternate Booting Scenarios |
|
|
340 | (9) |
|
4.11.1 Booting an Alternate Kernel |
|
|
341 | (3) |
|
4.11.2 Booting from a Software RAID Device |
|
|
344 | (2) |
|
4.11.3 Booting over a Network |
|
|
346 | (3) |
|
|
349 | (3) |
|
4.12.1 Managing Firmware Security |
|
|
349 | (3) |
|
4.12.2 Recovering the Open Firmware Password |
|
|
352 | (1) |
|
4.13 Launching the Kernel |
|
|
352 | (1) |
|
4.14 The BootCache Optimization |
|
|
353 | (2) |
|
4.15 Boot-Time Kernel Arguments |
|
|
355 | (7) |
|
4.16 The Extensible Firmware Interface |
|
|
362 | (19) |
|
|
362 | (3) |
|
|
365 | (1) |
|
|
366 | (3) |
|
|
369 | (9) |
|
4.16.5 The Benefits of EFI |
|
|
378 | (3) |
|
Chapter 5 Kernel and User-Level Startup |
|
|
381 | (120) |
|
5.1 Arranging for the Kernel to Execute |
|
|
382 | (6) |
|
5.1.1 Exceptions and Exception Vectors |
|
|
383 | (2) |
|
|
385 | (2) |
|
|
387 | (1) |
|
5.2 Low-Level Processor Initialization |
|
|
388 | (17) |
|
|
390 | (2) |
|
|
392 | (3) |
|
|
395 | (3) |
|
|
398 | (2) |
|
5.2.5 Processor-Specific Initialization |
|
|
400 | (1) |
|
5.2.6 Other Early Initialization |
|
|
401 | (4) |
|
5.3 High-Level Processor Initialization |
|
|
405 | (16) |
|
5.3.1 Before Virtual Memory |
|
|
407 | (2) |
|
5.3.2 Low-Level Virtual Memory Initialization |
|
|
409 | (6) |
|
5.3.3 After Virtual Memory |
|
|
415 | (6) |
|
5.4 Mach Subsystem Initialization |
|
|
421 | (11) |
|
5.4.1 Scheduler Initialization |
|
|
421 | (2) |
|
5.4.2 High-Level Virtual Memory Subsystem Initialization |
|
|
423 | (6) |
|
|
429 | (1) |
|
5.4.4 Finishing VM and IPC Initialization |
|
|
430 | (1) |
|
5.4.5 Initializing Miscellaneous Subsystems |
|
|
430 | (1) |
|
|
431 | (1) |
|
5.4.7 Launching the Kernel Bootstrap Thread |
|
|
431 | (1) |
|
|
432 | (3) |
|
5.6 I/O Kit Initialization |
|
|
435 | (8) |
|
|
443 | (26) |
|
5.7.1 Miscellaneous BSD Initialization (Part 1) |
|
|
445 | (2) |
|
5.7.2 File System Initialization |
|
|
447 | (1) |
|
5.7.3 Miscellaneous BSD Initialization (Part 2) |
|
|
448 | (2) |
|
5.7.4 Networking Subsystem Initialization |
|
|
450 | (3) |
|
5.7.5 Miscellaneous BSD Initialization (Part 3) |
|
|
453 | (2) |
|
5.7.6 Mounting the Root File System |
|
|
455 | (9) |
|
|
464 | (2) |
|
5.7.8 Shared Memory Regions |
|
|
466 | (3) |
|
5.8 Launching the First User-Space Program |
|
|
469 | (1) |
|
|
470 | (2) |
|
|
472 | (29) |
|
|
472 | (13) |
|
|
485 | (10) |
|
5.10.3 Single-User Startup |
|
|
495 | (1) |
|
5.10.4 Installation Startup |
|
|
496 | (5) |
|
|
501 | (182) |
|
|
501 | (9) |
|
|
510 | (9) |
|
6.2.1 Kernel Fundamentals |
|
|
511 | (7) |
|
|
518 | (1) |
|
6.3 A Flavor of the Mach APIs |
|
|
519 | (10) |
|
6.3.1 Displaying Host Information |
|
|
519 | (3) |
|
6.3.2 Accessing the Kernel's Clock Services |
|
|
522 | (2) |
|
6.3.3 Using a Clock Service to Ring an Alarm |
|
|
524 | (2) |
|
6.3.4 Displaying Host Statistics |
|
|
526 | (3) |
|
|
529 | (14) |
|
6.4.1 Types of Control Transfer |
|
|
531 | (2) |
|
6.4.2 Implementing System Entry Mechanisms |
|
|
533 | (10) |
|
|
543 | (10) |
|
6.5.1 Hardware Interrupts |
|
|
549 | (2) |
|
6.5.2 Miscellaneous Traps |
|
|
551 | (2) |
|
|
553 | (1) |
|
6.6 System Call Processing |
|
|
553 | (4) |
|
6.7 System Call Categories |
|
|
557 | (44) |
|
|
557 | (19) |
|
|
576 | (8) |
|
|
584 | (1) |
|
6.7.4 PowerPC-Only System Calls |
|
|
584 | (3) |
|
|
587 | (7) |
|
|
594 | (7) |
|
6.8 Kernel Support for Debugging, Diagnostics, and Tracing |
|
|
601 | (58) |
|
6.8.1 GDB (Network-Based or FireWire-Based Debugging) |
|
|
601 | (2) |
|
6.8.2 KDB (Serial-Line-Based Debugging) |
|
|
603 | (1) |
|
|
604 | (8) |
|
6.8.4 Kernel Profiling (kgmon and gprof) |
|
|
612 | (5) |
|
6.8.5 Per-Process Kernel Tracing (ktrace (2) and kdump) |
|
|
617 | (2) |
|
|
619 | (6) |
|
6.8.7 Fine-Grained Kernel Event Tracing (kdebug) |
|
|
625 | (13) |
|
6.8.8 Low-Level Diagnostics and Debugging Interfaces |
|
|
638 | (11) |
|
6.8.9 Low-Level Kernel Tracing |
|
|
649 | (10) |
|
6.9 Virtual Machine Monitor |
|
|
659 | (17) |
|
|
660 | (1) |
|
6.9.2 Using the VMM Facility |
|
|
661 | (1) |
|
6.9.3 Example: Running Code in a Virtual Machine |
|
|
662 | (14) |
|
6.10 Compiling the Kernel |
|
|
676 | (7) |
|
6.10.1 Retrieving Prerequisite Packages |
|
|
677 | (1) |
|
6.10.2 Compiling Prerequisite Packages |
|
|
677 | (3) |
|
6.10.3 Compiling the xnu Package |
|
|
680 | (1) |
|
|
681 | (2) |
|
|
683 | (152) |
|
7.1 Processes: From Early UNIX to Mac OS X |
|
|
684 | (3) |
|
7.1.1 Mac OS X Process Limits |
|
|
685 | (1) |
|
7.1.2 Mac OS X Execution Flavors |
|
|
686 | (1) |
|
7.2 Mach Abstractions, Data Structures, and APIs |
|
|
687 | (39) |
|
7.2.1 Summary of Relationships |
|
|
687 | (2) |
|
|
689 | (3) |
|
|
692 | (10) |
|
7.2.4 Tasks and the Task API |
|
|
702 | (3) |
|
|
705 | (7) |
|
7.2.6 Thread-Related Abstractions |
|
|
712 | (14) |
|
7.3 Many Threads of a New System |
|
|
726 | (48) |
|
7.3.1 Mach Tasks and Threads |
|
|
727 | (19) |
|
|
746 | (13) |
|
7.3.3 POSIX Threads (Pthreads) |
|
|
759 | (3) |
|
|
762 | (1) |
|
7.3.5 The NSTask Cocoa Class |
|
|
763 | (1) |
|
7.3.6 The NSThread Cocoa Class |
|
|
764 | (3) |
|
7.3.7 The Carbon Process Manager |
|
|
767 | (2) |
|
7.3.8 Carbon Multiprocessing Services |
|
|
769 | (3) |
|
7.3.9 The Carbon Thread Manager |
|
|
772 | (2) |
|
|
774 | (38) |
|
7.4.1 Scheduling Infrastructure Initialization |
|
|
775 | (14) |
|
7.4.2 Scheduler Operation |
|
|
789 | (13) |
|
7.4.3 Scheduling Policies |
|
|
802 | (10) |
|
7.5 The execve ( ) System Call |
|
|
812 | (16) |
|
|
815 | (10) |
|
7.5.2 Fat (Universal) Binaries |
|
|
825 | (1) |
|
7.5.3 Interpreter Scripts |
|
|
825 | (3) |
|
7.6 Launching Applications |
|
|
828 | (7) |
|
7.6.1 Mapping Entities to Handlers |
|
|
828 | (2) |
|
7.6.2 Uniform Type Identifiers |
|
|
830 | (5) |
Volume 2 |
|
|
|
835 | (186) |
|
|
835 | (3) |
|
8.1.1 Virtual Memory and UNIX |
|
|
836 | (1) |
|
8.1.2 Virtual Memory and Personal Computing |
|
|
836 | (1) |
|
8.1.3 Roots of the Mac OS X Virtual Memory Subsystem |
|
|
837 | (1) |
|
8.2 An Overview of Mac OS X Memory Management |
|
|
838 | (8) |
|
8.2.1 Reading Kernel Memory from User Space |
|
|
841 | (4) |
|
8.2.2 Querying Physical Memory Size |
|
|
845 | (1) |
|
|
846 | (22) |
|
|
847 | (2) |
|
8.3.2 Task Address Spaces |
|
|
849 | (1) |
|
|
849 | (2) |
|
|
851 | (1) |
|
|
851 | (2) |
|
|
853 | (9) |
|
|
862 | (3) |
|
8.3.8 The Physical Map (Pmap) |
|
|
865 | (3) |
|
|
868 | (9) |
|
8.4.1 The vm_page Structure |
|
|
868 | (1) |
|
8.4.2 Searching for Resident Pages |
|
|
869 | (1) |
|
8.4.3 Resident Page Queues |
|
|
870 | (1) |
|
|
871 | (1) |
|
8.4.5 Physical Memory Bookkeeping |
|
|
872 | (4) |
|
|
876 | (1) |
|
8.5 Virtual Memory Initialization during Bootstrap |
|
|
877 | (1) |
|
8.6 The Mach VM User-Space Interface |
|
|
878 | (15) |
|
|
881 | (3) |
|
|
884 | (1) |
|
8.6.3 mach_vm_allocate ( ) |
|
|
885 | (1) |
|
8.6.4 mach_vm_deallocate () |
|
|
885 | (1) |
|
|
886 | (1) |
|
8.6.6 mach_vm_inherit ( ) |
|
|
886 | (1) |
|
|
887 | (1) |
|
|
888 | (1) |
|
|
888 | (1) |
|
|
889 | (1) |
|
8.6.11 mach_vm_behavior_set () |
|
|
889 | (2) |
|
|
891 | (1) |
|
|
892 | (1) |
|
8.7 Using the Mach VM Interfaces |
|
|
893 | (14) |
|
8.7.1 Controlling Memory Inheritance |
|
|
893 | (3) |
|
8.7.2 Debugging the Mach VM Subsystem |
|
|
896 | (1) |
|
|
897 | (2) |
|
8.7.4 Accessing Another Task's Memory |
|
|
899 | (2) |
|
8.7.5 Naming and Sharing Memory |
|
|
901 | (6) |
|
8.8 Kernel and User Address Space Layouts |
|
|
907 | (5) |
|
8.9 Universal Page Lists (UPLs) |
|
|
912 | (1) |
|
8.10 Unified Buffer Cache (UBC) |
|
|
913 | (5) |
|
|
914 | (2) |
|
8.10.2 The NFS Buffer Cache |
|
|
916 | (2) |
|
8.11 The Dynamic Pager Program |
|
|
918 | (3) |
|
|
921 | (1) |
|
8.13 System Shared Memory |
|
|
922 | (20) |
|
8.13.1 Applications of Shared Memory |
|
|
922 | (5) |
|
8.13.2 Implementation of the Shared Memory Server Subsystem |
|
|
927 | (5) |
|
8.13.3 The Loading of Shared Object Files by the Dynamic Linker |
|
|
932 | (4) |
|
8.13.4 The Use of shared_region_map_file_np ( ) by a System Application |
|
|
936 | (5) |
|
8.13.5 A Note on Prebinding |
|
|
941 | (1) |
|
8.14 Task Working Set Detection and Maintenance |
|
|
942 | (6) |
|
|
943 | (1) |
|
8.14.2 TWS Implementation |
|
|
944 | (4) |
|
8.15 Memory Allocation in User Space |
|
|
948 | (32) |
|
8.15.1 A Historical Break |
|
|
949 | (2) |
|
8.15.2 Memory Allocator Internals |
|
|
951 | (15) |
|
8.15.3 The malloc( ) Routine |
|
|
966 | (2) |
|
8.15.4 The Largest Single Allocation (32-bit) |
|
|
968 | (2) |
|
8.15.5 The Largest Single Allocation (64-bit) |
|
|
970 | (1) |
|
8.15.6 Enumerating All Pointers |
|
|
971 | (3) |
|
8.15.7 Displaying Scalable Zone Statistics |
|
|
974 | (2) |
|
8.15.8 Logging Malloc Operations |
|
|
976 | (3) |
|
8.15.9 Intercepting the Malloc Layer |
|
|
979 | (1) |
|
8.16 Memory Allocation in the Kernel |
|
|
980 | (21) |
|
8.16.1 Page-Level Allocation |
|
|
980 | (3) |
|
|
983 | (2) |
|
8.16.3 The Mach Zone Allocator |
|
|
985 | (7) |
|
|
992 | (1) |
|
8.16.5 The OSMalloc Family |
|
|
993 | (2) |
|
8.16.6 Memory Allocation in the I/O Kit |
|
|
995 | (2) |
|
8.16.7 Memory Allocation in the Kernel's BSD Portion |
|
|
997 | (3) |
|
8.16.8 Memory Allocation in libkern's C++ Environment |
|
|
1000 | (1) |
|
|
1001 | (4) |
|
|
1005 | (16) |
|
8.18.1 Reasons for 64-bit Computing |
|
|
1010 | (4) |
|
8.18.2 Mac OS X 10.4: 64-bit User Address Spaces |
|
|
1014 | (5) |
|
8.18.3 Why Not to Use 64-bit Executables |
|
|
1019 | (1) |
|
8.18.4 The 64-bit "Scene" |
|
|
1019 | (2) |
|
Chapter 9 Interprocess Communication |
|
|
1021 | (212) |
|
|
1021 | (4) |
|
9.1.1 The Evolution of IPC |
|
|
1023 | (1) |
|
|
1024 | (1) |
|
9.2 Mach IPC: An Overview |
|
|
1025 | (16) |
|
|
1027 | (4) |
|
|
1031 | (10) |
|
9.3 Mach IPC: The Mac OS X Implementation |
|
|
1041 | (19) |
|
|
1041 | (3) |
|
9.3.2 The Anatomy of a Mach Port |
|
|
1044 | (4) |
|
|
1048 | (3) |
|
|
1051 | (1) |
|
|
1052 | (5) |
|
9.3.6 Messaging Implementation |
|
|
1057 | (3) |
|
9.3.7 IPC Subsystem Initialization |
|
|
1060 | (1) |
|
9.4 Name and Bootstrap Servers |
|
|
1060 | (20) |
|
9.4.1 The Network Message Server |
|
|
1063 | (1) |
|
9.4.2 The Bootstrap Server |
|
|
1064 | (4) |
|
9.4.3 The Bootstrap Server API |
|
|
1068 | (12) |
|
|
1080 | (14) |
|
9.5.1 A Simple Client-Server Example |
|
|
1080 | (4) |
|
|
1084 | (1) |
|
|
1085 | (2) |
|
|
1087 | (3) |
|
9.5.5 Transferring Out-of-Line Memory and Port Rights |
|
|
1090 | (4) |
|
|
1094 | (18) |
|
9.6.1 MIG Specification Files |
|
|
1095 | (5) |
|
9.6.2 Using MIG to Create a Client-Server System |
|
|
1100 | (8) |
|
|
1108 | (4) |
|
|
1112 | (17) |
|
9.7.1 Programmer-Visible Aspects of Mach's Exception-Handling Facility |
|
|
1115 | (3) |
|
9.7.2 The Mach Exception-Handling Chain |
|
|
1118 | (5) |
|
9.7.3 Example: A Mach Exception Handler |
|
|
1123 | (6) |
|
|
1129 | (16) |
|
|
1131 | (1) |
|
9.8.2 The Number of Signals |
|
|
1131 | (1) |
|
9.8.3 Application-Defined Signals |
|
|
1132 | (1) |
|
9.8.4 Signal-Based Notification of Asynchronous I/O |
|
|
1132 | (3) |
|
9.8.5 Signals and Multithreading |
|
|
1135 | (1) |
|
|
1135 | (3) |
|
9.8.7 Signal Generation and Delivery |
|
|
1138 | (3) |
|
9.8.8 Mach Exceptions and Unix Signals Living Together |
|
|
1141 | (3) |
|
9.8.9 Exceptions, Signals, and Debugging |
|
|
1144 | (1) |
|
9.8.10 The ptrace () System Cali |
|
|
1144 | (1) |
|
|
1145 | (3) |
|
|
1147 | (1) |
|
9.11 File Descriptor Passing |
|
|
1148 | (7) |
|
|
1155 | (1) |
|
|
1156 | (8) |
|
|
1156 | (4) |
|
9.13.2 POSIX Shared Memory |
|
|
1160 | (4) |
|
|
1164 | (8) |
|
|
1172 | (9) |
|
9.15.1 Tiling Application Windows Using Apple Events in AppleScript |
|
|
1175 | (1) |
|
9.15.2 Building and Sending an Apple Event in a C Program |
|
|
1176 | (3) |
|
9.15.3 Causing the System to Sleep by Sending an Apple Event |
|
|
1179 | (2) |
|
|
1181 | (16) |
|
9.16.1 Foundation Notifications |
|
|
1181 | (3) |
|
9.16.2 The notify (3) API |
|
|
1184 | (7) |
|
9.16.3 Kernel Event Notification Mechanism (kqueue (2)) |
|
|
1191 | (5) |
|
9.16.4 Core Foundation Notifications |
|
|
1196 | (1) |
|
|
1196 | (1) |
|
|
1197 | (1) |
|
|
1197 | (13) |
|
|
1197 | (4) |
|
|
1201 | (9) |
|
|
1210 | (23) |
|
9.18.1 Interfaces for Atomic Operations |
|
|
1213 | (1) |
|
|
1213 | (5) |
|
9.18.3 BSD Condition Variables |
|
|
1218 | (1) |
|
|
1218 | (1) |
|
|
1219 | (3) |
|
9.18.6 Pthreads Synchronization Interfaces |
|
|
1222 | (1) |
|
9.18.7 Locking in the I/O Kit |
|
|
1223 | (1) |
|
|
1223 | (7) |
|
|
1230 | (1) |
|
9.18.10 Advisory-Mode File Locking |
|
|
1230 | (3) |
|
Chapter 10 Extending the Kernel |
|
|
1233 | (112) |
|
10.1 A Driver down the Memory Lane |
|
|
1233 | (2) |
|
10.1.1 Driver Programming Considered Difficult |
|
|
1234 | (1) |
|
|
1234 | (1) |
|
10.1.3 Everything Is a File |
|
|
1235 | (1) |
|
10.1.4 There Is More to Extending the Kernel Than Driving Devices |
|
|
1235 | (1) |
|
|
1235 | (22) |
|
|
1237 | (2) |
|
10.2.2 I/O Kit Class Hierarchy |
|
|
1239 | (1) |
|
|
1239 | (3) |
|
|
1242 | (1) |
|
|
1242 | (1) |
|
10.2.6 General I/O Kit Classes |
|
|
1243 | (3) |
|
|
1246 | (5) |
|
|
1251 | (2) |
|
|
1253 | (1) |
|
10.2.10 I/O Kit Initialization |
|
|
1253 | (2) |
|
10.2.11 Driver Matching in the I/O Kit |
|
|
1255 | (2) |
|
|
1257 | (2) |
|
10.4 Dynamically Extending the Kernel |
|
|
1259 | (10) |
|
10.4.1 The Structure of a Kernel Extension |
|
|
1259 | (1) |
|
10.4.2 Creation of Kernel Extensions |
|
|
1260 | (6) |
|
10.4.3 Management of Kernel Extensions |
|
|
1266 | (1) |
|
10.4.4 Automatic Loading of Kernel Extensions |
|
|
1267 | (2) |
|
10.5 Communicating with the Kernel |
|
|
1269 | (2) |
|
10.6 Creating Kernel Extensions |
|
|
1271 | (17) |
|
10.6.1 A Generic Kernel Extension |
|
|
1271 | (5) |
|
10.6.2 Implementing Sysctl Variables Using a Generic Kext |
|
|
1276 | (4) |
|
10.6.3 I/O Kit Device Driver Kext |
|
|
1280 | (8) |
|
10.7 A Programming Tour of the I/O Kit's Functionality |
|
|
1288 | (33) |
|
10.7.1 Rotating a Framebuffer |
|
|
1288 | (5) |
|
10.7.2 Accessing Framebuffer Memory |
|
|
1293 | (1) |
|
10.7.3 Retrieving the List of Firmware Variables |
|
|
1294 | (2) |
|
10.7.4 Retrieving Information about Loaded Kernel Extensions |
|
|
1296 | (1) |
|
10.7.5 Retrieving Accelerometer Data from the Sudden Motion Sensor |
|
|
1297 | (6) |
|
10.7.6 Listing PCI Devices |
|
|
1303 | (1) |
|
10.7.7 Retrieving the Computer's Serial Number and Model Information |
|
|
1304 | (1) |
|
10.7.8 Retrieving Temperature Sensor Readings |
|
|
1305 | (4) |
|
10.7.9 Retrieving MAC Addresses of Ethernet Interfaces |
|
|
1309 | (1) |
|
10.7.10 Implementing an Encrypted Disk Filter Scheme |
|
|
1310 | (11) |
|
|
1321 | (24) |
|
|
1322 | (2) |
|
|
1324 | (1) |
|
|
1325 | (3) |
|
10.8.4 Debugging by Using GDB |
|
|
1328 | (3) |
|
10.8.5 Debugging by Using KDB |
|
|
1331 | (7) |
|
10.8.6 Miscellaneous Debugging Tools |
|
|
1338 | (1) |
|
|
1338 | (7) |
|
|
1345 | (126) |
|
11.1 Disks and Partitions |
|
|
1345 | (8) |
|
11.1.1 The Apple Partitioning Scheme |
|
|
1349 | (3) |
|
11.1.2 PC-Style Partitioning |
|
|
1352 | (1) |
|
11.1.3 GUID-Based Partitioning |
|
|
1352 | (1) |
|
|
1353 | (9) |
|
11.2.1 Retrieving a Disk's Description |
|
|
1355 | (2) |
|
11.2.2 Participating in Disk Mounting Decisions |
|
|
1357 | (2) |
|
11.2.3 Receiving Media Notifications from the I/O Kit |
|
|
1359 | (3) |
|
11.3 The Implementation of Disk Devices |
|
|
1362 | (4) |
|
|
1366 | (8) |
|
11.4.1 Using the hdiutil Program |
|
|
1367 | (3) |
|
|
1370 | (1) |
|
11.4.3 The BSD Vnode Disk Driver |
|
|
1370 | (1) |
|
11.4.4 Creating a Virtual Disk from Scratch |
|
|
1371 | (3) |
|
11.5 Files and File Descriptors |
|
|
1374 | (2) |
|
|
1376 | (10) |
|
|
1386 | (23) |
|
|
1388 | (1) |
|
|
1388 | (2) |
|
|
1390 | (1) |
|
|
1391 | (1) |
|
|
1391 | (1) |
|
|
1391 | (2) |
|
|
1393 | (2) |
|
|
1395 | (1) |
|
|
1396 | (1) |
|
|
1397 | (1) |
|
|
1397 | (1) |
|
|
1398 | (2) |
|
|
1400 | (1) |
|
|
1401 | (1) |
|
|
1402 | (1) |
|
11.7.16 specfs and fifofs |
|
|
1403 | (1) |
|
|
1404 | (1) |
|
|
1405 | (2) |
|
|
1407 | (2) |
|
|
1409 | (32) |
|
11.8.1 Spotlight's Architecture |
|
|
1410 | (6) |
|
11.8.2 The Fsevents Mechanism |
|
|
1416 | (12) |
|
11.8.3 Importing Metadata |
|
|
1428 | (3) |
|
11.8.4 Querying Spotlight |
|
|
1431 | (8) |
|
11.8.5 Spotlight Command-Line Tools |
|
|
1439 | (1) |
|
11.8.6 Overcoming Granularity Limitations |
|
|
1440 | (1) |
|
11.9 Access Control Lists |
|
|
1441 | (4) |
|
11.10 The Kauth Authorization Subsystem |
|
|
1445 | (26) |
|
|
1446 | (4) |
|
|
1450 | (3) |
|
11.10.3 A Vnode-Level File System Activity Monitor |
|
|
1453 | (18) |
|
Chapter 12 The HFS Plus File System |
|
|
1471 | (116) |
|
|
1474 | (3) |
|
|
1474 | (2) |
|
12.1.2 Interface for Retrieving File System Attributes |
|
|
1476 | (1) |
|
12.1.3 Mac OS X Command-Line Tools |
|
|
1476 | (1) |
|
12.1.4 HFS+ Source and Technical Note TN1150 |
|
|
1477 | (1) |
|
12.2 Fundamental Concepts |
|
|
1477 | (14) |
|
|
1477 | (1) |
|
|
1477 | (3) |
|
|
1480 | (1) |
|
|
1480 | (1) |
|
|
1481 | (1) |
|
|
1481 | (10) |
|
12.3 The Structure of an HFS+ Volume |
|
|
1491 | (2) |
|
|
1493 | (1) |
|
|
1493 | (8) |
|
12.5.1 Viewing the Volume Header |
|
|
1494 | (6) |
|
12.5.2 Viewing a Volume Control Block |
|
|
1500 | (1) |
|
|
1501 | (4) |
|
|
1505 | (26) |
|
12.7.1 The Allocation File |
|
|
1505 | (5) |
|
|
1510 | (9) |
|
12.7.3 The Extents Overflow File |
|
|
1519 | (5) |
|
12.7.4 The Attributes File |
|
|
1524 | (6) |
|
|
1530 | (1) |
|
12.8 Examining HFS+ Features |
|
|
1531 | (27) |
|
|
1531 | (1) |
|
12.8.2 Filename Encodings |
|
|
1532 | (2) |
|
|
1534 | (4) |
|
|
1538 | (8) |
|
|
1546 | (1) |
|
|
1547 | (5) |
|
12.8.7 Unlinking Open Files |
|
|
1552 | (1) |
|
|
1553 | (1) |
|
|
1554 | (2) |
|
|
1556 | (2) |
|
|
1558 | (12) |
|
12.9.1 On-the-Fly Defragmentation |
|
|
1558 | (3) |
|
|
1561 | (1) |
|
12.9.3 Hot File Clustering |
|
|
1562 | (8) |
|
12.10 Miscellaneous Features |
|
|
1570 | (5) |
|
12.10.1 Special System Calls |
|
|
1570 | (1) |
|
12.10.2 Freezing and Thawing a Volume |
|
|
1571 | (1) |
|
12.10.3 Extending and Shrinking a Volume |
|
|
1572 | (1) |
|
12.10.4 Volume Notifications |
|
|
1572 | (2) |
|
12.10.5 Support for Sparse Devices |
|
|
1574 | (1) |
|
12.11 Comparing Mac OS X File Systems |
|
|
1575 | (7) |
|
12.12 Comparing HFS+ and NTFS |
|
|
1582 | (5) |
|
Appendix A Mac OS X on x86-Based Macintosh Computers |
|
|
1587 | (12) |
|
|
1587 | (2) |
|
|
1589 | (1) |
|
|
1590 | (1) |
|
|
1591 | (1) |
|
|
1592 | (2) |
|
|
1594 | (1) |
|
A.7 Miscellaneous Changes |
|
|
1594 | (5) |
|
A.7.1 No Dual-Mapped Kernel Address Space |
|
|
1594 | (1) |
|
A.7.2 Nonexecutable Stack |
|
|
1595 | (1) |
|
|
1596 | (1) |
|
|
1597 | (1) |
|
A.7.5 No /dev/mem or /dev/kmem |
|
|
1597 | (1) |
|
A.7.6 A New I/O Kit Plane |
|
|
1598 | (1) |
|
|
1599 | |