<<

Singh.book Page 1599 Thursday, May 25, 2006 11:46 AM

Index

['], 321 ACPI (Advanced Configuration and Power Inter- \ character, 282, 463 face), 1598 : character, 463, 1388, 1533 ACPI plane, 1598 #! character, 826 Activation/shuttle, 714–716 * character, 349, 459 Active data, 1036 / character, 1156, 1533 Active matching, 1256, 1280 ^ character, 274–275 Active queue, 871 _ character, 237n, 545 Actual parameters, 231 AD (address and data or control information), 165 Address Book, and , 1440–1441 A Address translation, 181–183, 404–406 Adler checksum, 335 ABI (application binary interface), 224–225, Advanced Micro Devices (AMD), 162 231–232 Advisory-mode file locking, 1230–1232 Absolute- and clock-time intervals, 782–784 ADVLOCK, 1581 Absolute branching, 201 AES encryption, 920 Abstract Windowing Toolkit, 102n Affinities, 151–152 Accelerate framework, 213 AFP (), 60, 1393–1395 Accelerate.framework, 125 Agent (), 472, 491 Accelerometer data, 1297–1303 Aggregation, Ethernet ports, 455 Accent, 17–18, 837–838 AGP (Accelerated Graphics Port), 157 Sapphire, 18 AIFF files, 1398 Access control entries (ACE), 1441–1445 AIM (Apple-IBM-), 160n Access control lists (ACL), 40, 51, 134, 1441–1445, aio_init(), 449 1529 Alarm, 524–526 and UFS2, 1392 Aleph, 16 Access Matrix model, 1441–1442 Aliases, 1554–1556 Accessibility issues. See support ALLOCATE, 1581 accton command, 134 Allocation block consumption, 1508 acid, 131 Allocation blocks, 1477 acl_set_file(), 1444 Allocation file, 1505 acpi, 1598 Allocation strategies (), 152

1599 Singh.book Page 1600 Thursday, May 25, 2006 11:46 AM

1600 Index

Allocation zone, 1561–1562 POSIX, 759, 1407, 1442 AltiVec, 212, 402 processor, 693–696 -faltivec, 214–215 processor set, 690–691 instructions, 218–219 Pthreads, 759–760, 802 970FX AltiVec implementation, 215–218 Services, 1293 prefetching, 187 QuickTime, 114 vector computing, 213–215 security, 135, 1442 Amazon architecture, 168 Spotlight, 120, 1431–1432 amber, 131, 256–261 Uniform Type Identifiers (UTI), 830–833 Amelio, Gil, 6 universal page lists (UPLs), 912 Analysis tools, 1474–1477 , 1555–1556 AND masks, mouse pointer demo, 317 WebObjects, 113 Animation, Forth code, 306–312 , 103 Annotated output, 241 .app, 78 AOL Instant Messaging (AIM), 38 AppKit.framework, 107–108 Apache web , 31 Apple Cluster (ACFS), 1387 , 116, 726 Apple Disk Image Controller (hdix), 463 and ABIs, 224–225 Apple EFI Runtime kernel , 1589–1590 and aliases, 1554–1556 Apple Events (AE), 101, 1172–1181 Authorization Services, 135–138 , 34 BIOS, 364 Apple Filing Protocol (AFP), 60, 1393–1395 Bootstrap Server, 1068–1079 Apple Sensor. See Sudden Motion Sensor BSD, 102–103, 502–504 (SMS) Library, 74–75 Apple partitioning scheme, 1348–1352 Carbon, 27, 31–33, 103–107, 1555 Apple Public Source License (APSL), 47 Carbon , 1407, 1430, 1516 Apple RAID header, 344–346 Carbon Multiprocessing Services, 769–771 Cocoa, 107–113, 953, 1555 and Security Agent, 136n comm area, 597 Apple Search Kit, 1412 Common Security Services Manager (CSSM), 135 Apple Session Protocol (ASP), 1394 notification, 1197 Apple System Logger (ASL), 1077, 1325 , 89–90 Apple Type Services (ATS), 101 diagnostics, 358 appleCLUT8, 437 Disk Arbitration subsytem, 1353–1355 AppleDouble format, 1557 dyld (dynamic link editor), 933 AppleFileServer.app, 60 file system, 1387 AppleRAID, 344, 345, 1362 graphics and multimedia, 91–101 AppleScript, 106, 115, 125–126, 1173–1175 Java, 113–114 AppleShare, 1393 launch, 476, 1072 AppleTalk, 27 Mac OS X file system, 1387 AppleWorks, 37 , 519–529, 948 Application , 76–78 Mach task, 702–705, 727 and , 1175 Mach , 707–710, 727 Classic Startup.app, 114 Mach VM, 880–893, 948 and UTIs, 832 MDQuery, 1431–1434 See also Bundles memory, 949, 952, 966 Application environments, 101–117 notify(3), 1184, 1191 BSD, 102–103 plug-in, 81 Carbon, 103–107 Singh.book Page 1601 Thursday, May 25, 2006 11:46 AM

Index 1601

Classic, 114–116 Asynchronous system trap (AST), 465, 532 Cocoa, 107–113 ATAPI (ATA Packet Interface), 298 Java, 113–114 Atlas supervisor, 835–836 QuickTime, 114 Atomic compare-and-store function, 244–246 , 116–117 Atomic operations, 1212–1213 WebObjects, 113 attach(), 442, 1281 X Window System, 103 Attributes file, B-Tree, 1524–1530 Application scaling mode, 118 ATTRLIST, 1581 Application Services, 106 Audio, 100 , 100 audit, 143 and , 96–99 Audit control port, 620–621 OpenGL, 96 Audit daemon, 620 Quartz, 91–95 Audit logging, 449, 620–623 QuickDraw 2D, 95–96 Audit macros, 623–624 QuickTime, 99–100 Audit token, 1038 subframeworks, 101 Audit trail, 143 Application-defined signals, 1132 auditd, 143, 449, 620 , 33–34, 37, 45, 117 Audit-event-to-event-class mapping, 449 Arbitration, 164n Auditing support, 619–625 Architecture Auditing system, 134 Core Image, 97 audit control file, 144–145 EFI, 368 components, 143 graphics, 91 audit_init(), 449, 619 Mach VM, 850 audit_worker(), 711 Power Mac G5, 158, 164 AULab.app, 100 PowerPC 970FX, 188, 222–224 Authorization services, 135–138 QuickTime, 99 Automator, 40, 126 runtime, 61–74 Automator action, 78 security, 133–135 Spotlight, 1410–1415 system, 164 B x86-based Mac computers, 1587–1588 , 147–149 background-, 302 Xsan, 151 Backing storage, 853n Argument munging Backing store, 837, 853 BSD system calls, 563–566 Backslash character, 282, 463 Argument types Backtrace print mechanism, 419 Fsevents, 1418 Backup port, 1069 Argument (use of term), 231 Balance strategy (Xsan), 152 as (GNU-based assembler), 62 Balanced coding method (BCM), 165 ASCII PPM (portable pixmap), 322 Base set, Forth words, 282 ASSERT(), 579 bash , 125 assert(), 579 Basic Security Module (BSM), 134, 449 Associativity, 179 BAT registers, 183–185, 405 Asterisk character, 349, 459 bclean_buf_thread(), 712 Asymmetric copy-on-write, 864 BeFS, 8 Asynchronous I/O Behavior values (Mach VM), 889–890 signals, 1132 BeOS, 7–9 subsystem, 449 Berkeley FFS (Fast File System), 462, 1391 Singh.book Page 1602 Thursday, May 25, 2006 11:46 AM

1602 Index

Berkeley Packet Filter (BPF), 454 BootCacheOverride, 358 Berners-Lee, Timothy John, 12 BootCLUT, 435–437 BezelUI directory, 60 boot-device, 326 BFS compared with Spotlight, 1415 boot.efi, 46, 60, 371, 1499, 1589 Bidirectional pipes, 1146 bootinfo file, 270, 329 Big real mode, 363 bootinfo format, 328–329 Big-endian, 225–226 , 263, 419–422 BigTop.app, 130 an alternate kernel, 341–343 Binary format, 378 over a network, 346–349 Binding styles, 71 from a software RAID, 344–346 Bindings Controller, 112 Bootloader, 46, 60 BIOS (basic input/output system), 264 bootinfo file, 270, 329 limitations, 362–364 choosing an alternate, 1589 BIOS Data Area (BDA), 367 See also boot.efi; BootX BLAS, 125 BOOTP, 463 bless, 1589 bootp(), 463 bless(8), 270–271 Boot-screen information, 643–644 Block address translation (BAT), 183–185, 405 Bootstrap context, 1065–1066 Block device, 1349 Bootstrap Server, 1065–1079 Block transfer (BLT), 377n bootstrap_check_in(), 1069 BlockAllocate(), 1572 bootstrap_create_server(), 1068 BlockDeallocate(), 1572 bootstrap_info(), 1072–1074 Blocking thread, 718–720 bootstrap_parent(), 1071 Blue Box, 28, 29, 33, 538, 591–594 bootstrap_status(), 1070 system calls, 554 bootstrap_subset(), 1071 trap value, 594 Boot-time daemons, other than , 498 Blue project, 2 Boot-time kernel arguments, 355–361 Blue thread, 591 Boot-time snag keys, 327–328 Bluetooth, 38, 60 boot-uuid, 334 BMP (Windows Bitmap), 93 BootX, 46, 60 , 39n and AppleRaid, 344 Boot behavior, 355–356 BootCLUT, 435–437 Boot , 329 bootinfo, 328–330 Boot devices, 326, 367 cache data, 338 Boot Integrity Services (BIS), 363–364 and Client IP, 348–349 Boot , 370–371 ELF support, 330 Boot modes, 339–340 kernel launch, 388 Boot ROM, 46, 268 logical memory map, 333 PowerPC, 269–271 operation, 331–340 Boot sequence, 324–328 signature, 338 Boot Server Discovery Protocol, 347 structure, 330 Boot services, EFI, 366–367 third-party bootloader, 328n Bootable (blessed) volume, 1589 and volume header, 1499 BootCache history list, 353–354 Branch history tables, 211–212 BootCache optimization, 353–354 Branch instructions, 201, 247–256 BootCache play list, 353–354 Branch prediction, 201, 211–212 BootCacheControl, 354 Branch reachability, 248 BootCache.kext, 1282 Breakpoint trap, 405 Singh.book Page 1603 Thursday, May 25, 2006 11:46 AM

Index 1603

brk(), 949 BUPOR (bring-up power-on reset), 393 Brunner, John, 146 Bus drivers, 368–369 BSD, 50–53 Bus interface unit, 165 application environment, 44–45, 102–103 Bus master, 161 condition variables, 1218 Bus speed, 159–162 hardware clock, 466 Bus standards, 160–162 proc structure, 747 Bush, Vannevar, 1410 return values, 571 Byte ordering, 225–226, 1594 system calls, 554 unified buffer cache (UBC), 52 uthread structure, 721, 748 C vndevice interface, 463 vnode disk driver, 1370–1371 C++, 53, 1237 bsd/ directory, 502–504 C library, 74–76 BSD initialization, 443–447 Cache(s) data structures, 445–451 associativity, 179 file system, 447–448 coherency, 180 mounting the root file, 455–464 direct-mapped, 179 networking subsystem, 450–453 lines, 175 shared memory regions, 466–468 management, 403–404 BSD processes, 746–748 MERSI, 180 () system call, 748–756 970FX, 176–178 vfork() system call, 756–759 RAS, 180 BSD system calls, 557–576 set-associative, 179 argument munging, 563–566 store policy, 179 data structures, 558–563 store-through, 403n kernel processing, 566–572 Cacheability, 858 user processing, 572–576 CacheBasher.app, 130 bsd_ast(), 465 cacheInit(), 403 bsd_bufferinit(), 446 CAD (command, address, data), 163 bsd_hardclock(), 466, 787 Callback-related functions bsd_init(), 445–449 CHUD support, 606–611 bsdinit_task(), 1141 Callbacks, 134, 484–485 bsdmake, 124 Call-by-name, 231 bsd_utaskbootstrap(), 465 Call-by-reference, 231 B-Tree-based catalog file, 1388 Call-by-value, 231 B-Trees, 1481, 1488 Callee-save register, 226 bufqscan_thread(), 712 Caller-save register, 226 Bundles and frameworks, 76 CAM (content-addressable memory), 224 bundle structure, 83 Canon, 10 bundle types, 78–80 Capabilites array, 1575 frameworks, 82–86 Carbon, 103–107 iTunes application bundle, 77 APIs, 27, 31, 33, 105–107 load commands, 87 CFM binaries, 104 OS X standard frameworks, 85–86 compared with Cocoa, 106–107 prebinding, 86–89 Carbon Event Manager, 106 printing libraries, 88 Carbon File Manager, 1407, 1430, 1516 files, 81–82 Carbon Managers, 90 Singh.book Page 1604 Thursday, May 25, 2006 11:46 AM

1604 Index

Carbon Multiprocessing Services, 769–771 chkfac(), 548 Carbon Manager, 767–769 (), 1444 Carbon Thread Manager, 772–774 chmodx_np(), 1445 Carbon.framework (Mac OS X), 103 Choke handlerr, 553 CarbonLib (Mac OS 9), 103 chosen properties, 334–335 CarbonSound, 105 (), 929 CardBus, 162 CHUD, 130, 604 Caret character, 274–275 callback-related functions, 606–611 Carnegie Mellon University (CMU), 17 CPU-related functions, 605–606 Case sensitivity kdebug_chudhook(), 625 HFS+, 1473, 1531–1532 memory-related functions, 605 HFSX, 39 task-related functions, 605 UFS, 1392 thread-related functions, 605 Cast-conversion, 89 CHUD tools Catalog, I/O Kit, 1253 acid, 131 Catalog B-Tree, 1566 amber, 131 Catalog B-Tree header node, 1518 BigTop.app, 130 Catalog file, HFS+, 1510–1519 CacheBasher.app, 130 Catalog node (cnode), 1569 hwprefs, 1587–1588 Catalog node IDs, 1513 MONster.app, 131 catch_exception_raise(), 1117 PMC Index.app, 131 catch_exception_raise_identity(), 1117 Reggie SE.app, 131 catch_exception_raise_state_identity(), Saturn.app, 131 1117 Shark.app, 131, 1338 CCacheServer.app, 60 simg4, 131 cddafs (Compact Disc Digital Audio file system), simg5, 131 1398–1400 Skidmarks GT.app, 131 CD/DVD, 127, 1388–1389 SpindownHD.app, 131 CDIS/Installation Log.app, 496 CHUDCall, 586 CDIS/instlogd, 496 CIContext, 97 CDIS/LCA.app, 496 CIFilter, 97 CDIS/preheat.sh, 496 CIFS (Common Internet File System), 1397 CDSA, 134 CIImage, 97 plug-ins, 135 CIKernel, 98 Cells, Forth, 279 CISampler, 98 cerror(), 572, 751 Class hierarchy, I/O Kit, 1239–1240 CFBundle, 78 Class matching, 1256 CFDictionaryAddValue(), 1359 Classes, I/O Kit, 1243–1246 CFM (Code Fragment Manager), 103, 104, 115 Classic, 114–116 CFMachPort, 1203 environment, 29 CFMessagePort, 1203–1205 sharing of OS X resources, 115 CFRunLoopTimer, 1209 Classic Startup.app, 60, 114 CFSocket, 1206–1208 Classic.app, 29n CGDisplayBaseAddress(), 1293 Class-modeling tool, Xcode, 107 Change logger Cleartext storage, 1320 Fsevents, 1422–1428 Client interface, Firmware, 299 Character device, 1349 Client IP, and BootX, 348–349 checkForWork(), 1246 Client systems, Xsan, 152 Singh.book Page 1605 Thursday, May 25, 2006 11:46 AM

Index 1605

Clock frequencies, 220 CommonPoint, 4 Clock implementation, 320–321 commpage area, 434, 554, 594–601, 922–924 Clock services, 522–524 com.osxbook.dummyd.plist configuration file, Clock speeds, 163 483–484 clock_config(), 430, 780 Compare-and-store function, 245–246, 1211 Clock-cycle-per-instruction (CPI), 168 Compare-and-swap function, 1211 clock_init(), 431 Compatibility Support Module (CSM), 367 Clock-time intervals, 782–784 Compilers cloneproc(), 465, 751 GNU C, 124 clone_system_shared_regions(), 929 and libraries, 124–125 closeGate(), 1246 version dependency, 677 -on- flag, 824 Compiling dynamic and static libraries, 69–70 Clumps, HFS+, 1481 Compiling the kernel, 676–681 cluster_io(), 1364–1366 complete(), 1258 CMOS (Complementary Metal Oxide Semiconduc- Complex Instruction-Set Computer (CISC), 157 tor), 157 Complex message, 1034 CMU Mach 2.0, 10 Composite value, 240 cngetc(), 469 Compositing, 93–94 CNID (catalog node ID), 1510, 1551 Compressed kernel, 337 assignments, 1515 Computation value, 805 converting to a Unix pathname, 1515 Computer Hardware Understanding Development. and exchangedata(), 1570 See CHUD; CHUD tools cnode, 1569 Condition Register (CR), 392 cnputc(), 469 Conditional branch, 201 Cocoa, 107 config/, 502 and Carbon, 33 Configuration agents, 142 compared with Carbon, 106–107 Configurations, 111 , 108–113 Console initialization, 416–419 malloc zones, 953 Console I/O, Forth words, 286 and NeXT, 107 Console operations table, 418 nib files (NeXT Interface Builder), 108 Constraint value, 805 NSTask, 763–764 Constructors, 440 NSThread, 764–766 Context, 542 Yellow Box, 33 Context communications area, 660 Coherency point, 180 Context switching, 774 Colon character, 463, 1388 Context-altering instruction, 537 Color lookup table (CLUT), 302, 437 Context-synchronizing, 537 Colors, 302–303 Contiguous allocation, 996–997, 1259 ColorSync, 5, 101 Continuation functions, 22, 431, 717–726 commandGateHandler(), 1248 Control events, 143 Command-line editing, 275 Control flow, Forth words, 286–287 Command-line support, 126–129 Control key character, 274–275 Command-line tools, 141 Control transfer Common Criteria Tools package, 143n external hardware , 532 Common Object File Format, 378 processor traps, 532 Common Security Services Manager (CSSM) API, software traps, 532 135 system calls, 533 CommonPanels, 105 Control-flow instructions, 200–201 Singh.book Page 1606 Thursday, May 25, 2006 11:46 AM

1606 Index

Conventional PCI, 161 CutTrace low-level tracing, 655–658 Conversion factor, thread processor usage, 796–799 , 24 Cooked devices, 1349 Cycle-accurate core simulator, 970FX, 256–261 , 771 Cylinder-Head-Sector (CHS) addressing model, Copland, 5–7 1346 Copy and paste, 115 Copy objects, 864 Copy strategy, 858 D COPYFILE, 1581 copyfile(), 1557, 1582 D0, 206 copyin(), 908, 909 D1, D2, D3, 206–207 Copy-on-write, 17, 20, 516, 862–864 DACopyDiskDescription(), 1355–1357 copyout(), 908, 909 DADisk functions, 1353–1355 CopyProcessName(), 767 Daemon copypv(), 909 agent, 472 Core Audio, 100 audit, 620 Core Data, 40, 108–113 cron, 475–476 Core file, 63 group membership resolution, 1451 Core Foundation, 89, 106 launchd, 472–485 data types, 81 on-demand launching, 473 , 1294 SSH, 474–475 distributed notifications, 1198–1199 and SystemStarter, 498 Core Foundation IPC, 1197–1210 update, 921 notifications, 1197 DART (Device Address Resolution Table), 157, run loop, 1201–1210 1257–1259 Core Graphics, 101 Darwin, 3, 46 Core Image, 40 benefits, 47–48 plug-in architecture, 97 notify center, 1197 Core Image and Core Video, 96–99 packages, 47, 676 Core Services, 89, 106 as subset of OS X, 48 directory, 60 32-bit ABI runtime stack, 232 Core Video, 40 package, 381 Cox, Brad, 11 Darwin kernel. See xnu kernel cpu uptime, 699 DarwinBuild, 681 cpu_doshutdown(), 551 Dashboard, 39–40, 119–120 cpu_type(), 467–468 Dashboard Widgets, 40, 78, 119 Cracked instructions, 206 Data, , 297–298 Crash Reporter daemon, 497, 1323 Data caching, disabling, 914 Crash Reporter.app, 60–61 Data fork, 1557, 1567 Crash reports, 61 Data link interface layer (DLIL), 153 Crash-resistant server example, 1074–1076 initializing, 450 create_unix_stack(), 820 Data manager (memory manager), 851 cron daemon, 475–476 Data partition, 1350 curctx, 538 Data stream manipulation instructions, 219 current_act(), 716 Data structure(s) current_thread(), 716 BSD initialization, 445–451 Cursor pmap, 866 BSD system calls, 558–563 CutTrace(), 657 EFI, 1589–1590 Singh.book Page 1607 Thursday, May 25, 2006 11:46 AM

Index 1607

file descriptors, 1148, 1374 Debugger(s) and debugging global profile cache, 944 and annotated code, 241 HFS+, 1477–1482 auditing support, 619–625 and hfsdebug, 1474 bundle, 78 IPC-related, 1042, 1048 Forth programs, 288–289 kauth, 1450 kernel arguments, 358–361 kmod_info, 1264 kernel event tracing (kdebug), 625–638 , 1192 kernel panics, 1322–1324 locking, 407, 449–451, 1214, 1218 logging, 1325–1328 low-memory global, 650–655 Mach VM interfaces, 896 Mach, 687, 714–716, 791, 1333 memory, 976 Mach locks, 421, 1213–1215, 1218 per-process kernel tracing, 617–619 Mach port, 1044–1045, 1054 remote, 122, 602–603 Mach trap table, 579 remote core dumps, 1324–1325 Mach VM, 849–855, 865–866, 896 and signals, 1144 Mach zone allocator, 985–992 stabs, 1338–1344 memory, 410 tools, 129–130 and mutexes, 1224 tracing, 649–659 Open Firmware, 289–298 xnu kernel, 50 pageable memory, 995–997 See also GDB (GNU debugger); KDB (-related, 1322 Debugger); KDP (Kernel Debugging patch tables, 398–400 Protocol) per-processor, 390, 652, 778 debugger_lock, 419 and physical memory, 410 Decrementer Register (DEC), 777 pipe, 449 Dedicated register, 226 private, 428 Dedicated threads, 710 pthread, 751 .def extension, 578 resource allocation, 356 Default environment (system and fs_root), 467–468 scalable zone, 955–966 Default init program, 469 scheduler, 408, 774, 791 Default pager, 517–518, 853 serialized, 441 Default processor set, 689 shared region mapping, 434, 466–468 deferctx, 538 shuttle and thread, 715 Deflate compression, 367–368 UNIX system call, 572 , HFS+, 1558–1561 UPL (universal page lists), 840 Delayed detachment, 450 virtual machine monitor (VMM), 538, 659–660 Demand paging, 836 vnode, 448, 455, 1374, 1383 Denning, Peter J., 837 Data-cache-block-touch instruction, 186–187 Dennis, Jack B., 683 Data-modeling tool Denormal , 219n Xcode, 107 Desktop (), 34 dd, 841–843, 1350 Destructors, 440 DDR (Double Data Rate), 157 detach(), 1281 Dead names, 1029, 1084–1086 Detached pthreads, 751 Dead port, 1048 Detaching a disk, 1368, 1370 Dead-Code Stripping, 123 Detachment of protocols, 450 deadfs, 1400–1401 Developer previews, 31–34 -debug, 1368 Developer’s Interface Guide (DIG64), 365 debug kernel argument, 360–361 devfs ( system), 1401 Singh.book Page 1608 Thursday, May 25, 2006 11:46 AM

1608 Index

Device Driver Kext, 1280–1288 , and security, 139 (s), 369, 1233–1235 Disk (Xsan), 150 Boot ROM (PowerPC), 270 diskarbitrationd, 1353 matching, 1255–1257 DiskImages.framework, 127 Device interface, Open Firmware, 300 diskimages-helper, 1368 Device Interface I/O Kit, 1269–1271 Diskless booting, 347 Device node naming, 1367 Disks and partitions, 1345–1349 Device pager, 518, 854 Apple partitioning scheme, 1348–1352 Device special files, 1235 GUID-based partitioning, 1352 Device tree, 289 PC-style partitioning, 1352 data, 297–298 diskutil command, 1349, 1352, 1353 devalias, 291 Dispatch group, 207 methods, 296–297 Display PostScript, 10 properties, 292–296 Dissenter object, 1357 Device Tree plane, I/O Kit, 1252 distcc, 122 device_pager_bootstrap(), 879 Distributed builds, 122 /dev/kmem, 841–843, 1597–1598 Distributed , 1197 /dev/mem, 1597–1598 Distributed Objects, 1164–1172 dgBootScreen(), 643 ditto, 1557 dgLRA(), 644 dkstrategy(), 1365–1366 dgpcpy(), 645–646, 650 dladdr(), 75n, 236 DHCP, 463 dlil_call_delayed_detach_thread(), 712 dhcpol_parse_packet(), 463 dlil_input_thread(), 711 diag, 638 dlopen(), 75 diagCall(), 641 DLPAR (Dynamic LPAR), 169–170 diagCommon.h, 642 DMA Address Relocation Table, 157 Diagnostic features, 639 Dock, 33 Diagnostics system calls, 642–644 Domain initialization, 451–452 interface, 641–649 domaininit(), 451 Dictionary, Forth, 282–288 doServiceMatch(), 1255 Digital imaging, 38 Double-precision floating-point values, 240 Direct function calls, 230 Drag and drop, 11, 115 Direct memory access (DMA), 94, 157 Draw protocol, 377 Direct-mapped cache, 179 Drawing images, 322–323 Directory services, and security, 140–141 Drawing rectangles, 303, 314–317 Dirty , 872 Driver(s) DiscRecording.framework, 127 EFI, 367–369 Disk and partitions, listing, 1348 I/O Kit, 1242 Disk arbitration, 1353–1361, 1497 matching, 1255–1257 Disk Arbitration subsytem API, 1353–1355 methods, 1287 Disk image, 1320 partitions, OS 9, 1350 BSD vnode disk driver, 1370–1371 personalities, 1255, 1281–1283 hdiutil, 1367–1369 xnu kernel, 48 RAM disks, 1370 Driver side (data transmission), 165 virtual disks, 1366–1374 drutil, 127 Disk Images framework, 1574 dscl command, 141 Disk mounting dissenter object, 1357 DSN, 17 Disk object, 1354 DSP, 207 Disk supersets, 1362 DSP, WRT, GCT, MAP, 207–208 Singh.book Page 1609 Thursday, May 25, 2006 11:46 AM

Index 1609

dssall, 403 EFI Byte Code (EBC), 367, 377–378 Dual-processor architecture, 158 EFI Byte Code (EBC) Virtual Machine, 377–378 Dual-processor bus, 164 EFI NVRAM, 369–370, 1589–1590 dummyd (trivial echo server), 479–482 EFI Runtime kernel extension, 1589–1590 DummyDriver I/O Kit driver, 1284–1286 EFI System Partition (ESP), 376 DummySysctl kernel extension, 1273 EFI System Table, 1590 DVD player, 38 eieio, 1212 dyld (dynamic link editor), 62 EINVAL error, 759 environment variables, 933 eip register, 65 interposing, 73–74 Elastic I/O interconnect, 164–166 loading a non-split-segment file, 934 ELF support, 330 loading a split-segment file, 935 Embedded C++, 1237 Mac OS X 10.4, 932–933 and I/O Kit, 1237–1238 .dylib, 63 EMM external , 517 Dynamic branch prediction, 212 Emulation registers, 197 Dynamic computation modes, 222 Emulators, 278 Dynamic libraries, compiling, 69 enable_bluebox(), 591 Dynamic linker, 64, 817–818, 932–935 Encoding names, 1532–1534 Dynamic linking, 67 Encrypted storage, 1321 binding styles, 71 Encrypted , 134, 139 dyld interposing, 73–74 Encrypted volumes, 1310–1321 two-level namespaces, 71 Encryption, swap files, 920 weakly linked symbols, 72 Encryption keys, 135 ZeroLink, 123 Entities, 111 Dynamic pager program, 918–921 Entity inheritance, 111 Dynamic shared library, compiling, 69–71 Entity-relationship (ER) diagram, 111 Dynamically allocated memory, 887 Entropy collection, 637–638 dynamic_pager, 517–518, 918 Epilogue, 233 EPS (Encapsulated PostScript), 93 ERATs, 183 E errno, 751 Error correction code (ECC), 159 EEPROM, 269 Error-correcting code, 180n Effective address (EA), 181 escc (serial port), 417n EFI (Extensible Firmware Interface), 46, 362 escc-legacy (serial port), 417n architecture, 368 /etc/rc, 486–487 benefits, 378–379 ether_family_init(), 454–455 binary format, 378 Ethernet connections, 276–278 boot manager, 370–371 Ethernet interface family, 454–455 boot services, 366–367 Ethernet interface MAC address, 1309–1310 driver types, 368–369 Ethernet port aggregation, 455 drivers, 367–369 Event tracing (kdebug), 625–638 GUID partition table, 374 Exception(s), 201, 518 and preboot software, 364 counters, 654–655 protocol, 369 and exception vectors, 383–385 runtime services, 367 filtering, 546–547 services, 366–367 Mach, 1112–1129 shell, 370–374, 372–374 ports, 515, 1049, 1112 Universal Graphics Adapter (UGA), 376–377 PowerPC, 383–385 Singh.book Page 1610 Thursday, May 25, 2006 11:46 AM

1610 Index

Exception(s), (continued) Fast IPC space, 1044 processing, 543–553 Fast Logout and Autosave, 40 save areas, 539–542 Fast Path, 171 vectors, 535, 536 Fast traps, 590 Exception-handling chain, 1118 Fast user switching, 39, 119 Exception-handling registers, 536–537 Fastpath call, 554 Exception-handling routine, 385 Fastpath system calls, 590 exception_triage(), 1120 Fat binaries, 12n, 66–68 EXCHANGEDATA, 1581 Fat Darwin kernel, 66 exchangedata(), 1570, 1582 Fat (Universal) binaries, 825 exec(), 116, 684 Fax capability, 39 exec_copyout_strings(), 822 fcntl(), 1231, 1430 exec_handle_sugid(), 819 FCode, 273 exec_mach_imgact(), 757, 815, 819, 822, 824 fd (file descriptor), 1374–1375 exec_shell_imgact(), 827 fdesc file system, 1402 execsigs(), 824 fdexec(), 824 Execution environments, 686–687 , 1352 execve(), 469, 757 Feldman, Jerry, 16 execve() system call, 62, 812–827 F_FULLFSYNC, 1539–1540 Task Working Set (TWS), 947 Fibre Channel Mutipathing, 153 Existence map, 921 Fictitious extensions (aka pseudo-extensions), 441 exit(), 572 Fifo file system, 1147 Exposé, 39, 119 FIFO with Second Chance, 871 (HFS Plus), 25 fifofs (named pipes), 1403 Extended memory addresses, 363 Fifos, 1147 Extended partitions, 363, 1352 File descriptor passing, 1148–1155 EXTENDED_SECURITY, 1581 File descriptors, 1374–1375 Extending a volume, 1572 File forks, HFS+, 1480 Extensible Firmware Interface. See EFI File format, BootX, 328–330 Extensions, 59 File sharing, 1395 descriptor data structure, 1480 File system APIs, Mac OS X, 1387 Extents, 1480 File system initialization, 447–448 Extents overflow file, 1519–1524 File system interfaces, 1581 eXternal booter, 344 File system types, 1386–1409 External hardware interrupts, 532 AFP (Apple Filing Protocol), 1393–1395 External memory management, 427n cddafs, 1398–1400 External memory manager, 854 deadfs, 1400–1401 devfs, 1401 fdesc, 1402 F fifofs, 1403 FTP, 1395–1396 facctx, 538 HFS Plus and HFS, 1388 Facility Status UFT, 589–590 ISO 9660, 1388–1389 Factorials, 241–244 MS-DOS, 1390 Families, I/O Kit, 1239–1241 NFS, 1396–1397 Family Superclasses, 1239–1240 NTFS, 1391 Fan control unit (FCU), 221, 1308 SMB/CIFS, 1397 Fans (temperature management), 220–222 specfs, 1403 Singh.book Page 1611 Thursday, May 25, 2006 11:46 AM

Index 1611

synthfs, 1404 Open Firmware, 272–278 UDF (), 1391 Open Firmware interfaces, 298–300 UFS, 1391–1393 Open Firmware programming, 300–324 union, 1405–1407 power-on reset (POR), 271–272 volfs, 1407–1409 power-on self-test (POST), 264 WebDAV, 1397–1399 security, 349–352 File system user-space view, 57–61 variables, 1294–1296 File systems FirmwareCall(), 640–641 access control lists (ACL), 1441–1445 Fix and Continue, 123 disk arbitration, 1353–1361 fixBufferUserRead(), 1313–1315 disk devices, 1362–1366 fixBufferUserWrite(), 1313–1318 disk images, 1366–1367 Fixed-point instructions, 198 disks and partitions, 1345–1349 FixupResourceForks, 1557 file system types, 1386–1409 Flash invalidation, L1 D-cache, 403 files and file descriptors, 1374–1375 Floating-point initialization value, 401 kauth authorization subsystem, 1445–1469 Floating-point instructions, 199 Spotlight, 1409–1441 Floating-point parameters, 239–240 VFS layer, 1376–1386 Floating-point register (FPR), 401 Files and file descriptors, 1374–1375 Floating-point-estimate instructions, 199 filesec_init(), 1445 FLOCK, 1581 Filesystems, 60 flock(), 1231 filetype, 63 Focus-follows-mouse, 103 FileVault, 39, 139 Font demo, 318–320 Fill strategy (Xsan), 152 Fonts, 115, 317–320 FindByContent, 101 foreground-color, 302 Finder (Desktop), 34 fork(), 52, 116, 748–756 finderInfo array, 1498 early UNIX, 684 Finding files, mdfind, 128 and Mach ports, 755 Fine-grained kernel event tracing (kdebug), 625–638 fork1(), 751–753 kdebug entropy collection, 637–638 forkproc(), 751–753 kdebug tracing, 625–637 Formal parameters, 231 FireWire plane, I/O Kit, 1252 Forth code, 279 Firewire , 328 for animation, 306–312 FireWire-based debugging, 601–603 cells, 279 Firmware, 46, 263–271 for core logic, 312 boot sequence, 324–328 debugging, 288–289 BootCache optimization, 353–354 dictionary, 282–288 booting an alternate kernel, 341–343 shell, 274–275 booting from a software RAID device, 344–346 , 279 booting over a network, 346–349 words, 281–282 boot-time kernel arguments, 355–361 Foundation notifications, 1181 BootX, 328–340 Foundation.framework, 107–108 call interface, 640–641 4.2BSD, 1131 device tree, 289–298 4.3BSD, 10, 19, 1131 Extensible Firmware Interface (EFI), 362–379 4.4BSD, 153 firmware boot sequence, 324–328 Fragile base-class, 55 Forth , 279–289 Fragment, 104, 1479 launching the kernel, 352–353 Fragmentation, 1519, 1520 Singh.book Page 1612 Thursday, May 25, 2006 11:46 AM

1612 Index

Fragmented files, 1558–1562 GCC 4.0.0, 66n Framebuffer, 1288–1292 GCT (global competition table), 207–208 Framebuffer memory, 1293 GD, 207 Framework scaling mode, 118 GD, DSP, WRT, GCT, MAP, 207–208 Frameworks, 4–5, 59–60 GDB (GNU debugger), 50n, 60 OS X standard, 85 FPR, 401 private, 84–85 script, crash reports, 61 System.framework, 87–88 and stabs, 1338 See also Bundles and frameworks using for debugging, 1328–1331 free(), 1280 Xcode, 122, 601–603 Free list (save area), 414, 540 General I/O Kit Classes, 1239–1240 Free pool (save area), 414 General OS Classes, 1239–1240 Free queue, 871 Gershwin, 6–7 Free Software Foundation (FSF), 47n getattrlist(), 1570, 1575–1582 Free space, 1507 getchar(), 469 Free space partition, 1350 get-colors, 302 FreeBSD getcontext(), 1138 NFS, 1396 getdirentriesattr(), 1571 UFS2, 1392 getfwpath, 341 virtual memory, 21 get_ip_parameters(), 463 Freezing a volume, 1571 getmntinfo(), 1348n Fsevents, 51 getOrientationUC(), 1299–1302 argument types, 1418 getpid(), 575 change logger, 1422–1428 GetProcessForPID(), 767 event generation, 1421 gettimeofday(), 594 implementation, 1419 get_user_regs(), 466 supported event types, 1416 getWorkLoop(), 1246 fs_usage, 129 Giant mutex, 52n FTP file system, 1395–1396 GiB (definition), 1347 function(), 247 GIDs (group identifiers), 133 Function calls, 228–230 GIF (Graphics Interchange Format), 93 stack trace, 237–238 Gigabyte (definitions), 1347 Function rerouting, 246 Giuse, Dario, 20 constructing branch instructions, 247–256 Global data structure, 1374 instruction patching, 247 Global history vector, 211 Function (use of term), 231 Global profile cache, 944 function_new(), 247 Global variables, GUID, 369–370 function_stub(), 248 Global volume lock, 1571 funnel_alloc(), 445 Globe data, 336 Funnels, 52, 1223–1229 GNU assembler, 193 GNU C compiler, 124, 1338 GNU debugger. See GDB (GNU debugger) G GNU-Darwin, 35 gnumake, 124 g++, 62 GPR0, 537 Gassée, Jean-Louis, 7–9 gprof, 612–617 GB (metric definition), 1347 gpt, 376, 1352–1353, 1373 gcc, 62 GPT-partitioned disk, 374–376 Singh.book Page 1613 Thursday, May 25, 2006 11:46 AM

Index 1613

GPU (graphics processing unit), 94 case sensitivity, 1531–1532 grade_binary(), 816 catalog file, 1510–1519 Graphics adapter, 376–377 clumps, 1481 Graphics Address Remapping Table (GART), 157 comparisons, 1575–1582 Graphics and multimedia APIs, 91–101 extents, 1480 Graphics and multimedia architecture, 91 extents overflow file, 1519–1524 Group membership resolution daemon, 1451 file forks, 1480 GUID, 369–370, 1373 filename encodings, 1532–1534 GUID Partition Table (GPT), 374, 1352–1353 freezing and thawing a volume, 1571 x86-based computers, 1590–1591 hard links, 1547–1551 HFS wrapper, 1501–1505 journaling, 1538–1546 H metadata zone layout, 1562 and NTFS comparison, 1583 Hamming code, 180–181 optimizations, 1558–1570 Handler thread, 518, 1115 permissions, 1534–1538 Handlers, 201, 750 quotas, 1546–1547 Handoff , 708, 791, 1058 reserved areas, 1493 Hangup (HUP), 489 resizing a volume, 1572 Hard disk, 1345n resource forks, 1556–1558 Hard limits, 685 sparse disk images, 1574–1575 Hard links, 1547–1551 special files, 1492, 1505–1530 Hard reset exception, 271 special system calls, 1570–1571 layer (HAL), 5, 7, 44–45, 1236 startup file, 1530 Hardware exception counters, 654–655 symbolic links, 1553–1554 Hardware offset register (HIOR), 271 Technical Note TN1150, 1477 Hardware interrupts, 549–551 unlinking open files, 1552–1553 Hardware streams, 186 volume header, 1493–1501 Hardware-Implementation-Dependent (HID) regis- volume notifications, 1572 ters, 194 volume structure, 1491–1493 Harvard Architecture, 178 volumes, 1515 Hash tables, 411–413, 869 hfsdebug, 1474–1475, 1558–1560, 1565 hdiutil, 127, 1320, 1367–1369 hfs_extendfs(), 1572 sparse disk images, 1575 hfs_generate_volume_notifications(), hdix (Disk Image Controller), 463 1574 Header bitmap, 957 hfs_hotfilesync(), 1567 heap, 129 hfs_recording_init(), 1566 Heat sensors, 221–222, 1305–1308 hfs_recording_start(), 1568 Help (Carbon subframework), 105 hfs_relocate(), 1558 hertz_tick(), 780, 785, 787 hfs_truncatefs(), 1572 HFS, 462, 1386 HFSX, 39 HFS+, 462, 1386 HID (hardware-implementation-dependent), 403 aliases, 1554–1556 HID (human interface device), 1241 allocation blocks, 1477 High-level architecture, 45 allocation file, 1505–1509 High-level processor initialization, 405–421 analysis tools, 1474–1477 after virtual memory, 415–421 attributes file, 1524–1530 low-level VM initialization, 409–415 B-Trees, 1481–1491 before virtual memory, 407–409 Singh.book Page 1614 Thursday, May 25, 2006 11:46 AM

1614 Index

High-level VM subsystem, 423–428 iCal, Spotlight search results, 1440–1441 High-water mark, 918 iChat, 38–40 HIServices, 101 .icns, 118 History list, BootCache, 353–354 Browser application, 118 Hit rate, caching, 353–354 Icon Composer, 118 HIToolbox, 106 Icon status indication, 119 HIView, 106 IDE (integrated device electronics), 298 Host information, Mach, 519–522 iDisk, 38 Host ports, 1050 Idle kernel thread, 432–435 Host statistics, Mach APIs, 526–529 idle_thread(), 711 host_get_boot_info(), 520 IEEE, 273 host_info(), 519–520 IEEE 802 address, 375 host_kernel_version(), 520 Ignore reset, 394 host_notify_init(), 1060 ihandler(), 549–550 host_page_size(), 520 Illegal instructions, 257, 1595 host_processors(), 693, 1050 iMac, 3 host_processor_set_priv(), 690 Image activator table, 815 host_processor_sets(), 690 Image formats, 93 host_request_notification(), 1060 Image processing, 98 host_statistics(), 526–529, 892 ImageCapture, 106 host_zone_info(), 985 iMovie 2, 37 Hot File area, 1562 Inactive queue, 871 Hot File Clustering (HFC), 1562–1564, 1566–1570 Indirect function calls, 228–229 Hot File thread, 1565 Indirect system call, 558 Hot Files B-Tree, 1565–1566 Info.plist, 81, 84 hotfiles_adopt(), 1570 Information Access Toolkit (-Twin), 90 hotfiles_evict(), 1570–1571 Information property list, 81 HotSpot Java Virtual Machine (JVM), 113 Infrastructure initialization, 775–789 Howarth, David J., 835–836 Inheritance, entity, 111 HPC (high-performance computing) applications, 183 Inheritance, memory, 884 HTML rendering, 106 init(), 1280 Huge allocations, 966 init_domain(), 451 Human-interface services, 101 Initialization Hupp, Jon A., 146 BSD, 443–469 hwprefs, 178, 1587 console, 416–419 Hybrid drivers, 369 custom routine, 70–71 HyperTransport (HT), 157–164 data link interface layer (DLIL), 450 HyperTransport Technology Consortium, 162 domain and protocol, 451–452 file system, 447–448 high-level processor, 405–421 I high-level subsystem, 423–428 infrastructure, 775–789 IA-64 architecture, 365 I/O Kit, 435–443, 1253–1255 IA-32 computers, and EFI, 367 IPC, 430 IA-32 real mode, 362 kprintf(), 416–417 IBM Mach subsystem, 421–432 Jikes (Java compiler), 113n networking subsystem, 450–453 S/390 G5, 157 page frames, 425–426 , 4–5 Pmap, 411–415 Singh.book Page 1615 Thursday, May 25, 2006 11:46 AM

Index 1615

Processor-specific, 400–401 I/O addresses, 1257 protocol, 451–453 I/O Kit, 53–54, 1235 Scheduler, 421–423 class hierarchy, 1239–1240 Virtual memory, 409–415, 430 classes, 1243–1246 initialize(), 1254 Device Interface, 1269–1271 inittodr(), 455 disk device and partitions, 1362–1363 Ink (handwriting recognition), 106 driver matching, 1255–1257 , 38 driver methods, 1287 Inline assembly, 193 driver personality, 1281–1283 Inline data, message, 516 drivers, 1242 Input handler, 450 Embedded C++, 1237–1238 Installation log viewer, 496 families, 1239–1241 Installation progress bar, 498 initialization, 435–443, 1253–1255 Installation startup, 496–499 I/O Catalog, 1253 install_name_tool, 129 I/O Registry, 1251–1252 Instruction Cache Access (ICA), 206 memory allocation, 995–997 Instruction Decode Unit, 185 nubs, 1242–1243 Instruction Fetch Address Register (IFAR), 206 planes, 1252 Instruction Fetch Unit, 185, 210 traps, 554, 584 Instruction Match CAM (IMC), 224 Work Loop, 1246–1251 Instruction patching, 247, 249–256 I/O Kit Device Driver Kext, 1280–1288 Instruction pipeline, 970FX, 205 I/O Media Filter, 1362–1364 Instruction Prefetch Queue, 185 I/O protocol (UGA), 377 Instruction set, 197–202 I/O Registry, 54 Integrated chip (IC), 157 IOCatalogue, 1243 Intel Boot Initiative (IBI), 366 IOCreateThread(), 711–713 Intel Core Duo, 156, 173–174 (I/O control), 1346 Intel Wired for Management specification, 375 IODiskMatching(), 459–460 Interconnect mechanism, 161–162 IOExternalMethod, 1300 Interface Builder, 108 IOFindBSDRoot(), 457–461 Interfaces, file system, 1581 IOFindMatchingChild(), 460 Interfaces, Open Firmware, 298–300 IOKernelDebugger, 1245 Internal objects, 853 iokit/, 502, 504 Internet, 24–25 IOKitResetTime(), 447 Internet Systems Consortium, Inc. (ISC), 35 IOLog(), 1325 Interposition, 73–74, 1087 IOMalloc(), 995–997 Interpreter(s), 125–129 IOMallocContiguous(), 1259 AppleScript, 125–126 IONetworkInterface, 153 Automator, 126 IONetworkNamePrefixMatching(), 459–460 command-line support, 126–129 IOPanicPlatform, 1253 scripts, 825–827 IOPlatformExpertDevice, 1598 Interrupt, 201 iops (internal operations), 206 interrupt(), 550–551 IORecursiveLockLock(), 1247 Interrupt line, 549 IORecursiveLockUnlock(), 1247 Interrupt model, 718 ioreg command-line utility, 269, 1252, 1338 Interrupt vector relocation, 271 IORegisterNetworkInterface(), 460 interruptEventSource(), 1248 IORegistry, 442–443 interruptOccurred(), 1248 IORegistryEntry, 1243 In-use bitmap, 957 IORegistryExplorer.app, 1252 Singh.book Page 1616 Thursday, May 25, 2006 11:46 AM

1616 Index

IORegistryIterator, 1243 run loop, 1201–1210 IOService, 1243 semaphores, 1219–1222 connection handle, 1302 signals, 1129–1145 iostat, 1338 , 1041–1044 IOWorkLoop class, 1246–1248 SPLs, 1230 IPC (interprocess communication), 16, 1021–1025 subsystem initialization, 1060–1062 advisory-mode file locking, 1230–1232 synchronization, 1210–1232 Apple Events, 1172–1181 tasks, 1048–1051 bootstrap servers, 1066–1079 threads, 1051–1052 BSD condition variables, 1218 XSI IPC, 1155–1156 CFMachPort, 1203 IPC-related data structures associated with a Mach CFMessagePort, 1203 task, 1048 CFRunLoopTimer, 1209–1210 iPhoto, 39 CFSocket, 1206–1208 iPod driver, 1283 client-server example, 1080–1084 ISO 9660 file system, 1388–1389 Core Foundation, 1197–1210 ISS, 208 dead names, 1084 issignal(), 1141 Distributed Objects, 1164–1172 iSync, 38 entry splay tree, 1043–1044 , 1212 entry table, 1043 iTunes, 37 exceptions, 1112–1129 iTunes application bundle, 76–77 file descriptors, 1148–1155 Foundation notifications, 1181–1184 funnels, 1223–1229 J initialization, 429 interposition, 1087–1090 Jaguar, 36, 38–39 I/O kit, 1223 Java, 113–114 kernel event notification, 1191 Abstract Windowing Toolkit, 102n lock sets, 1218 and Cocoa, 107 low-level locking, 1213–1217 java, 113 Mach IPC , 1031–1040 Java 2 Standard Edition (J2SE), 37 Mach ports, 514–516, 1027–1031, 1044–1048 Java archives (jar files), 113 messages, 516, 1031–1040 (JDK), 33, 113 messaging, 1057–1060 Java Native Interface (JNI), 113 MIG, 1094–1111 Java threads, 762–763 msg traps, 578 Java Virtual Machine framework, 113 name servers, 1068–1079 javac, 113 named pipes (fifos), 1147 JavaVM.framework, 113 notifications, 1181–1197 JBOD (Just a Bunch of Disks), 151 notify(3) API, 1184–1186 Jikes (Java compiler), 113n out-of-line memory, 1090–1092 Jobs, Steve, 9–10 pipes, 1145–1146 Journal info block, 1541 port allocation, 1052–1057 Journaling, HFS+, 1538–1546 port rights, 1093–1094 journal_init(), 448 port sets, 1085–1087 JPEG (Joint Photographic Experts Group), 93 POSIX IPC, 1156–1164 Just-in-time (JIT) compiler, 33, 113 Pthreads synchronization interfaces, 1222 Just-in-time (lazy) binding, 71 ptrace() system call, 1144–1145 JVM, 762 Singh.book Page 1617 Thursday, May 25, 2006 11:46 AM

Index 1617

K task, 513 tracing (ktrace(2) and ), 129, 617–619 kalloc(), 992–993, 995 traps, 1121 kalloc_init(), 879 version string, 650 kau_init(), 449, 619 See also xnu kernel Kauth, 134 Kernel arguments, 355–361 Kauth authorization subsystem, 1445–1446 for boot behavior, 355–356 activity monitor, 1453–1469 for locking behavior, 357 implementation, 1450–1453 for properties and debugging, 358–361 listeners and authorization, 1449 for resource allocation, 356 scopes and actions, 1446–1448 for root devices, 357 Vnode-level activity monitor, 1453–1469 for scheduling behavior, 357–358 kauth framework, 51 Kernel Debug Kit, 1329 kauth_authorize_action(), 814 Kernel Event Agent, 1572 kauth_init(), 445 Kernel extension(s), 57, 79, 1259, 1296 KDB (Kernel Debugger), 50n, 603–604 auto loading, 1267–1269 commands, 1332–1336 bundle, 1260 show all commands, 1336 caches, 335 show commands, 1336 creating, 1271–1288 and stabs, 1338 generic, 1271–1279 kdebug, 625–638 managing, 1266–1267 KDP (Kernel Debugging Protocol), 50n, 602–603, static linking, 69 1245, 1324, 1329 Universal, 1261 kdumpd, 1324 Kernel memory, 841–845 Kerberos, 37 allocator, 428 Kernel, 48–57 dd and /dev/kmem, 841–843 , 907–911, 1594–1595 kvm(3) interface, 843–845 auditing support, 619–625 Kernel profiling (kgmon and gprof), 612 bootstrap thread, 431–432 Mach task and thread sampling, 616–617 CHUD support, 603–612 per-process profiling (profil(2)), 614–616 debugging support, 601–658 Kernel programming interfaces (KPIs), 51n, diag, 638 153–154, 1235, 1466 event queues, 484–485 Kernel startup, 382–388 functions, 382 BSD initialization, 443–469 funnel, 445 first thread, 432–435 kdebug, 625–638 high-level processor initialization, 405–421 kext caches, 59, 335–338 I/O kit initialization, 435–443 logging, 416 launching the user-space program, 469–470 Mach-O load commands, 337 low-level processor initialization, 388–405 mode, 531 Mach subsystem initialization, 421–432 modules (kmods), 1260–1266 slave processors, 470–472 , 1192 Kernel threads, Mach, 710–712 panic, 1322–1324 Kernel User Notification Center (KUNC), 508 port, 1049 kernel_bootstrap(), 431–432 process tracing, 129, 617 kernel_bootstrap_thread(), 711 save areas, 538 kernel_debug(), 638 stack pointer, 538 kernel_memory_allocate(), 983 subsystems, 419–422 Kernel-space security, 133–134 symbols, 385–387 kernel_thread(), 712–713 Singh.book Page 1618 Thursday, May 25, 2006 11:46 AM

1618 Index

kernel_trap(), 581 L1 D-cache, 403 kevent(), 1192–1196 LangAnalysis, 101 Kext, 1259–1269 Language Chooser Application, 496 .kext, 79 Languages Kext management, 1268 Forth, 279–289 Kext repository cache, 59n, 335–338 scripting, 125 kextcache, 348 supported in Xcode, 124 kextd, 55–56, 1266–1267 LAPACK, 125 kextstat command, 49 Large allocations, 964–966 Key combinations Large pages, 184 command-line editing (Open Firmware), 275 lastcomm command, 134 for nvedit command-line editing, 327 Last-in first-out (LIFO), 280–281 for Open Firmware startup, 274 latency, 1338 , 135, 140 Launch Services, 116 Keychain (OS 9), 27 framework, 828–833 Keynote file, 79 registration database, 829–830 kgmon, 612–617 LaunchAgents, 60 kHasBundle, 78 LaunchApplication(), 767 Kilburn, Tom, 835–836 LaunchCFMApp, 104 kill(), 1129, 1138 launchd, 60, 472–485 kmem_alloc, 983–985 -compliant daemons, 478 kmeminit(), 445 daemon configuration, 473–476 kmem_init(), 878, 879 daemon creation, 476–484 kmod_dump_log(), 1326 debug messages, 1077–1078 kmod_info, 1254, 1264, 1266 operation, 484–485 kmod_init(), 431 session launching, 488–490 knote_init(), 449 LaunchDaemons, 60 kprintf() initialization, 416–417, 604 Launching applications, 828 kqueue, 51, 484–485, 1572–1574 mapping entities to handlers, 828–830 filters, 1193 Uniform Type Identifiers (UTI), 830–833 kqueue(2), 1191 Launching the kernel, 352–353 ksh shell, 125 LaunchServices, 101 ktrace(), 129, 617–619 Lazy binding, 71 K2 I/O device controller, 159 LBA (logical block address), 374 kudos, 287 LCA, 498 kvm(3) interface, 843–845 LC_LOAD_DYLINKER, 817–818 kvm_getargv(), 843–844 LC_PREBOUND_DYLIB load command, 941 kvm_getenvv(), 843–844 LC_SEGMENT, 817–818 kvm_getprocs(), 843–844 LC_SEGMENT_64, 817–818 kvm_nlist(), 843–844 LC_THREAD, 817–818 kvm_read(), 843–844 LC_UNIXTHREAD, 817–818 kvm_write(), 843–844 ld (static link editor), 62 LDAP (Lightweight Directory Access Protocol), 140 L LDT ( Data Transport), 162 Leaf function, 234 L1 and L2 caches, 176–178 leaks, 129 L2 cache, flushing, 404 ledger_init(), 431 Singh.book Page 1619 Thursday, May 25, 2006 11:46 AM

Index 1619

libc, 74 Load Miss Queue (LMQ), 185 libdbm, 74 Load Reorder Queue (LRQ), 185 libdl, 74–75 load_context(), 784 libdyldapis, 75 load_machfile(), 816–818 libinfo, 74 load_shared_file(), 927, 930 libkern/, 502 Load/Store Unit (LSU), 185, 186 classes and routines, 505–506 Load-time binding, 71 C++ environment, 1000–1001 Local busses, 160 directory, 505 Local domain, 58 library, 54–55 Local file systems, 1386 libkeymgr, 75 Local lock implementation, 1232 libkmod.a, 1265 Local notification center, 1197 libkmodc++.a, 1263 Lock attributes, 1217 libkvm, 74 Lock groups, 1217 liblaunch, 75 lockf(), 1231 libm, 75 Locking behavior libmacho, 75 kernel arguments, 357 libnotify, 75 Locking data structures, 407, 449, 450, 451, 1214, libpoll, 75 1218 libpthread, 75 Log buffer daemon, 496–497 Library Directory, 59–61 Log messages, 1327–1328 librpcsvs, 75 Logging libsa/, 502, 506–507 audit, 449 libsa library, 55–56 debugging, 1325–1328 libstreams, 75 kernel, 416 libSystem, 74 in Mac OS X, 1326 libtool, 63 malloc operations, 976–978 libunc, 75 Logical Block Addressing (LBA), 1346 Link Aggregation, 455 Logical partitions, 363 Link register (LR), 248 Logical unit number (LUN), 150–151 Link widths, 163 Logical-to-real address, 644–645 Linkage area, 231–232 Login Linking, 67 hook, 491–493 binding styles, 71 multiuser startup, 490–493 dyld interposing, 73–74 loginwindow, 488, 490–495 two-level namespaces, 71 system restart, 494 weakly linked symbols, 72 system shutdown, 494 ZeroLink, 123 user logout, 494 , 23, 845 loginwindow.app, 60 and Xgrid, 147n Lookup function, 870 lipo, 66, 129–130 lookupd, 132 Liquid cooling, 220–222 Loopback interface, 450, 454 listDisplays(), 1292–1294 Love, Tom, 11 Listeners (callbacks), 134 Low tracing, 655–658 Listeners (kauth), 1449, 1457 Low-level diagnostics, 638–649 Little-endian, 226 firmware call interface, 640–641 Load commands, 337, 817–818 system call interface, 641–649 listing, 65 Low-level kernel tracing, 649–659 Singh.book Page 1620 Thursday, May 25, 2006 11:46 AM

1620 Index

Low-level locking, 1213–1217 process subsystem, 688 lock groups, 1217 scheduler priorities, 792 mutexes, 1215 Spotlight, 1410–1441 /write locks, 1216 supported file systems, 1386–1409 spinlocks, 1213 system call processing, 553–557 Low-level processor initialization, 388–405 system startup, 388 memory patching, 398–400 and filenames, 1533 processor types, 395–398 virtual memory subsystem, 837 processor-specific initialization, 400–401 10.x, 36–41 reset types, 392–394 Mac OS X 10.0, 36–37 Low-memory global data area, 651 shuttle and thread data structures, 715 Low-memory global data structures, 650–655 Mac OS X 10.3 Low-trace record generation, 658 current thread and activation, 716 Low-water mark, 918 shuttle and thread, 715 LPAR (Logical Partitioning), 169–170 Mac OS X 10.4, 39–41 LRU (least recently used), 841 current thread and activation, 716 lsof, 130 dyld, 932–933 LSOpenCFURLSpec(), 828 prebinding, 942 LSOpenFromRefSpec(), 828 Mac OS X Server, 31, 145 LSOpenFromURLSpec(), 828 Xgrid, 146–150 LSOpenFSRef(), 828 Xsan, 150–153 LSPrefersPPC, 1594 MacBook Pro, 3 lsregister, 829–830 Mach, 18–22, 49–50, 510–519 lwsync, 1212 activation and shuttle, 714–716 LZ77 compression, 368 continuations, 717–726 LZSS compression, 337n exceptions, 518–519, 1112–1129 kernel fundamentals, 511–518 kernel threads, 710–712 M ledgers, 431 lock sets, 1218 .Mac account, 37, 1397 memory objects, 516–518 Mac OS 7.6, 6, 24 nomenclature, 20 Mac OS 8, 24–27 page map, 921 Mac OS 9, 25–27, 114–116 pager interface, 857 driver partitions, 1350 processor sets, 689–691 Mac OS X processors, 692–702 auditing system, 621 remote procedure call (RPC), 712–714 block and character device, 1364 semaphores, 1219–1222 Bootstrap Server, 1068 subsystem initialization, 421–432 command-line tools, 1476 system calls, 554 creation, 31–36 task and thread sampling, 616–617 Disk Arbitration subsytem, 1353–1361 and task API, 702–705 Disk Images framework, 1367 tasks and threads, 727–746 file descriptors, 1375 threads, 705–712, 717, 730–732 file system APIs, 1386–1387 traps, 53, 576–584 file system comparisons, 1575–1582 zone allocator, 985–992 IPC, 1024, 1041–1060 Mach APIs, 519 logging, 1326 alarm, 524–526 memory management, 838–846 clock services, 522–524 Singh.book Page 1621 Thursday, May 25, 2006 11:46 AM

Index 1621

host information, 519–522 mach_port_allocate_full(), 1052 host statistics, 526–529 mach_port_get_attributes(), 1055–1056 processor, 693–696 mach_port_names(), 1055 task, 702–705 mach_task_self(), 703 thread, 707–710 MachTen, 23 Mach Emulation Daemon (machd), 30 mach_thread_self(), 707 Mach Interface Generator (MIG), 18, 429, 578 MACH_TRAP(), 579–582 Mach IPC. See IPC mach_vm_allocate(), 885, 893–896, 948 Mach Object File Format, 62 mach_vm_behavior_set(), 889–890 Mach port(s), 689–690, 1027–1031 mach_vm_copy(), 888 allocation, 1031 mach_vm_deallocate(), 885 communication, 1027 mach_vm_inherit(), 884, 886 and fork(), 755 mach_vm_map(), 881–884 internal structure, 1045 mach_vm_msync(), 891 as objects, 1030 mach_vm_protect(), 886, 897 rights, 134, 1028 mach_vm_read(), 887, 899–901 Mach VM, 846–868 mach_vm_read_overwrite(), 887 architecture, 850 mach_vm_region(), 893 backing stores, 853 mach_vm_region_info(), 896–897 map entries, 851 mach_vm_remap(), 884–885 maps, 849–851 mach_vm_wire(), 889 objects, 851–853 mach_vm_write(), 888, 899–901 pager, 428n (MFS), 1386 pagers, 853–861 Macworld Conference, 3 protection values, 884 MacWorld Expo, 33–34 task address space, 849 macx_swapoff(), 919 Mach VM interfaces, 893 macx_swapon(), 919 controlling memory inheritance, 893 macx_triggers(), 919–920 debugging, 896 Magic number, 323n naming and sharing memory, 901–907 Magnified mode, 118 protecting memory, 897–898 makecontext(), 1138 user-space, 878–893 malloc mach_absolute_time(), 782, 807 implementation, 954 Machine check exception (MCE), 272 zones, 951–956 Machine State Register (MSR), 188, 194–195, 401 malloc(), 966–967, 1000 Machine-dependent thread state, 538–539 MallocDebug.app, 130 machine_init(), 430 malloc_history, 130 machine_startup, 419–421 Managed Object Context, 112–113 machine_thread_create(), 751–753 MAP, 207–208 mach_msg(), 1025, 1031 Mapping tables, 414–415 mach_msg_overwrite(), 1025, 1031, 1058 mapping_adjust(), 433 mach_msg_overwrite_trap(), 1032 Master boot record (MBR), 363, 1352 Mach-O, 62–66 Master CPU, 264n filetypes, 63–64 Master directory block, 1503 header load commands, 65 Master processor, 388–391, 397, 405, 407 header structure (32-bit version), 63 Matching dictionaries, 1268–1269 listing the load commands, 87 Matching dictionary, 1359–1361 prebinding, 89 Matchmaker (language), 18 mach_port_allocate(), 1031, 1052 maxmem, 296 Singh.book Page 1622 Thursday, May 25, 2006 11:46 AM

1622 Index

MAXUSERS, 686 reading kernel memory, 841–845 mbuf_expand_thread(), 711 regions, 409, 466–468, 517 mdcheckschema, 1439 resident memory, 868–877 mdfind, 1439 shared memory, 902–907, 922–942 mdfind command, 128–129 64-bit computing, 1005–1020 mdimport, 1414, 1439 subsystem, 839 .mdimporter, 79 swap files, 918–921 MDItem attributes, 1412 synchronization, 202 mdls command, 128 Task Working Set (TWS), 942–948 MDQuery, 1431–1434 transfer, 888 mdutil, 1439 unified buffer cache (UBC), 913–918 memberd, 132 universal page lists (UPLs), 912 Memex, 1410 update daemon, 921–922 Memory, 835 virtual memory initialization, 877 addresses, 182 vm_page structure, 868–869 allocated, 414 See also Virtual Memory classes, 1244 Memory allocation in the kernel, 980 controller, 157, 171 BSD portion, 997–1000 copy-on-write, 862–864 I/O kit, 995–997 data structures, 410 kalloc, 992–993 deallocation, 982 kmem_alloc, 983–985 debugging, 976 libkern’s C++ environment, 1000–1001 debugging Mach VM, 896 Mach zone allocator, 985–992 dynamic pager program, 918–921 OSMalloc, 993–994 inheritance, 893–895 page-level allocation, 980 kalloc zones, 992–993 Memory allocation in , 948–951 kernel and user address space, 907–911 enumerating all pointers, 971–974 kmem_alloc, 983–985 intercepting malloc layer, 979 Mach VM, 846–868 logging malloc operations, 976–978 Mach VM interfaces, 893–907 malloc() routine, 966–968 Mach VM user-space interface, 878–893 memory allocator internals, 951, 957–964 mach_vm_allocate(), 893–896 scalable zone statistics, 974–976 mach_vm_map(), 881–884 (MMU) mach_vm_protect(), 897–898 address translation, 181–183 mach_vm_remap(), 884–885 block address translation, 184–185 manager, 851 ERATs, 183 map, 333 large pages, 184 memory management, 838–846 segment lookaside buffer (SLB), 181–182 memory-mapped files, 1001–1005 translation lookaside buffer (TLB), 181–182 NVRAM, 266 Memory properties objects, 20, 516–518 Power Mac G5, 295 OSMalloc, 993–994 PowerBook G4, 294 page faults, 876–877 memory_manager_default_init(), 879 page replacement, 871–872 Memory-mapped files, 1001–1005 pagers, 853–861 memory_object_control_bootstrap(), 879 patching, 398–400 memory_object_data_request(), 859, 877 PRAM, 265–266 memory_object_data_return(), 860 protection, 6–7, 34 memory_object_destroy(), 861 Singh.book Page 1623 Thursday, May 25, 2006 11:46 AM

Index 1623

memory_object_get_attributes(), 859 mount command, 1348 memory_object_init(), 856–858 mount_ftp, 1395–1396 memory_object_lock_request(), 860 Mounting, root file system, 455–464 memory_object_server(), 856 Mouse pointer demo, 314–317 memory_object_terminate(), 861 MP Services. See Carbon Multiprocessing Services MergePef, 130 .mpkg, 79 MERSI, 180 Mr. Registry.app, 54, 1252 Message header fields, 1034–1035 MS-DOS file system, 1390 Message passing. See IPC MsgType, 1099 Message trailer, 1038–1039 msleep(), 1218 Messages, 20, 516, 1031–1040 msync(), 922 Messaging implementation, 1057 multicast DNS (mDNS), 148 Metadata Multichip module (MCM), 170 allocation zone, 1561–1562 MULTICS IPC, 1024 attributes, 1432 Multiextension (mkext) cache, 59 controllers, 151–152 Multimedia extension sets, 214 framework, 1411–1412 Multiple users, fast user switching, 119 importer, 79, 1428–1430 Multiprocessing, 170, 771 Metadata server (mds), Spotlight, 1414 Multiprocessor system processes, 700–702 Methods, Open Firmware, 296–297 Multiprocessor system startup, 388–395 Microcoded instructions, 206 Multitasking, 771 Micropartitioning (processor), 170 Multithreading, 169–170 and signals, 1135 Active Directory, 140 Multiuser startup, 485–495 , 2 user login, 490–493 , 2, 24 Munging, 562–566 Musical names, 24 NTFS, 1582–1585 Mutexes, 52, 1215, 1224–1225 microtime(), 455 my_thread_setup(), 730–732, 1596–1597 MIDI System Services, 99 MIG, 1094–1111 and client-server systems, 1100 N and kernel, 1108 specification files, 1095 Naked rights, 1050 Migrating threads model, 717 Name servers, 1060–1079 MiniPCI, 161–162 Named entry handle, 883 mkext cache (multiextension cache), 335–338 Named Pipes (Fifos), 1147 mkfifo(), 1147 Named POSIX semaphores, 1160 MkLinux, 23 Nanokernel, 25–26 mmap(), 1001, 1004, 1349 NaNs (Not a Number), 402 Mobile Motion Module. See Sudden Motion Sensor Natural unit, 378 (SMS) natural_t, 1043 MODE32 software, 267 Navigation Services, and UTIs, 831 Model (Core Data), 111 NavigationServices, 106 Model-View-Controller (MVC), 108, 110n nchinit(), 448 MONster.app, 131 Nested pmap, 867 Moore, Charles, 279 netboot_mountroot(), 462–463 Morphemes, 101 NetInfo, 140 Singh.book Page 1624 Thursday, May 25, 2006 11:46 AM

1624 Index

Netname server (nmserver), 30 North Bridge/South Bridge, 161 netstat, 276 Not Quite NFS (NQNFS), 1397 Network booting, 346–349, 463–464 Notifications, 1181–1197 Network Data Representation (NDR), 1123 kqueue(2), 1191 Network Diagnostics.app, 60 notify(3) API, 1184, 1191 Network domain, 58 notify_post(), 1185–1186 Network file systems, 1386 , 3 Network funnel, 445 np (nonportable) calls, 759–761, 929 Network Kernel Extensions (NKE), 51, 153–154 NSBundle, 78 Network Message Server, 515, 1060, 1063–1064 NSManagedObject, 111 Network Name Server, 1063 NSMovie, 114 Networking, 153–154 NSMovieView, 114 Networking, user-level, 90 NSNotification, 1181 Networking subsystem initialization, 450–453 NSTask Cocoa Class, 763–764 Network-Transparent Ports, 515 NSThread Cocoa Class, 764–766 New World architecture, 268 NSUndoManager, 110 NeWS, 10 NSWorkspace class, 116 new_system_shared_regions(), 927, 931 NTFS file system, 1391 NeXT, 9–10 Nubs, 56, 1242–1243 and Cocoa, 107 NuBus, 269 NEXTSTEP, 10–13 NuKernel, 4 OPENSTEP, 13–15 Null mount file system, 1405 Plan A, 9 Null port, 1048 and Ross Perot, 10 nvedit, 326, 327 startup history, 9 NVRAM StepStone, 11 dumping contents, 300–301 NeXT Interface Builder, 108 EFI, 369–370 NEXTSTEP Driver Kit, 1234 and Open Firmware, 266 NFS, 463 panic log, 343 asynchronous I/O server, 723–724 Platform Expert, 57 buffer cache, 916–918 the script, 325 file system, 1396–1397 variables, 296, 343, 1590 nfs_bind_resv_thread(), 711 nfsd, 724 NFSEXPORT, 1581 O nfsiod program, 723–724 nfssvc(), 724 OBEXAgent.app, 60 nib files, 108 Obfuscation scheme, password, 491 nibtool, 109 Object graph, 110 niutil, 141 ObjectAlloc.app, 130 nm (object file symbol table), 63 Objective-C, 11 Node identifier, 375 and Cocoa, 107 Nodes, B-Tree, 1484 protocols, 1165 Nonexecutable stack, 1595–1596 Objects, Mach VM, 851–853 Non-Java (NJ) bit, 402 OEA registers, 194 Nonleaf class, 55 open(), 1002–1009 Nonmaskable interrupt (NMI), 394 Open Firmware, 46, 264, 272 Nonvolatile memory. See NVRAM ASCII password, 350 Nonvolatile register, 226 character display, 317–320 Singh.book Page 1625 Thursday, May 25, 2006 11:46 AM

Index 1625

clock implementation, 320–321 osascript, 125 command-line editing, 275 OSBacktrace(), 1326 console, 325 osfmk/, 502 creating windows, 323–324 directory, 508–509 drawing images, 322–323 osfmk, MkLinux, 23 emulators, 278 OSlibkerninit(), 1254 features, 273 OSMalloc functions, 993–994 font demo, 318–320 OSReportWithBacktrace(), 1326 and Forth, 279–289 OSRuntimeFinalizeCPP(), 1264 Forth shell, 274–275 OSRuntimeInitializeCPP(), 1254, 1264 getfwpath, 341 otool, 65, 69, 87, 89, 130 interfaces, 298–300 Out-of-line data, 699–700 Mach-O binaries, 326 message, 516 mouse pointer, 314–317 Out-of-line memory, 1090 mouse pointer demo, 315–317 Out-of-order execution, 169 password, 349–352 Overwrite call, 888 pixel-addressable printing, 318–320 programming, 300–324 serial download, 278 P startup key combination, 274 TELNET, 275–276 PackageMaker.app, 79 TFTP, 276–278 Packages/, 496 Towers of Hanoi problem, 303–314 Pad word, 957 window, 324 Page deactivation, 890 See also Firmware Page faults Open Firmware Working Group, 272–273 resident memory, 876–877 Open Group, 21n and TWS, 947 Open Scripting Architecture (OSA), 106 Page frame, 835 (OSF), 21 Page frames, initializing, 425–426 and Apple, 23 Page queues, 870 Open source compilers, 124n Page table, 181, 403 Open source development, 35 Page table entry group (PTEG), 411–413 Open source software, 43 Pageable memory, 995–997 Open Transport, 90 Pageable resident page, 870–871 OpenAL, 100 Page-in, 857 OpenBoot, 272 Page-in operation, 1006–1007 OpenDarwin, 35 Page-level allocation, 980 OpenDoc, 5, 7 Page-out, 857, 1008–1009 openGate(), 1246 Pageout daemon, 435, 872–874 OpenGL, 37, 96 Pager OpenGL interfaces, 97 Mach VM, 428n, 853–861 OpenGL Profiler.app, 130 port, 855–856 OpenScripting, 106 problems, 860 OPENSTEP, 13–15 reply port, 858 Operators, Forth words, 285 Pages (address translation), 181 Option ROM, 363 pagestuff, 130 Organick, Elliott I., 1024 Palette bundle, 79 OS Picker, 330 Palm, Inc., 9 osacompile, 126 Panic image, 437–438 Singh.book Page 1626 Thursday, May 25, 2006 11:46 AM

1626 Index

Panic log, 343 perfmon_init(), 430 Panic server, 1324 Perforce Software, Inc., 124 Panic UI, testing, 439 Performance Monitoring Counter (PMC), 131 Panther, 36, 39 Perl, 125, 1559–1560 Parameter area, 231–234 Permissions, HFS+, 1534–1538 Parameter memory. See PRAM Perot, Ross, 10 Parameter passing, 231, 239–240 Per-process kernel tracing, 617–619 Parameter (use of term), 231 Per-process profiling, 614–616 Parity bits, 180 Per-processor data, 390–392 parse_bsd_args(), 445 Per-processor information areas, 650–655 parse_machfile(), 818 Perq computers, 17 Partition map, 1350, 1371–1372 Persistent Store Coordinator, 112 Partition map entries, 1350 Personalities, driver, 1255–1257, 1282 Partition table editor, 1348 pexpert/, 502 Partitioning, GPT, 374–376 directory, 509–510 Partitioning, x86 computers, 1590–1591 PHP, 125 Partitioning (drive), 363 Physical addresses, 1257 Partitioning (processor), 170 Physical memory, examining, 645–648 Passing parameters, 239–240 Physical memory window, 865 Passive data, 1036 PI (processor-interconnect), 164 Passive matching, 1256 pid_for_task(), 581–584, 703 Password Pink project, 2, 4–5 obfuscation scheme, 491 pipeinit(), 449 Open Firmware, 349–352 Pipes, 1145–1146 password command, 349–350 PIR Processor ID Register, 394 Pasteboard Manager, 831 Pixel-addressable printing, Open Firmware, 318–320 Pasteboard Server (pbs), 31, 60 .pkg, 79 Patch partition, 1350 PkgInfo file, 78 Patch tables, 398–400 PKZip archives, 1557 Pathnames, and kernel functions, 382 Plan A (NeXT), 9 Payne, R. Bruce, 835–836 Platform, 155–156 pbprojectdump command-line program, 124 Platform Expert, 56–57, 408, 509–510, 1255 PC Card Standard, 162 computer serial number, 1304–1305 PCA PTEG Control Area, 411 temperature sensor readings, 1305–1308 pcb, 538 Platinum-look user interface, 25 PCBs process control blocks, 414 Play list (BootCache), 353 PCI bus bridge, 157 plist files, 81–82 PCI devices, listing, 1303–1304 Plug-and-play, 53 PCI Express, 160–162 Plug-in API, 81 PCI-X, 159 Plug-in architecture, Core Image, 97 PCMCIA, 162n Plug-in bundle, 79 PC-style partitioning, 1352 plutil, 82 PDF, and Quartz 2D, 92–93 pmap, 411, 865–868 PDF Kit, 40 initialization, 411–415 pdisk command, 1348–1350, 1352 pmap_create(), 865–866 PE32 binary format, 378 pmap_destroy(), 866 PEF files, merging, 130 pmap_enter(), 866–867 PEFViewer, 130 pmap_init(), 877, 879 Singh.book Page 1627 Thursday, May 25, 2006 11:46 AM

Index 1627

pmap_map(), 865–868 sensors, 222, 1297 pmap_map_iohole(), 865 64-bit processor, 167–168 pmap_page_protect(), 867 software conventions, 224–240 pmap_protect(), 867 speculative execution, 168–169 pmap_reference(), 866 split transactions, 163 pmap_remove(), 867 superscalar, 168 pmap_switch(), 868 thermal and power management, 220–222 pmap_vm_init(), 410 U3H system controller, 157–159 PMC Index.app, 131 Power Management Unit (PMU), 265–266 Pointer enumeration, 972 Power plane, 1252 Polled-mode, 602 POWER4 processors, 166, 169 Port(s) POWER4+ processor specs, 172–174 allocation, 1031, 1052, 1053 POWER5 processors, 169–171 descriptor, 905–907 POWER5+ processors, 171 Mach, 134, 514, 689, 755, 1027, 1045 Power-on reset (POR), 271–272 pager, 855–856 Power-on self-test (POST), 264, 366–369 renaming, 1047 PowerPC rights, 1027–1030, 1053, 1088–1094 bootloader, 46 set, 515, 620–621, 1029, 1085 exceptions, 383–385 Portable Executable (PE), 378 executables, 68, 116–117 POSIX, 533 970s, 171–173 BSD init, 449 processors, 155–156 threads (Pthreads), 75, 759–774 registers, 189–191 POSIX IPC, 1156 system calls, 554, 584–586 semaphores, 1156 unconditional branch instruction, 249 shared memory, 1160 PowerPC 970FX, 174–224 Postfix notation, 279 AltiVec, 212–219 postModLoad(), 1265 branch prediction, 211–212 postsig(), 1141 caches, 175–181 POWER4+, 169–172 core, 202–212 POWER6, 171 cycle-accurate core simulator, 256–261 Power Mac G5, 156–166 D0, 206 amber, 256–261 D1, D2, D3, 206–207 architecture and platform, 164 GD, DSP, WRT, GCT, MAP, 207–208 atomic compare-and-store function, 244–246 IFAR, ICA, 206 comparison with other processors, 166–174 instruction pipeline, 205–210 dual-processor architecture, 158 instruction set, 197–202 elastic I/O interconnect, 164–166 internal buffers and queues, 185 function rerouting, 246–256 ISS, RF, 208–210 HyperTransport, 162–164 maximum instructions, 210 Intel Core Duo, comparison with, 173–174 Memory Management Unit, 181–185 K2 I/O device controller, 159 power management, 219–222 out-of-order execution, 169 prefetching, 186–187 PCI Express, 160–162 processor-type table entry, 395–397 PCI-X, 159–160 registers, 188–194 POWER 4 processors, 166, 169 rename registers, 194–197 POWER5 processors, 169 64-bit architecture, 222–224 PowerPC 970, 970FX, and 970MP, 171–224 softpatch facility, 224 recursive factorial function, 241–244 XFER, 207 Singh.book Page 1628 Thursday, May 25, 2006 11:46 AM

1628 Index

PowerPC 970MP, 395n procdup(), 465, 751 PowerPC OEA registers, 195 Procedure (use of term), 231 PowerShare, 5, 7 Process accounting, 134 PowerTalk, 5, 7 Process control block (PCB), 689 PowerTune, 220 Process model, 718 ppc_init(), 405–409, 470 Process serial number (PSN), 767 ppc_init_cpu(), 470–471 Processes, 683–684 ppc_vm_init(), 410, 877 activation and shuttle, 714–716 PPM (portable pixmap) image data, 322 BSD processes, 746–759 PRAM, 57, 265 continuations, 717–726 resetting, 266 in early UNIX, 684–685 resetting, and password security, 352n execution environments, 686–687 Prebinding, 71, 86–89, 941 execve() system call, 812–827 Mac OS X 10.4, 942 Launch Services, 828–830 Preboot Execution Environment (PXE), 363–364 Mach tasks and threads, 727–746 Preboot software, and EFI, 364 POSIX threads (Pthreads), 759–774 Precious pages, 891 process limits, 685–686 Precompiled headers, 123 processors, 689–702 Predefined queries, 111 remote procedure call, 712–714 Predictive compilation, 122 scheduling, 774–811 Predictor tables, 211–212 task structure, 702–705 Pre-EFI Initialization Layer (PEI), 366 thread migration, 717 Preemptible parameter, 805 thread structure, 705–712 rate, 775 Uniform Type Identifiers (UTI), 830–833 Preemptive multitasking, 7, 771 Processor Abstraction Layer (PAL), 365 bundle, 80 Processor API, 693–696 Preferred Executable Format (PEF), 104 Processor cache information, retrieving, 178 Prefetch Filter Queue (PFQ), 185, 186 Processor event labels, 260 Prefetch Request Queue (PRQ), 186 Processor initialization, 388–421 Prefetching, 187 Processor interconnect, 158, 165 Prefix matching, 459–460 Processor set API, 689–691 preModLoad(), 1264 processor structure, 692 prepare(), 1258 Processor traps, 532 Prerequisite packages, 677–680 Processor types, 395–398 Primary partitions, 363 Processor usage, conversion factor, 796–799 Print (Carbon subframework), 106 processor_exit(), 693–696, 700 PrintCore, 101 processor_get_assignment(), 696 printf(), 1325 processor_info(), 693 without using malloc(), 971–972 processor_set_create(), 690 Printing libraries, 88 processor_set_default(), 690 printlibs, 88 processor_set_destroy(), 690–691 Priority ranges, 791–792 processor_set_info(), 691 Private frameworks, 60, 84–85 processor_set_stack_usage(), 691 Privileged state mode, 188 processor_set_statistics(), 691 probe(), 1256, 1280 processor_set_tasks(), 691 Probe score, 1256 Processor-specific initialization, 400–401 Problem state mode, 188 processor_start(), 693–696, 700 /proc file system, 1409 processor_start_thread(), 711 proc structure, BSD, 747 Processor-type table entry, 395–397 Singh.book Page 1629 Thursday, May 25, 2006 11:46 AM

Index 1629

processor_up(), 784 Pthreads, 1222 procinit(), 445 Pthreads API, 759–760, 802 Productivity features, 119 Pthreads library, 707–710 Dashboard, 119–120 pthread_yield_np(), 760 fast user switching, 119 ptrace() system call, 1144 Spotlight, 120 Public beta, 35 profil(), 614–616 Puma, 36–38 .profile bundle, 80 PVR Processor Version Register, 397 Programmable read-only memory (PROM), 264 Python, 125 Programming, 121–131 resolving an , 1555 compilers and libraries, 124–125 Disc Recording framework, 127 Disk Images framework, 127 Q interpreters, 125–129 precompiled headers, 123 QNaN (Quiet NaN), 402 sips command, 128 QNIX, 17–18 tools, 129–131 .qtif, 437 trivial AppleScript program, 125 QTKit.framework, 114 Xcode, 122–124 Quality of Service structure, 1054 Prologue, 233 Quartz, 91 Properties, kernel arguments, 358–361 Quartz Composer, 40 Properties, Open Firmware, 292–296 , 92–94 Property List Editor, 82 Quartz 2D, 37, 92–93 Property list (plist) files, 81–82 Quartz 2D Extreme, 40 Protected mode, 363 Quartz Debug.app, 119, 130 Protection values Quartz Extreme, 38, 94–95 Mach VM, 884 Quartz Extreme with Accelerated 2D, 94–95 vm_protect(), 1596 Quartz Services, 94, 1293 Protocol, EFI, 369 quartz-wm (), 103 Protocol initialization, 451–453 Queues, 970FX, 185, 209 proto_input_run(), 711 QuickDraw, 101 proto_kpi_init(), 450 QuickDraw GX, 5, 7 ps command, 829 QuickDraw 2D, 95–96 Pseudo file systems, 1386–1387 QuickDraw 3D, 5, 7 Pseudo-devices, 297 QuickTime, 36–41, 114 Pseudo-extensions, 441 Core Image and Core Video, 98 PseudoKernel, 591–594 RAW file, 437 PTEG (Page table entry group), 411–413 video-rendering pipeline, 98 hash table size, 412–413 QuickTime Virtual Reality (QTVR), 99 ptesync, 403 Quotas, HFS+, 1546–1547 Pthread data structure, 751 pthread_cond_signal_thread_np(), 760 pthread_cond_timedwait_relative_np(), 760 R pthread_create_suspended_np(), 760 pthread_get_stackaddr_np(), 760 RAID pthread_get_stacksize_np(), 760 AppleRAID, 344–345 pthread_is_threaded_np(), 760 booting from a software RAID, 344 pthread_mach_thread_np(), 760 and BootX, 346n pthread_main_np(), 760 disk supersets, 1362 Singh.book Page 1630 Thursday, May 25, 2006 11:46 AM

1630 Index

RAID, (continued) remove_all_shared_regions(), 931 headers, 345–346 Rename registers, 194–197 Xsan, 150–151 Rendezvous, 39 Xserve, 150, 153 Repairing permissions, 1536 RAM, 223, 268, 294, 354 Request, split transactions, 163 RAM disks, 459, 1370 Resampling an image, 128 Random number generator (RNG), 637 Reserved areas, 1493 Raptor, 4, 152 Reset RAS, 180 exception, 271 Rashid, Richard, 17, 18, 22 handler, 392 Raster graphics, 93 interrupt, 271 Raster image formats, 93 the PRAM, 266 Raw devices, 1349 types, 392–394 Raw kernel memory access, 845 ResetHandler, 394 Rcsid, 1099 reset_shared_file(), 927, 931 Reachability (of a branch), 248 Resident memory, 868 READDIRATTR, 1581 module, 423–425 readdirattr(), 1582 page faults, 876–877 Read/write locks, 1216 page queues, 870 Real address (RA), 181 page replacement, 871 Real mode, 363 resident pages, 869–870 Real-time clock, 778–780 vm_page structure, 868–869 Receive rights, 514, 1027–1030 vm_page_grab(), 872–875 Receive side (data transmission), 165 Resolution-independent user interface, 118–119 receivePacket(), 602 Resource allocation, kernel arguments, 356 Reconnect UAM, 1394 Resource forks, 1556–1558, 1567 Recorder function, 972 Resource ledgers, 729 Records, B-Trees, 1487 Response, split transactions, 163 Recursion, 305 Restartable system call, 570 Recursive factorial function, 241–244 Return from interrupt, 537 Recursive invocation, 73 Return stack, 280 Red project, 2, 4 Reverse DNS, 82, 136n, 831 Reggie SE.app, 131, 194 Reverse Polish notation (RPN), 279 Register contents, viewing, 194 revoke(), 1400 Registers, 227–228 RF (register file), 208–210 direct calls, 230 rfid, 401, 537 OEA, 194 Rhapsody, 24, 27–31 32-bit, 222n Blue Box, 29 VEA, 188–191 Yellow Box, 29–31 registerService(), 443 Rich Site Summary (RSS), 99 Registry, I/O, 1251–1252 RIG. See Rochester’s Intelligent Gateway (RIG) Relative branching, 201 RISC (reduced instruction-set computing), 5–6 Remote core dumps, 1324–1325 Rochester’s Intelligent Gateway (RIG), 16 Remote debugging, 122 ROM-in-RAM design, 268 Remote disk mounting, 463 Root device, 457–458 Remote procedure call (RPC) kernel arguments, 357 Mach, 712–714, 717 Root file system, 456 MIG, 1094 mounting, 455–464 Singh.book Page 1631 Thursday, May 25, 2006 11:46 AM

Index 1631

rootdev, 456–457 say command, 125, 128 rootpath, 334 /sbin/init, 469 Rosetta, 116–117, 1591n /sbin/launchd, 469 translate, 1593 /sbin/mach_init, 469 x86-based Mac computers, 1592–1594 sbrk(), 949 Rotating a framebuffer, 1288–1292 Scalable malloc allocation categories (32-bit), 956 Round-robin strategy (Xsan), 152 Scalable malloc allocation categories (64-bit), 956 Roving pointer, 1507 Scalable zone allocator, 953 RPC. See Remote procedure call Scalable zone data structures, 955 /rsrc, 1556 Scalable zone statistics, 974–976 rtclock_intr(), 550–551, 780, 785 Scalar, 168 RTP (Real-Time Transport Protocol), 99 Scaling modes, 118 RTSP (Real-Time Streaming Protocol), 99 sched_init(), 421–423 r12, 229 sched_pri_shift, 796–797 Ruby, 125 sched_startup(), 785 Run loop, 1201–1203 sched_tick_continue(), 786–789, 801 sources, 1203–1210 sched_tick_interval, 796–797 Run queues, 791–793 sched_tick_thread(), 711 Runtime architecture, 61 Scheduler initialization, 421–423 fat binaries, 66–67 Scheduler operation, 789–802 linking, 67–74 Scheduler services, 432–435 Mach-O files, 62–66 Scheduler startup, 784–786 Runtime recording list, 1568 Scheduler tick, 786 Runtime services, EFI, 367 Scheduler tick thread, 432 Scheduling, 774–775 absolute- and clock-time intervals, 782–784 S behavior, 357–358 policy, 774, 802–811 sa (stand-alone), 55 statistics, 527–529 web browser, 39, 41 timeslicing quantum, 775–777 Spotlight search, 1440–1441 timing and clocks, 777–782 Safe mode, 332, 339, 469 SCOM (Scan Communications) facility, 403–404 Samba, 1397 SCOMC (control) registers, 404 sample (process profiler), 130 SCOMD (data) registers, 404 Sampler.app, 130 Scopes (kauth), 1446–1448 Sampling tasks and threads, Mach, 616–617 Screen dimensions, 301–302 Saturate (SAT) bit, 402 Screensaver bundle, 80 Saturn.app, 131 Screenshot, text console, 648–649 Save area(s), 414 Script, the, 326–327 argument munging, 563 Scriptable applications, 1172 BSD system calls, 557 Scriptable Image Processing System. See sips com- exception, 539 mand LowTraceRecord structure, 658 Scripting languages, 125 pointers (pcb and upcb), 538 AppleScript, 106, 115, 125–126, 1173–1175 vector, 333 Perl, 125, 1559–1560 Save area free list, 540 PHP, 125 Save area free pool, 540 See also Open Scripting Architecture (OSA) .saver, 80 sc_usage, 130 Singh.book Page 1632 Thursday, May 25, 2006 11:46 AM

1632 Index

scutil command, 142 sem_open(), 1156 SEARCHFS, 1581 sem_unlink(), 1156 searchfs(), 1571, 1582 Send rights, 514, 1027–1030, 1088 Searching. See Spotlight Send-once rights, 1029 SearchKit.framework, 90 sendPacket(), 602 Sector, hard drive, 1345–1346 Sequence number, 1038 Secure empty trash, 39, 132, 139 Serial console, 417–418 Secure transport, 135 Serial download, Open Firmware, 276–278 Security, 131–133 Serial port names, 417n architecture, 133 serial_keyboard_poll(), 711 auditing system, 143–145 Serial-line-based debugging, 603–604 authorization services, 137 Server. See Mac OS X Server Basic Security Module (BSM), 134 Server 1.x, 31 command-line tools, 141 ServerPrefix, 1099 and daemons, 132 Service bundle, 80 firmware, 349–352 Service plane, I/O Kit, 1252 kernel-space security, 133–134 Set-associative cache, 179 Security Agent, 136 setattrlist(), 1570 security command, 140 set-colors, 302 Security Server, 135–136 setconf(), 455–456 snag keys, 351 setcontext(), 1138 system administration, 139–142 Setgid, 819 token, 1038–1040 SETI project, 147n user-space security, 134–139 setthetime(), 455 Security Agent, 135–136 Setuid, 819 and Apple Remote Desktop, 136n Shadow chain, 862–863, 896 security command, 139–140 Shadow objects, 848, 862–863 Security Server, 135–136 Shadowed clone, 929 Security.framework, 139–140 Shadowing, 1370 SecurityHI, 106 shandler(), 557, 590 security-mode, 350–351 Shared bus, 159 Segment descriptors, 181 Shared memory Segment lookaside buffer (SLB), 181–182, 405 client, 903 Segment registers (SRs), 404 client-server example, 902 Segment table entries (STEs), 181–182, 404 regions, 466–468 Segments (address translation), 181 server, 905, 922–942 () system call, 722 setup, 923 Self port, 577, 1049 Shared object files, 932–935 semaphore_create(), 759, 1219 shared_file_init(), 468 Semaphores shared_region_make_private_np(), 927–928 Mach, 1219–1222 shared_region_map_file_np(), 927–929, Named POSIX, 1160 936–940 semaphore_signal(), 759 Shark.app, 131, 1338 semaphore_signal_all(), 759 Shell, EFI, 370–374 semaphore_signal_thread(), 759 Shell scripts, 825–827, 842–843 semaphore_wait(), 759, 1219 Shells, 125 semaphore_wait_signal(), 759 , 25 semexit(), 824 Sherlock version 3, 39 Singh.book Page 1633 Thursday, May 25, 2006 11:46 AM

Index 1633

shmexec(), 824 Slash character, 1156 shm_open(), 1160 Slave processor, 388–391, 401, 405, 470–472 Shoch, John F., 146 slave_machine_init(), 471 show commands, KDB, 1336 slave_main(), 470–471 show all commands, KDB, 1336 Sleep, 1179–1181 Shuttle/activation, 714–716 and reset handlers, 393–394 Sideband signals, 161 Slice (disk partition), 1348 sifting, 287 .slideSaver, 80 sifting (Forth dictionary), 287–288 Small allocations, 964–965 sigalstack(), 1136 SMB/CIFS, 38, 1397 Signaling NaN (Not a Number), 402 SMP (symmetric multiprocessing), 170 Signals, 1129–1131 SMT (simultaneous multithreading), 169–170 application-defined signals, 1132 Snag keys, 327–328, 340 asynchronous I/O, 1132 and security mode, 351 and debugging, 1144 Snoop response (SR), 165 default action, 1130 SOAP (Simple Object Access Protocol), 90 delivery, 1130, 1138 socketinit(), 450 generation, 1130, 1138 Soft limits, 685 and IPC, 1132 Soft reset, system reset exception, 271 and Mach exceptions, 1141 Software conventions, 224 maximum number, 1131–1132 byte ordering, 225–226 and multithreading, 1135 passing parameters, 239–240 ptrace() system call, 1144 register usage, 226–228 reliability, 1131 returning values, 240 signal actions, 1135–1136 stack usage, 230–238 Signature, BootX, 338 Software debouncing, 394 SIGTRAP, 819 Software dependencies, 679 Silicomp, 21n Software traps, 532 SIMD (single-instruction, multiple data), 213 Source code editor, Xcode, 122 simg4, 131 Spam filtering, 38 simg5, 131, 256–261 Sparse disk images, 1574–1575 Simple integers, 204n Sparse file, 1392 Simple message, 1034 specfs (special files), 1403 SimpleCryptoDisk, 1311, 1321 Speculative execution, 168 I/O Kit driver, 1311–1320 SpeechRecognition, 106, 121 Single Partition UDIF (SPUD), 1369 SpeechSynthesis, 101 Single-precision floating-point values, 240 SPICE, 17 Single-user mode, 332, 339, 349, 469 Spider Systems, 17–18 Single-user startup, 495–496 Spier, Michael J., 1024 bootstrap through launchd, 495 Spin Control.app, 130 sips command, 128 SpindownHD.app, 131 64-bit architecture, 222–223 Spinlocks, 1213–1215 64-bit comm area, 594 Spinning globe data, 336 64-bit computing, 1005–1020 SPL (set-priority-level) call, 1230 64-bit processor, 167–168 Splay tree, 1043–1044 64-bit support, 40 Split transactions, 163 Sizing memory, 409–411 SplitFork, 1557 Skidmarks GT.app, 131 Split-segment library, 924–925, 927–931, 939 Singh.book Page 1634 Thursday, May 25, 2006 11:46 AM

1634 Index

Spotlight, 39–40, 90, 119, 120, 1409 Storage pools, 151 architecture, 1410–1415 Store Data Queue (SDQ), 185 command-line tools, 1439–1440 Store policy, caches, 179 compared with BFS, 1415 Store Queue (SQ), 185 Fsevents, 1416–1428 Store Reorder Queue (SRQ), 185 limitations, 1440–1441 StorNext, 150 metadata importers, 1428–1430 Streaming SIMD Extensions 2 (SSE2), 174 metadata server (mds), 1414 Streaming SIMD Extensions 3 (SSE3), 174 queries, 1431–1438 Streams, and prefetching, 186 search, 51 struct machine_thread, 687 temporary files, 1430 struct proc, 687 .spreporter, 80 struct processor, 687 SPRG1 register, 432 struct processor_set, 687 SPRG registers, 537 struct run_queue, 687 Spring-loaded folders, 25 struct task, 687 SQLite, 40 struct thread, 687 SRR0, 536–537 struct uthread, 687 SRR1, 537 Subframeworks, 101 SSB (source-synchronous bus), 164–165 Subnormal numbers, 219n SSH daemon, 474–475 Subprocessor partitioning, 170 ssh-agent, 122 Subroutine (use of term), 231 SSL (Secure Socket Layer), 135 Sudden Motion Sensor (SMS), 1297–1303 Stabs, 1338–1344 Stack allocation queue, 433 Network Information Service (NIS), 140 Stack usage, 230–238 NeWS, 10 in functions, 235–236 and Open Firmware, 272–273 printing stack frames, 235–238 OpenStep, 13 Stack-based language, 279–280 Solaris, 7 Stacks, Forth, 279–280, 283 Superscalar, 168 Stallman, Richard, 533 Support packages, 297–298 Star Trek, 3 Suspend count, 704, 708 start(), 1280 SVG (Scalable Vector Graphics), 93 startCPU(), 394 Swap files, 518 StartIOKit(), 442–443, 1253–1255 memory, 918–921 startMatching(), 1255 swapcontext(), 1138 Startup extensions dictionary, 443 Swing, 102, 113 Startup file, HFS+, 1530 Symbol table. See Stabs Static archive libraries, 69 , 1390 Static branch prediction, 212 Symbolic links (symlinks), 1553–1554 Static link editor, 62 Symmetric copy-on-write, 862–864 Static linking. See Dynamic linking Symmetric multiprocessing (SMP), 771 Static prediction, 212 (), 921–922, 1212, 1567 Statistics, Mach VM, 892–893 Sync flags, 891 StepStone Corporation, 11 Synchronization, 1210–1232 Sticky Keys, 121 advisory-mode file locking, 1230–1232 stop(), 1280 atomic operations, 1213 Storage area network. See Xsan BSD condition variables, 1218 Storage Description Register (SDR1), 194 classes, 1244 Singh.book Page 1635 Thursday, May 25, 2006 11:46 AM

Index 1635

funnels, 1223–1229 T low-level locking, 1213–1217 Mach lock sets, 1218 Taligent Object Services (TalOS), 4–5 Mach semaphores, 1219–1222 Target disk mode, 328 Pthreads, 1222 tart, 237n SPLs, 1230 Task(s) Synchronous bus, 165 address spaces, 849 synthfs, 1404 API, 702–705 (), 178, 845–846, 1279 functions, CHUD, 605 sysctl hierarchy, 1277 and IPC, 1048 sysctl nodes, 1277 Mach, 431 sysctlbyname(), 845–846, 1594 port, 514 sysctl_handle_init(), 1277 roles, 810–811 sysctl_handle_string(), 1277 sampling, Mach, 616–617 sysctl_register_fixed(), 450 and threads, 512–514, 727–746 , 845 Task (Mach), 19 syslogd, 1077 task structure, 702 System Abstraction Layer (SAL), 365 Task Working Set (TWS), 942–948 System administration, and security, 139–142 execve() system call, 947 System architecture, 164 global user profile cache, 945 System call, 201, 533, 537 and page-faults, 947 cancellation, 562 task_assign(), 696 categories, 557–601 TASK_BACKGROUND_APPLICATION, 811 processing, 553–557 TASK_CONTROL_APPLICATION, 811 return values, BSD, 571 task_create(), 704, 727–729 x86-based Mac computers, 1597 TASK_FOREGROUND_APPLICATION, 811 System call data structures task_for_pid(), 704, 899 Third Edition UNIX, 572 task_get_exception_ports(), 704 System clock configuration, 781 task_get_special_port(), 704 System Configuration, 142 TASK_GRAPHICS_SERVER, 811 System domain, 59 task_halt(), 818 System Enabler, 267 task_info(), 704 System entry mechanisms, 533–543 task_init(), 431 /System/Library/ Directory, 59–61 task_policy_get(), 705 System linkage instructions, 537 task_policy_set(), 705 System Management Unit (SMU), 265–266 task_resume(), 704 , 34 task_set_exception_ports(), 704 System Profile reporter, 80 task_set_64bit, 816 System reset exception, 271 task_set_special_port(), 705 System reset interrupt (SRI), 271 task_suspend(), 704 System restart, 493–495 task_swap_exception_ports(), 704 System shutdown, 493–495 task_terminate(), 704 System size configuration, 686 task_threads(), 704 System startup, 388–395 TASK_UNSPECIFIED, 810 System V IPC, 449 tbxi (Toolbox image), 270 system_profiler Tcl, 125 x86-based Mac computers, 1588 shell, 125 SystemStarter TELNET, 275–276 and daemons, 498 telnet support package, 275–276 Singh.book Page 1636 Thursday, May 25, 2006 11:46 AM

1636 Index

Temperature, Hot File Clustering, 1563–1564, 1567, thread_get_state(), 707, 759 1569 thread_info(), 707 Temperature sensor readings, 1305–1308 thread_init(), 431 Templates, Xcode, 124 thread_invoke(), 718 Temporary files, 1430 threadMain(), 1246 Tenon Systems, 23 thread_policy_get(), 710 -emulator, 317 thread_policy_set(), 809 Test-and-set, 1211 THREAD_PRECEDENCE_POLICY, 803–805 Tevanian, Avadis, 20, 22 thread_resume(), 465, 708, 759 Text-to-Speech, 121 thread_set_exception_ports(), 710 Textual console, 648 thread_set_special_port(), 710 TFTP (trivial file transfer protocol), 276–278 thread_set_state(), 707, 759 daemon, 276 thread_stack_daemon(), 711 thandler(), 548, 551–552 THREAD_STANDARD_POLICY, 802 Thermal and power management thread_suspend(), 708, 1118 Power Mac G5, 220–222 thread_switch(), 708 Thermal monitoring, 421 thread_switch_continue(), 708 Thermometers, 221–222 thread_terminate(), 708, 759 32-bit comm areas, 594–601 thread_terminate_daemon(), 711 32-bit processor, exception processing, 544–545 THREAD_TIME_CONSTRAINT_POLICY, 805–809 32-bit registers, 222n thread_update_scan(), 801 32-bit system enabler, 267 thread_wakeup(), 453 Thrashing, 837 thread_wire(), 709 Thread(s) Three Rivers Corporation, 17–18 call graph, 789–790 Throughput, 160, 165 creation, x86 computers, 1596–1597 TIFF (Tagged Image File Format), 93 functions, 605 Tiger, 36, 39–41 info UFT, 587–589 Timebase Register (TB), 192, 407, 470, 777, 782 interface functions, 730–732 timeout(), 453 and IPC, 1051 Timer call processing, 788 Mach, 20, 431, 512–514, 705–712 timer_call_interrupt(), 786–788 migration, 717 timer_call_setup(), 775 port, 514 Timeslicing quantum, 775–777 sampling, 616–617 Timing and clocks, 777–782 thread structure, 706–707 Tiny allocations, 957–964 Thread Viewer.app, 130 Tiny block, 958 thread_abort(), 709, 1118 Tiny quanta, 957 thread_bind(), 435 Tiny regions, 957 thread_block(), 718 tlbie, 403 thread_block_reason(), 718 tlbsync, 403 thread_bootstrap(), 407 TLS (), 135 thread_create(), 707, 730, 759 Toll-free bridging, 89n thread_create_running(), 708, 759 Toolbox ROM, 267 thread_dup(), 751 Tools, 129 THREAD_EXTENDED_POLICY, 802–803 CHUD, 130–131 thread_funnel_set(), 1228 debugging and analysis, 129–130 thread_funnel_switch(), 1228 programming, 129–131 thread_get_exception_ports(), 709 Visual Tools, 131 thread_get_special_port(), 710 Towers of Hanoi problem, 303–314 Singh.book Page 1637 Thursday, May 25, 2006 11:46 AM

Index 1637

Trace points, 617–618 Universal access support, 40, 120–121 Tracing, 256–261, 649–659 Universal Binaries, 12n using amber, 257–259 x86-based computers, 1591–1592 Trailer attributes, 1038 and Xcode, 122 Trailer formats, 1038–1039 format, 66–69 Transfer-handshake (TH) packets, 165 UNIVERSAL CD, 1350 Transient attribute, 111 Universal Disk Image Format (UDIF), 1369 Transistors, 167 Universal Graphics Adapter (UGA), 376–377 translate (Rosetta), 1593 UNIVERSAL HD, 1349–1352 Translation lookaside buffer (TLB), 181–182 Universal kernel extension, 1261 trap(), 466, 548, 876 Unix, 33 Trap instruction, 201 exception handler, 466, 1114, 1141 Trap table, 593 shells, 125 Trap vectors, 536 UNIX Traps and exception data, 1119 processes, 684 Trash can, secure empty, 39, 139 system call data structures, 572 Trigger events, 143 and virtual memory, 836 Trivial AppleScript program, 125 unix_syscall(), 557, 568 Trivial executable, 64 Unlinking open files, 1552–1553 TruBlueEnvironment, 33, 114, 591 Unnamed pipes, 1146 Trust policies, security, 135 Unnamed POSIX semaphores, 1160 Two-level namespaces, 71 Unresolved kernel traps, 1121–1122 tws_handle_startup_file(), 816 Unstable write, 916 Untyped data, 1034 Upcall, 856 U upcb, 538 Update daemon, 921 U-area (user structure), 52n, 563, 685, 720 UPL (universal page lists), 840, 912 UDF (Universal Disk Format) file system, 1391 upl_abort(), 912 UFS file system, 1391–1393 upl_commit(), 912 UFS2, 1392 upl_create(), 912 UIDs (user identifiers), 133 Uptime, 699 UISA registers, 188–191 URLMount, 1395 ulocks, 1218 USB plane, I/O Kit, 1252 Ultra-fast traps (UFTs), 554, 587–594 User area (u-area), 52 Blue Box calls, 591–594 User Authentication Method (UAM), 1394 fast traps, 590 User domain, 58 Umbrella frameworks, 84–86 User interface, 117 Unconditional branch, 201, 249 Open Firmware, 299 Underscore, removed, 237n productivity features, 119–120 Underscore character prefix, 545 resolution-independent, 118–119 Unicode filenames, 1533 universal access support, 120–121 Unidirectional links, 162–163 visual effects, 118 Unified buffer cache (UBC), 52, 447, 913–918 User login, multiuser startup, 490–493 routines, 915–916 User logout, 493–495 Uniform Type Identifiers (UTI), 830–833 User memory window, 909 declaration, 832–833 User mode, 531 union mount file system, 1405–1407 User save areas, 538 Uniprocessor patch table, 400 User stack configuration, execve(), 820–824 Singh.book Page 1638 Thursday, May 25, 2006 11:46 AM

1638 Index

User structure, 563 vfs (), 1376–1386 USERACCESS, 1581 functions, 1376–1378 User-level startup, 472 VFS layer, 1376–1386 installation startup, 496–499 journaling, 1541 multiuser startup, 485–495 vfsconf, 1379 single-user startup, 495–496 vfs_event_signal(), 1574 UserPrefix, 1099 vfsinit(), 1384–1385 User space, 530 vfs_mountroot(), 455–456, 461–462 User-space interface, Mach VM, 878–893 vfs_op_init(), 1384 User-space pagers, 854 vfstable, 1379 User-space program, 469–470 VGA, 363, 376–377 User-space security, 134–139 Victim thread, 518, 1115 User-space system call stub, 573–574 Video, 96–100 /usr/bin/ditto, 1557 Video console, 418 /usr/include, 103 Video-rendering pipeline, 98 /usr/lib, 103 vImage, 125, 213 UTF-8, 1533 Virtual address, 181, 644–645 uthread structure, 721, 748 Virtual address space, 529–530, 910–911 U3H system controller, 157–159 Virtual disks, 1371–1374 UUID (universally unique identifier), 334 Virtual file system (VFS), 51 UVM, 23 Virtual I/O Server Partition, 170 ux_handler(), 711 Virtual machine interface, 511 ux_handler_init(), 466 Virtual machine monitor (VMM), 659 control data structures, 659–660 running code in a virtual machine, 662–676 V using the VMM facility, 661–662 Virtual memory, 836 Valid array, 1575 contiguous, 20 Valid ports, 1048 encrypted, 134 Van Horn, Earl C., 683 initialization, 409–415, 877 vBigNum, 125 and IPC initialization, 430 vCards, 38 Mach, 49, 516–518 vclean(), 861, 1400 map, 817 vDSP, 125 map entries, 847–848 VEA registers, 188–191 and memory objects, 516–518 vecdst(), 187 and MMU, 181, 836 vecLib, 213 and Mode32, 267 Vector graphics, 93 object, 847–848 Vector image formats, 93 pages, 847–848 Vector instructions, 199–200 regions, 468 Vector parameters, 239–240 statistics, 130, 527–529 Vector save area, 333 subsystem, 52, 408, 837 Vector streams, 186 system limits, 908–909 -verbose, 1368 and UNIX, 836 Verbose mode, 332, 340, 349, 469 Virtual page number (VPN), 182 Version control systems, 124 Virtual PC, 673 Versioning, 84 Virtual segment ID (VSID), 182 vfork() system call, 756–759 Virtualizer, Classic Startup, 115 Singh.book Page 1639 Thursday, May 25, 2006 11:46 AM

Index 1639

Virtual-to-physical (VP) table, 869 vn_rdwr_64(), 920 Visual effects, 118 vn_read(), 920 Visual tools, 131 vn_read_swapfile(), 921 VLANs (Virtual LANs), 455 VoiceOver, 121 VLIW (very-large instruction-word), 168 Volatile register, 226 vmachmon32 program, 674–676 volfs (volume ID file system), 1407–1409 vm_allocate(), 663, 930–931 VOL_RENAME, 1581 vMathLib, 125 Voltmeters, 222 vm_deallocate(), 856, 931 Volume vm_fault(), 876 extending and shrinking, 1572 vm_fault_init(), 879 formats, 1581 vm_initialized, 408–409 freezing and thawing, 1571 vmmap, 130 Volume (disk partitions), 1348 vm_map(), 856 Volume header, HFS+, 1493–1501 vm_map_copyin(), 931 Volume notifications, 1572 vm_map_copy_overwrite(), 931 Volume Status Database, 1355 vm_map_create(), 817 Volume status database (vsdb), 1355 vm_map_deallocate(), 818 Volume UUIDs, 1355 vm_map_fork(), 878 Volume (Xsan), 150 vm_map_get_upl(), 912 VRSAVE, 216–217, 402 vm_map_init(), 879 vsdbutil, 1355 vm_map_lookup_entry(), 851 vm_map_protect(), 931 vmm_dispatch(), 662 W vm_object_bootstrap(), 879 vm_object_iopl_request(), 912 WaitTime, 1099 vm_object_update(), 860 wakeup(), 1218 vm_object_upl_request(), 912 wakeup_one(), 1218 vm_page structure, 868–869 Walden, David C., 1026 vm_page_bootstrap(), 879 Watcher (fsevents), 1416 vm_page_free_reserve(), 874–875 .wdgt, 78 vm_page_grab(), 872–875 Weakly linked symbols, 72 vm_page_module_init(), 879 Web browser, origins, 12 vm_protect(), 1596 Web Kit, 41 vm_stat, 130 Web plug-in bundle, 80 vn device nodes, 1370–1371 WebDAV, 1397–1399 vndevice interface, BSD, 463 WebObjects, 15, 31, 113 vn_getpath(), 1457 White, Jim E., 1094 Vnode (virtual node), 840, 1376–1386 Widgets, 40, 78, 119 activity monitor, 1453–1469 WIMG, 854 pager, 518, 854, 1002–1009 Window backing-store, 94 structures, 447–448, 1383 Window management (Quartz), 91–92 tag, 1457 Window ports, 515 vnode_authorize(), 814, 1452 Window project, Open Firmware, 324 vnode_pagein(), 859–860 Window Server, 31 vnode_pager_init(), 858 Windows compatibility, 39 vnode_pager_zone, 455 Windows NT, Yellow Box, 30 vnode/vfs layer, 1377 WindowServer application, 92 VNOP_BLOCKMAP(), 1366 wm_ffm, 103 Singh.book Page 1640 Thursday, May 25, 2006 11:46 AM

1640 Index

Words, Forth, 281–288 x86 Mach-O executables, 68 Work Loop Xerox worms, 146 I/O Kit, 1246–1251 XFER, 207 Working Set Model, 942–943 Xgrid, 146 Working Set Principle, 837, 943 architecture, 147–149 Workspaces, Xcode, 122 software, 149–150 Worldwide Developers Conference (WWDC), XML-RPC, 90 28, 31 xnu kernel, 48 Worms, 146 BSD, 50–53 Wrapper, HFS, 1501–1505 compiling, 676–681 Write-after-read (WAR), 196 debugging, 601–658 Write-after-write (WAW), 196 debugging (KDB), 50 Write-back, 179 directories, 502–510 Write-through, 179 drivers, 48 WRT, 207 entering the kernel, 529–543 WRT, GCT, MAP, 207–208 exception processing, 543–553 extensions, 49 I/O kit, 53–54 X kernel extensions, 57 libkern library, 54–55 X Window System, 39, 103 libsa library, 55–56 X Window System and Aqua, 117 Mach, 49–50, 510–519 Xcode, 121–124, 1271–1274 Mach APIs, 519–529 class-modeling tool, 107 Platform Expert, 56–57 command line program, 124 source, 501–510 data-modeling tool, 107 system call categories, 557–601 plug-in, 80 system call processing, 553–557 supported languages, 124 virtual machine monitor (VMM), 659–676 template, 1281–1282, 1311 xnu package, 680–681 x86 computers xnu source, 501–510 ACPI plane, 1598 XOR masks, mouse pointer demo, 317 architecture, 1587–1588 Xsan, 150 boot.efi, 46, 60, 1589 allocation strategies, 152 byte ordering, 1594 client systems, 152 Darwin, 3 command-line utilities, 153 /dev/mem and /dev/kmem, 1597–1598 communication infrastructure, 153 Extensible Firmware Interface (EFI), 362–379, metadata controllers, 152 1589–1590 storage, 150–152 GUID Partition Table (GPT), 1352–1353, Xserve, 145n 1590–1591 XSI IPC, 1155–1156 hwprefs, 1588 kernel address space, 1594–1595 nonexecutable stack, 1595–1596 Y partitioning, 1590–1591 Rosetta, 1591n, 1592–1594 Yellow Box, 28, 29–31 Star Trek, 3 Cocoa, 33 system calls, 1597 Windows NT, 30 thread creation, 1596–1597 YieldToAnyThread(), 772 Universal Binaries, 1591–1592 YieldToThread(), 772 Singh.book Page 1641 Thursday, May 25, 2006 11:46 AM

Index 1641

Z Zone allocator functions, 988–989 Zone map size, 428 zalloc(), 987 Zone of zones, 987 zalloc_async(), 988 Zone page table, 990 zalloc_canblock(), 990–991 zone structure, 986 zalloc_noblock(), 989 zone_bootstrap(), 879 Zero page, 910 zone_change(), 989 Zero-filled memory, 853 zone_gc(), 991 ZeroLink, 123 zone_init(), 879, 990 zfree(), 990, 991 zone_page_init(), 991 zget(), 989 zone_zone, 427 zget_space(), 987 zprint, 986 zinit(), 877, 987–988 zsh shell, 125