index [ptgmedia.pearsoncmg.com]ptgmedia.pearsoncmg.com/.../samplechapter/0321278542_index.pdf · /...

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

Upload: lamque

Post on 19-Jul-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

1599

Index

['], 321\ character, 282, 463: character, 463, 1388, 1533#! character, 826* character, 349, 459/ character, 1156, 1533^ character, 274–275_ character, 237n, 545

AABI (application binary interface), 224–225,

231–232Absolute- and clock-time intervals, 782–784Absolute branching, 201Abstract Windowing Toolkit, 102nAccelerate framework, 213Accelerate.framework, 125Accelerometer data, 1297–1303Accent, 17–18, 837–838

Sapphire, 18Access control entries (ACE), 1441–1445Access control lists (ACL), 40, 51, 134, 1441–1445,

1529and UFS2, 1392

Access Matrix model, 1441–1442Accessibility issues. See Universal access supportaccton command, 134acid, 131acl_set_file(), 1444acpi, 1598

ACPI (Advanced Configuration and Power Inter-face), 1598

ACPI plane, 1598Activation/shuttle, 714–716Active data, 1036Active matching, 1256, 1280Active queue, 871Actual parameters, 231AD (address and data or control information), 165Address Book, and Spotlight, 1440–1441Address translation, 181–183, 404–406Adler checksum, 335Advanced Micro Devices (AMD), 162Advisory-mode file locking, 1230–1232ADVLOCK, 1581AES encryption, 920Affinities, 151–152AFP (Apple Filing Protocol), 60, 1393–1395Agent (daemon), 472, 491Aggregation, Ethernet ports, 455AGP (Accelerated Graphics Port), 157AIFF files, 1398AIM (Apple-IBM-Motorola), 160naio_init(), 449Alarm, 524–526Aleph, 16Aliases, 1554–1556ALLOCATE, 1581Allocation block consumption, 1508Allocation blocks, 1477Allocation file, 1505Allocation strategies (Xsan), 152

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

1600 Index

Allocation zone, 1561–1562AltiVec, 212, 402

-faltivec, 214–215instructions, 218–219970FX AltiVec implementation, 215–218prefetching, 187vector computing, 213–215

Amazon architecture, 168amber, 131, 256–261Amelio, Gil, 6Analysis tools, 1474–1477AND masks, mouse pointer demo, 317Animation, Forth code, 306–312Annotated output, 241AOL Instant Messaging (AIM), 38Apache web server, 31APIs, 116, 726

and ABIs, 224–225and aliases, 1554–1556Authorization Services, 135–138BIOS, 364Bootstrap Server, 1068–1079BSD, 102–103, 502–504C Library, 74–75Carbon, 27, 31–33, 103–107, 1555Carbon File Manager, 1407, 1430, 1516Carbon Multiprocessing Services, 769–771Cocoa, 107–113, 953, 1555comm area, 597Common Security Services Manager (CSSM), 135Core Foundation notification, 1197Core Services, 89–90diagnostics, 358Disk Arbitration subsytem, 1353–1355dyld (dynamic link editor), 933file system, 1387graphics and multimedia, 91–101Java, 113–114launch, 476, 1072Mac OS X file system, 1387Mach, 519–529, 948Mach task, 702–705, 727Mach thread, 707–710, 727Mach VM, 880–893, 948MDQuery, 1431–1434memory, 949, 952, 966notify(3), 1184, 1191plug-in, 81

POSIX, 759, 1407, 1442processor, 693–696processor set, 690–691Pthreads, 759–760, 802Quartz Services, 1293QuickTime, 114security, 135, 1442Spotlight, 120, 1431–1432Uniform Type Identifiers (UTI), 830–833universal page lists (UPLs), 912Unix, 1555–1556WebObjects, 113X Window System, 103

.app, 78AppKit.framework, 107–108Apple Cluster File System (ACFS), 1387Apple Disk Image Controller (hdix), 463Apple EFI Runtime kernel extension, 1589–1590Apple Events (AE), 101, 1172–1181Apple Expo, 34Apple Filing Protocol (AFP), 60, 1393–1395Apple Motion Sensor. See Sudden Motion Sensor

(SMS)Apple partitioning scheme, 1348–1352Apple Public Source License (APSL), 47Apple RAID header, 344–346Apple Remote Desktop

and Security Agent, 136nApple Search Kit, 1412Apple Session Protocol (ASP), 1394Apple System Logger (ASL), 1077, 1325Apple Type Services (ATS), 101appleCLUT8, 437AppleDouble format, 1557AppleFileServer.app, 60AppleRAID, 344, 345, 1362AppleScript, 106, 115, 125–126, 1173–1175AppleShare, 1393AppleTalk, 27AppleWorks, 37Application bundle, 76–78

and AppleScripts, 1175Classic Startup.app, 114and UTIs, 832See also Bundles

Application environments, 101–117BSD, 102–103Carbon, 103–107

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

Index 1601

Classic, 114–116Cocoa, 107–113Java, 113–114QuickTime, 114Rosetta, 116–117WebObjects, 113X Window System, 103

Application scaling mode, 118Application Services, 106

Core Audio, 100Core Image and Core Video, 96–99OpenGL, 96Quartz, 91–95QuickDraw 2D, 95–96QuickTime, 99–100subframeworks, 101

Application-defined signals, 1132Aqua user interface, 33–34, 37, 45, 117Arbitration, 164nArchitecture

Core Image, 97EFI, 368graphics, 91Mach VM, 850Power Mac G5, 158, 164PowerPC 970FX, 188, 222–224QuickTime, 99runtime, 61–74security, 133–135Spotlight, 1410–1415system, 164x86-based Mac computers, 1587–1588Xgrid, 147–149Xsan, 151

Argument mungingBSD system calls, 563–566

Argument typesFsevents, 1418

Argument (use of term), 231as (GNU-based assembler), 62ASCII PPM (portable pixmap), 322ASSERT(), 579assert(), 579Associativity, 179Asterisk character, 349, 459Asymmetric copy-on-write, 864Asynchronous I/O

signals, 1132subsystem, 449

Asynchronous system trap (AST), 465, 532ATAPI (ATA Packet Interface), 298Atlas supervisor, 835–836Atomic compare-and-store function, 244–246Atomic operations, 1212–1213attach(), 442, 1281Attributes file, B-Tree, 1524–1530ATTRLIST, 1581Audio, 100audit, 143Audit control port, 620–621Audit daemon, 620Audit logging, 449, 620–623Audit macros, 623–624Audit token, 1038Audit trail, 143auditd, 143, 449, 620Audit-event-to-event-class mapping, 449Auditing support, 619–625Auditing system, 134

audit control file, 144–145components, 143

audit_init(), 449, 619audit_worker(), 711AULab.app, 100Authorization services, 135–138Automator, 40, 126Automator action, 78

Bbackground-color, 302Backing storage, 853nBacking store, 837, 853Backslash character, 282, 463Backtrace print mechanism, 419Backup port, 1069Balance strategy (Xsan), 152Balanced coding method (BCM), 165Base set, Forth words, 282bash shell, 125Basic Security Module (BSM), 134, 449BAT registers, 183–185, 405bclean_buf_thread(), 712BeFS, 8Behavior values (Mach VM), 889–890BeOS, 7–9Berkeley FFS (Fast File System), 462, 1391

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

1602 Index

Berkeley Packet Filter (BPF), 454Berners-Lee, Timothy John, 12BezelUI directory, 60BFS compared with Spotlight, 1415Bidirectional pipes, 1146Big real mode, 363Big-endian, 225–226BigTop.app, 130Binary format, 378Binding styles, 71Bindings Controller, 112BIOS (basic input/output system), 264

limitations, 362–364BIOS Data Area (BDA), 367BLAS, 125bless, 1589bless(8), 270–271Block address translation (BAT), 183–185, 405Block device, 1349Block transfer (BLT), 377nBlockAllocate(), 1572BlockDeallocate(), 1572Blocking thread, 718–720Blue Box, 28, 29, 33, 538, 591–594

system calls, 554trap value, 594

Blue project, 2Blue thread, 591Bluetooth, 38, 60BMP (Windows Bitmap), 93Bonjour, 39nBoot behavior, 355–356Boot chooser, 329Boot devices, 326, 367Boot Integrity Services (BIS), 363–364Boot manager, 370–371Boot modes, 339–340Boot ROM, 46, 268

PowerPC, 269–271Boot sequence, 324–328Boot Server Discovery Protocol, 347Boot services, EFI, 366–367Bootable (blessed) volume, 1589BootCache history list, 353–354BootCache optimization, 353–354BootCache play list, 353–354BootCacheControl, 354BootCache.kext, 1282

BootCacheOverride, 358BootCLUT, 435–437boot-device, 326boot.efi, 46, 60, 371, 1499, 1589bootinfo file, 270, 329bootinfo format, 328–329Booting, 263, 419–422

an alternate kernel, 341–343over a network, 346–349from a software RAID, 344–346

Bootloader, 46, 60bootinfo file, 270, 329choosing an alternate, 1589See also boot.efi; BootX

BOOTP, 463bootp(), 463Boot-screen information, 643–644Bootstrap context, 1065–1066Bootstrap Server, 1065–1079bootstrap_check_in(), 1069bootstrap_create_server(), 1068bootstrap_info(), 1072–1074bootstrap_parent(), 1071bootstrap_status(), 1070bootstrap_subset(), 1071Boot-time daemons, other than launchd, 498Boot-time kernel arguments, 355–361Boot-time snag keys, 327–328boot-uuid, 334BootX, 46, 60

and AppleRaid, 344BootCLUT, 435–437bootinfo, 328–330cache data, 338and Client IP, 348–349ELF support, 330kernel launch, 388logical memory map, 333operation, 331–340signature, 338structure, 330third-party bootloader, 328nand volume header, 1499

Branch history tables, 211–212Branch instructions, 201, 247–256Branch prediction, 201, 211–212Branch reachability, 248Breakpoint trap, 405

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

Index 1603

brk(), 949Brunner, John, 146BSD, 50–53

application environment, 44–45, 102–103condition variables, 1218hardware clock, 466proc structure, 747system call return values, 571system calls, 554unified buffer cache (UBC), 52uthread structure, 721, 748vndevice interface, 463vnode disk driver, 1370–1371

bsd/ directory, 502–504BSD initialization, 443–447

data structures, 445–451file system, 447–448mounting the root file, 455–464networking subsystem, 450–453shared memory regions, 466–468

BSD processes, 746–748fork() system call, 748–756vfork() system call, 756–759

BSD system calls, 557–576argument munging, 563–566data structures, 558–563kernel processing, 566–572user processing, 572–576

bsd_ast(), 465bsd_bufferinit(), 446bsd_hardclock(), 466, 787bsd_init(), 445–449bsdinit_task(), 1141bsdmake, 124bsd_utaskbootstrap(), 465B-Tree-based catalog file, 1388B-Trees, 1481, 1488bufqscan_thread(), 712Bundles and frameworks, 76

bundle structure, 83bundle types, 78–80frameworks, 82–86iTunes application bundle, 77load commands, 87OS X standard frameworks, 85–86prebinding, 86–89printing libraries, 88property list files, 81–82

BUPOR (bring-up power-on reset), 393Bus drivers, 368–369Bus interface unit, 165Bus master, 161Bus speed, 159–162Bus standards, 160–162Bush, Vannevar, 1410Byte ordering, 225–226, 1594

CC++, 53, 1237C library, 74–76Cache(s)

associativity, 179coherency, 180direct-mapped, 179lines, 175management, 403–404MERSI, 180970FX, 176–178RAS, 180set-associative, 179store policy, 179store-through, 403n

Cacheability, 858CacheBasher.app, 130cacheInit(), 403CAD (command, address, data), 163Callback-related functions

CHUD support, 606–611Callbacks, 134, 484–485Call-by-name, 231Call-by-reference, 231Call-by-value, 231Callee-save register, 226Caller-save register, 226CAM (content-addressable memory), 224Canon, 10Capabilites array, 1575Carbon, 103–107

APIs, 27, 31, 33, 105–107CFM binaries, 104compared with Cocoa, 106–107

Carbon Event Manager, 106Carbon File Manager, 1407, 1430, 1516Carbon Managers, 90

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

1604 Index

Carbon Multiprocessing Services, 769–771Carbon Process Manager, 767–769Carbon Thread Manager, 772–774Carbon.framework (Mac OS X), 103CarbonLib (Mac OS 9), 103CarbonSound, 105CardBus, 162Caret character, 274–275Carnegie Mellon University (CMU), 17Case sensitivity

HFS+, 1473, 1531–1532HFSX, 39UFS, 1392

Cast-conversion, 89Catalog, I/O Kit, 1253Catalog B-Tree, 1566Catalog B-Tree header node, 1518Catalog file, HFS+, 1510–1519Catalog node (cnode), 1569Catalog node IDs, 1513catch_exception_raise(), 1117catch_exception_raise_identity(), 1117catch_exception_raise_state_identity(),

1117CCacheServer.app, 60cddafs (Compact Disc Digital Audio file system),

1398–1400CD/DVD, 127, 1388–1389CDIS/Installation Log.app, 496CDIS/instlogd, 496CDIS/LCA.app, 496CDIS/preheat.sh, 496CDSA, 134

plug-ins, 135Cells, Forth, 279cerror(), 572, 751CFBundle, 78CFDictionaryAddValue(), 1359CFM (Code Fragment Manager), 103, 104, 115CFMachPort, 1203CFMessagePort, 1203–1205CFRunLoopTimer, 1209CFSocket, 1206–1208CGDisplayBaseAddress(), 1293Change logger

Fsevents, 1422–1428Character device, 1349checkForWork(), 1246

chkfac(), 548chmod(), 1444chmodx_np(), 1445Choke handlerr, 553chosen properties, 334–335chroot(), 929CHUD, 130, 604

callback-related functions, 606–611CPU-related functions, 605–606kdebug_chudhook(), 625memory-related functions, 605task-related functions, 605thread-related functions, 605

CHUD toolsacid, 131amber, 131BigTop.app, 130CacheBasher.app, 130hwprefs, 1587–1588MONster.app, 131PMC Index.app, 131Reggie SE.app, 131Saturn.app, 131Shark.app, 131, 1338simg4, 131simg5, 131Skidmarks GT.app, 131SpindownHD.app, 131

CHUDCall, 586CIContext, 97CIFilter, 97CIFS (Common Internet File System), 1397CIImage, 97CIKernel, 98CISampler, 98Class hierarchy, I/O Kit, 1239–1240Class matching, 1256Classes, I/O Kit, 1243–1246Classic, 114–116

environment, 29sharing of OS X resources, 115

Classic Startup.app, 60, 114Classic.app, 29nClass-modeling tool, Xcode, 107Cleartext storage, 1320Client interface, Open Firmware, 299Client IP, and BootX, 348–349Client systems, Xsan, 152

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

Index 1605

Clock frequencies, 220Clock implementation, 320–321Clock services, 522–524Clock speeds, 163clock_config(), 430, 780Clock-cycle-per-instruction (CPI), 168clock_init(), 431Clock-time intervals, 782–784cloneproc(), 465, 751clone_system_shared_regions(), 929closeGate(), 1246Close-on-exec flag, 824Clumps, HFS+, 1481cluster_io(), 1364–1366CMOS (Complementary Metal Oxide Semiconduc-

tor), 157CMU Mach 2.0, 10cngetc(), 469CNID (catalog node ID), 1510, 1551

assignments, 1515converting to a Unix pathname, 1515and exchangedata(), 1570

cnode, 1569cnputc(), 469Cocoa, 107

and Carbon, 33compared with Carbon, 106–107Core Data, 108–113malloc zones, 953and NeXT, 107nib files (NeXT Interface Builder), 108NSTask, 763–764NSThread, 764–766Yellow Box, 33

Coherency point, 180Colon character, 463, 1388Color lookup table (CLUT), 302, 437Colors, 302–303ColorSync, 5, 101commandGateHandler(), 1248Command-line editing, 275Command-line support, 126–129Command-line tools, 141Common Criteria Tools package, 143nCommon Object File Format, 378Common Security Services Manager (CSSM) API,

135CommonPanels, 105

CommonPoint, 4commpage area, 434, 554, 594–601, 922–924com.osxbook.dummyd.plist configuration file,

483–484Compare-and-store function, 245–246, 1211Compare-and-swap function, 1211Compatibility Support Module (CSM), 367Compilers

GNU C, 124and libraries, 124–125version dependency, 677

Compiling dynamic and static libraries, 69–70Compiling the kernel, 676–681complete(), 1258Complex Instruction-Set Computer (CISC), 157Complex message, 1034Composite value, 240Compositing, 93–94Compressed kernel, 337Computation value, 805Computer Hardware Understanding Development.

See CHUD; CHUD toolsCondition Register (CR), 392Conditional branch, 201config/, 502Configuration agents, 142Configurations, 111Console initialization, 416–419Console I/O, Forth words, 286Console operations table, 418Constraint value, 805Constructors, 440Context, 542Context communications area, 660Context switching, 774Context-altering instruction, 537Context-synchronizing, 537Contiguous allocation, 996–997, 1259Continuation functions, 22, 431, 717–726Control events, 143Control flow, Forth words, 286–287Control key character, 274–275Control transfer

external hardware interrupts, 532processor traps, 532software traps, 532system calls, 533

Control-flow instructions, 200–201

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

1606 Index

Conventional PCI, 161Conversion factor, thread processor usage, 796–799Cooked devices, 1349Cooperative multitasking, 771Copland, 5–7Copy and paste, 115Copy objects, 864Copy strategy, 858COPYFILE, 1581copyfile(), 1557, 1582copyin(), 908, 909Copy-on-write, 17, 20, 516, 862–864copyout(), 908, 909CopyProcessName(), 767copypv(), 909Core Audio, 100Core Data, 40, 108–113Core file, 63Core Foundation, 89, 106

data types, 81dictionary, 1294distributed notifications, 1198–1199

Core Foundation IPC, 1197–1210notifications, 1197run loop, 1201–1210

Core Graphics, 101Core Image, 40

plug-in architecture, 97Core Image and Core Video, 96–99Core Services, 89, 106

directory, 60Core Video, 40Cox, Brad, 11cpu uptime, 699cpu_doshutdown(), 551cpu_type(), 467–468Cracked instructions, 206Crash Reporter daemon, 497, 1323Crash Reporter.app, 60–61Crash reports, 61Crash-resistant server example, 1074–1076create_unix_stack(), 820cron daemon, 475–476curctx, 538current_act(), 716current_thread(), 716Cursor pmap, 866CutTrace(), 657

CutTrace low-level tracing, 655–658Cyberdog, 24Cycle-accurate core simulator, 970FX, 256–261Cylinder-Head-Sector (CHS) addressing model,

1346

DD0, 206D1, D2, D3, 206–207DACopyDiskDescription(), 1355–1357DADisk functions, 1353–1355Daemon

agent, 472audit, 620cron, 475–476group membership resolution, 1451launchd, 472–485on-demand launching, 473SSH, 474–475and SystemStarter, 498update, 921

DART (Device Address Resolution Table), 157, 1257–1259

Darwin, 3, 46benefits, 47–48notify center, 1197packages, 47, 676as subset of OS X, 4832-bit ABI runtime stack, 232xnu package, 381

Darwin kernel. See xnu kernelDarwinBuild, 681Dashboard, 39–40, 119–120Dashboard Widgets, 40, 78, 119Data, Open Firmware, 297–298Data caching, disabling, 914Data fork, 1557, 1567Data link interface layer (DLIL), 153

initializing, 450Data manager (memory manager), 851Data partition, 1350Data stream manipulation instructions, 219Data structure(s)

BSD initialization, 445–451BSD system calls, 558–563EFI, 1589–1590

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

Index 1607

file descriptors, 1148, 1374global profile cache, 944HFS+, 1477–1482and hfsdebug, 1474IPC-related, 1042, 1048kauth, 1450kmod_info, 1264kqueue, 1192locking, 407, 449–451, 1214, 1218low-memory global, 650–655Mach, 687, 714–716, 791, 1333Mach locks, 421, 1213–1215, 1218Mach port, 1044–1045, 1054Mach trap table, 579Mach VM, 849–855, 865–866, 896Mach zone allocator, 985–992memory, 410and mutexes, 1224Open Firmware, 289–298pageable memory, 995–997panic-related, 1322patch tables, 398–400per-processor, 390, 652, 778and physical memory, 410pipe, 449private, 428pthread, 751resource allocation, 356scalable zone, 955–966scheduler, 408, 774, 791serialized, 441shared region mapping, 434, 466–468shuttle and thread, 715UNIX system call, 572UPL (universal page lists), 840virtual machine monitor (VMM), 538, 659–660vnode, 448, 455, 1374, 1383

Data-cache-block-touch instruction, 186–187Data-modeling tool

Xcode, 107dd, 841–843, 1350DDR (Double Data Rate), 157Dead names, 1029, 1084–1086Dead port, 1048Dead-Code Stripping, 123deadfs, 1400–1401-debug, 1368debug kernel argument, 360–361

Debugger(s) and debuggingand annotated code, 241auditing support, 619–625bundle, 78Forth programs, 288–289kernel arguments, 358–361kernel event tracing (kdebug), 625–638kernel panics, 1322–1324logging, 1325–1328Mach VM interfaces, 896memory, 976per-process kernel tracing, 617–619remote, 122, 602–603remote core dumps, 1324–1325and signals, 1144stabs, 1338–1344tools, 129–130tracing, 649–659xnu kernel, 50See also GDB (GNU debugger); KDB (Kernel

Debugger); KDP (Kernel Debugging Protocol)

debugger_lock, 419Decrementer Register (DEC), 777Dedicated register, 226Dedicated threads, 710.def extension, 578Default environment (system and fs_root), 467–468Default init program, 469Default pager, 517–518, 853Default processor set, 689deferctx, 538Deflate compression, 367–368Defragmentation, HFS+, 1558–1561Delayed detachment, 450Demand paging, 836Denning, Peter J., 837Dennis, Jack B., 683Denormal numbers, 219nDesktop (Finder), 34Destructors, 440detach(), 1281Detached pthreads, 751Detaching a disk, 1368, 1370Detachment of protocols, 450Developer previews, 31–34Developer’s Interface Guide (DIG64), 365devfs (device file system), 1401

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

1608 Index

Device Driver Kext, 1280–1288Device driver(s), 369, 1233–1235

Boot ROM (PowerPC), 270matching, 1255–1257

Device interface, Open Firmware, 300Device Interface I/O Kit, 1269–1271Device node naming, 1367Device pager, 518, 854Device special files, 1235Device tree, 289

data, 297–298devalias, 291methods, 296–297properties, 292–296

Device Tree plane, I/O Kit, 1252device_pager_bootstrap(), 879/dev/kmem, 841–843, 1597–1598/dev/mem, 1597–1598dgBootScreen(), 643dgLRA(), 644dgpcpy(), 645–646, 650DHCP, 463dhcpol_parse_packet(), 463diag, 638diagCall(), 641diagCommon.h, 642Diagnostic features, 639Diagnostics system calls, 642–644

interface, 641–649Dictionary, Forth, 282–288Digital imaging, 38Direct function calls, 230Direct memory access (DMA), 94, 157Direct-mapped cache, 179Directory services, and security, 140–141Dirty pages, 872DiscRecording.framework, 127Disk and partitions, listing, 1348Disk arbitration, 1353–1361, 1497Disk Arbitration subsytem API, 1353–1355Disk image, 1320

BSD vnode disk driver, 1370–1371hdiutil, 1367–1369RAM disks, 1370virtual disks, 1366–1374

Disk Images framework, 1574Disk mounting dissenter object, 1357Disk object, 1354Disk supersets, 1362

Disk Utility, and security, 139Disk (Xsan), 150diskarbitrationd, 1353DiskImages.framework, 127diskimages-helper, 1368Diskless booting, 347Disks and partitions, 1345–1349

Apple partitioning scheme, 1348–1352GUID-based partitioning, 1352PC-style partitioning, 1352

diskutil command, 1349, 1352, 1353Dispatch group, 207Display PostScript, 10Dissenter object, 1357distcc, 122Distributed builds, 122Distributed notification center, 1197Distributed Objects, 1164–1172ditto, 1557dkstrategy(), 1365–1366dladdr(), 75n, 236dlil_call_delayed_detach_thread(), 712dlil_input_thread(), 711dlopen(), 75DLPAR (Dynamic LPAR), 169–170DMA Address Relocation Table, 157Dock, 33Domain initialization, 451–452domaininit(), 451doServiceMatch(), 1255Double-precision floating-point values, 240Drag and drop, 11, 115Draw protocol, 377Drawing images, 322–323Drawing rectangles, 303, 314–317Driver(s)

EFI, 367–369I/O Kit, 1242matching, 1255–1257methods, 1287partitions, OS 9, 1350personalities, 1255, 1281–1283xnu kernel, 48

Driver side (data transmission), 165drutil, 127dscl command, 141DSN, 17DSP, 207DSP, WRT, GCT, MAP, 207–208

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

Index 1609

dssall, 403Dual-processor architecture, 158Dual-processor bus, 164dummyd (trivial echo server), 479–482DummyDriver I/O Kit driver, 1284–1286DummySysctl kernel extension, 1273DVD player, 38dyld (dynamic link editor), 62

environment variables, 933interposing, 73–74loading a non-split-segment file, 934loading a split-segment file, 935Mac OS X 10.4, 932–933

.dylib, 63Dynamic branch prediction, 212Dynamic computation modes, 222Dynamic libraries, compiling, 69Dynamic linker, 64, 817–818, 932–935Dynamic linking, 67

binding styles, 71dyld interposing, 73–74two-level namespaces, 71weakly linked symbols, 72ZeroLink, 123

Dynamic pager program, 918–921Dynamic shared library, compiling, 69–71Dynamically allocated memory, 887dynamic_pager, 517–518, 918

EEEPROM, 269Effective address (EA), 181EFI (Extensible Firmware Interface), 46, 362

architecture, 368benefits, 378–379binary format, 378boot manager, 370–371boot services, 366–367driver types, 368–369drivers, 367–369GUID partition table, 374and preboot software, 364protocol, 369runtime services, 367services, 366–367shell, 370–374, 372–374Universal Graphics Adapter (UGA), 376–377

EFI Byte Code (EBC), 367, 377–378EFI Byte Code (EBC) Virtual Machine, 377–378EFI NVRAM, 369–370, 1589–1590EFI Runtime kernel extension, 1589–1590EFI System Partition (ESP), 376EFI System Table, 1590eieio, 1212EINVAL error, 759eip register, 65Elastic I/O interconnect, 164–166ELF support, 330Embedded C++, 1237

and I/O Kit, 1237–1238EMM external memory management, 517Emulation registers, 197Emulators, 278enable_bluebox(), 591Encoding names, 1532–1534Encrypted storage, 1321Encrypted virtual memory, 134, 139Encrypted volumes, 1310–1321Encryption, swap files, 920Encryption keys, 135Entities, 111Entity inheritance, 111Entity-relationship (ER) diagram, 111Entropy collection, 637–638Epilogue, 233EPS (Encapsulated PostScript), 93ERATs, 183errno, 751Error correction code (ECC), 159Error-correcting code, 180nescc (serial port), 417nescc-legacy (serial port), 417n/etc/rc, 486–487ether_family_init(), 454–455Ethernet connections, 276–278Ethernet interface family, 454–455Ethernet interface MAC address, 1309–1310Ethernet port aggregation, 455Event tracing (kdebug), 625–638Exception(s), 201, 518

counters, 654–655and exception vectors, 383–385filtering, 546–547Mach, 1112–1129ports, 515, 1049, 1112PowerPC, 383–385

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

1610 Index

Exception(s), (continued)processing, 543–553save areas, 539–542vectors, 535, 536

Exception-handling chain, 1118Exception-handling registers, 536–537Exception-handling routine, 385exception_triage(), 1120EXCHANGEDATA, 1581exchangedata(), 1570, 1582exec(), 116, 684exec_copyout_strings(), 822exec_handle_sugid(), 819exec_mach_imgact(), 757, 815, 819, 822, 824exec_shell_imgact(), 827execsigs(), 824Execution environments, 686–687execve(), 469, 757execve() system call, 62, 812–827

Task Working Set (TWS), 947Existence map, 921exit(), 572Exposé, 39, 119Extended file system (HFS Plus), 25Extended memory addresses, 363Extended partitions, 363, 1352EXTENDED_SECURITY, 1581Extending a volume, 1572Extensible Firmware Interface. See EFIExtensions, 59Extent descriptor data structure, 1480Extents, 1480Extents overflow file, 1519–1524eXternal booter, 344External hardware interrupts, 532External memory management, 427nExternal memory manager, 854

Ffacctx, 538Facility Status UFT, 589–590Factorials, 241–244Families, I/O Kit, 1239–1241Family Superclasses, 1239–1240Fan control unit (FCU), 221, 1308Fans (temperature management), 220–222

Fast IPC space, 1044Fast Logout and Autosave, 40Fast Path, 171Fast traps, 590Fast user switching, 39, 119Fastpath call, 554Fastpath system calls, 590Fat binaries, 12n, 66–68Fat Darwin kernel, 66Fat (Universal) binaries, 825Fax capability, 39fcntl(), 1231, 1430FCode, 273fd (file descriptor), 1374–1375fdesc file system, 1402fdexec(), 824fdisk, 1352Feldman, Jerry, 16F_FULLFSYNC, 1539–1540Fibre Channel Mutipathing, 153Fictitious extensions (aka pseudo-extensions), 441Fifo file system, 1147FIFO with Second Chance, 871fifofs (named pipes), 1403Fifos, 1147File descriptor passing, 1148–1155File descriptors, 1374–1375File forks, HFS+, 1480File format, BootX, 328–330File sharing, 1395File system APIs, Mac OS X, 1387File system initialization, 447–448File system interfaces, 1581File system types, 1386–1409

AFP (Apple Filing Protocol), 1393–1395cddafs, 1398–1400deadfs, 1400–1401devfs, 1401fdesc, 1402fifofs, 1403FTP, 1395–1396HFS Plus and HFS, 1388ISO 9660, 1388–1389MS-DOS, 1390NFS, 1396–1397NTFS, 1391SMB/CIFS, 1397specfs, 1403

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

Index 1611

synthfs, 1404UDF (Universal Disk Format), 1391UFS, 1391–1393union, 1405–1407volfs, 1407–1409WebDAV, 1397–1399

File system user-space view, 57–61File systems

access control lists (ACL), 1441–1445disk arbitration, 1353–1361disk devices, 1362–1366disk images, 1366–1367disks and partitions, 1345–1349file system types, 1386–1409files and file descriptors, 1374–1375kauth authorization subsystem, 1445–1469Spotlight, 1409–1441VFS layer, 1376–1386

Files and file descriptors, 1374–1375filesec_init(), 1445Filesystems, 60filetype, 63FileVault, 39, 139Fill strategy (Xsan), 152FindByContent, 101Finder (Desktop), 34finderInfo array, 1498Finding files, mdfind, 128Fine-grained kernel event tracing (kdebug), 625–638

kdebug entropy collection, 637–638kdebug tracing, 625–637

FireWire plane, I/O Kit, 1252Firewire target disk mode, 328FireWire-based debugging, 601–603Firmware, 46, 263–271

boot sequence, 324–328BootCache optimization, 353–354booting an alternate kernel, 341–343booting from a software RAID device, 344–346booting over a network, 346–349boot-time kernel arguments, 355–361BootX, 328–340call interface, 640–641device tree, 289–298Extensible Firmware Interface (EFI), 362–379firmware boot sequence, 324–328Forth programming language, 279–289launching the kernel, 352–353

Open Firmware, 272–278Open Firmware interfaces, 298–300Open Firmware programming, 300–324power-on reset (POR), 271–272power-on self-test (POST), 264security, 349–352variables, 1294–1296

FirmwareCall(), 640–641Fix and Continue, 123fixBufferUserRead(), 1313–1315fixBufferUserWrite(), 1313–1318Fixed-point instructions, 198FixupResourceForks, 1557Flash invalidation, L1 D-cache, 403Floating-point initialization value, 401Floating-point instructions, 199Floating-point parameters, 239–240Floating-point register (FPR), 401Floating-point-estimate instructions, 199FLOCK, 1581flock(), 1231Focus-follows-mouse, 103Font demo, 318–320Fonts, 115, 317–320foreground-color, 302fork(), 52, 116, 748–756

early UNIX, 684and Mach ports, 755

fork1(), 751–753forkproc(), 751–753Formal parameters, 231Forth code, 279

for animation, 306–312cells, 279for core logic, 312debugging, 288–289dictionary, 282–288shell, 274–275stacks, 279words, 281–282

Foundation notifications, 1181Foundation.framework, 107–1084.2BSD, 11314.3BSD, 10, 19, 11314.4BSD, 153Fragile base-class, 55Fragment, 104, 1479Fragmentation, 1519, 1520

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

1612 Index

Fragmented files, 1558–1562Framebuffer, 1288–1292Framebuffer memory, 1293Framework scaling mode, 118Frameworks, 4–5, 59–60

OS X standard, 85private, 84–85System.framework, 87–88See also Bundles and frameworks

free(), 1280Free list (save area), 414, 540Free pool (save area), 414Free queue, 871Free Software Foundation (FSF), 47nFree space, 1507Free space partition, 1350FreeBSD

NFS, 1396UFS2, 1392virtual memory, 21

Freezing a volume, 1571Fsevents, 51

argument types, 1418change logger, 1422–1428event generation, 1421implementation, 1419supported event types, 1416

fs_usage, 129FTP file system, 1395–1396function(), 247Function calls, 228–230

stack trace, 237–238Function rerouting, 246

constructing branch instructions, 247–256instruction patching, 247

Function (use of term), 231function_new(), 247function_stub(), 248funnel_alloc(), 445Funnels, 52, 1223–1229

Gg++, 62Gassée, Jean-Louis, 7–9GB (metric definition), 1347gcc, 62

GCC 4.0.0, 66nGCT (global competition table), 207–208GD, 207GD, DSP, WRT, GCT, MAP, 207–208GDB (GNU debugger), 50n, 60

FPR, 401script, crash reports, 61and stabs, 1338using for debugging, 1328–1331Xcode, 122, 601–603

General I/O Kit Classes, 1239–1240General OS Classes, 1239–1240Gershwin, 6–7getattrlist(), 1570, 1575–1582getchar(), 469get-colors, 302getcontext(), 1138getdirentriesattr(), 1571getfwpath, 341get_ip_parameters(), 463getmntinfo(), 1348ngetOrientationUC(), 1299–1302getpid(), 575GetProcessForPID(), 767gettimeofday(), 594get_user_regs(), 466getWorkLoop(), 1246Giant mutex, 52nGiB (definition), 1347GIDs (group identifiers), 133GIF (Graphics Interchange Format), 93Gigabyte (definitions), 1347Giuse, Dario, 20Global data structure, 1374Global history vector, 211Global profile cache, 944Global variables, GUID, 369–370Global volume lock, 1571Globe data, 336GNU assembler, 193GNU C compiler, 124, 1338GNU debugger. See GDB (GNU debugger)GNU-Darwin, 35gnumake, 124GPR0, 537gprof, 612–617gpt, 376, 1352–1353, 1373GPT-partitioned disk, 374–376

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

Index 1613

GPU (graphics processing unit), 94grade_binary(), 816Graphics adapter, 376–377Graphics Address Remapping Table (GART), 157Graphics and multimedia APIs, 91–101Graphics and multimedia architecture, 91Group membership resolution daemon, 1451GUID, 369–370, 1373GUID Partition Table (GPT), 374, 1352–1353

x86-based Macintosh computers, 1590–1591

HHamming code, 180–181Handler thread, 518, 1115Handlers, 201, 750Handoff scheduling, 708, 791, 1058Hangup signal (HUP), 489Hard disk, 1345nHard limits, 685Hard links, 1547–1551Hard reset exception, 271Hardware abstraction layer (HAL), 5, 7, 44–45, 1236Hardware exception counters, 654–655Hardware interrupt offset register (HIOR), 271Hardware interrupts, 549–551Hardware streams, 186Hardware-Implementation-Dependent (HID) regis-

ters, 194Harvard Architecture, 178Hash tables, 411–413, 869hdiutil, 127, 1320, 1367–1369

sparse disk images, 1575hdix (Disk Image Controller), 463Header bitmap, 957heap, 129Heat sensors, 221–222, 1305–1308Help (Carbon subframework), 105hertz_tick(), 780, 785, 787HFS, 462, 1386HFS+, 462, 1386

aliases, 1554–1556allocation blocks, 1477allocation file, 1505–1509analysis tools, 1474–1477attributes file, 1524–1530B-Trees, 1481–1491

case sensitivity, 1531–1532catalog file, 1510–1519clumps, 1481comparisons, 1575–1582extents, 1480extents overflow file, 1519–1524file forks, 1480filename encodings, 1532–1534freezing and thawing a volume, 1571hard links, 1547–1551HFS wrapper, 1501–1505journaling, 1538–1546metadata zone layout, 1562and NTFS comparison, 1583optimizations, 1558–1570permissions, 1534–1538quotas, 1546–1547reserved areas, 1493resizing a volume, 1572resource forks, 1556–1558sparse disk images, 1574–1575special files, 1492, 1505–1530special system calls, 1570–1571startup file, 1530symbolic links, 1553–1554Technical Note TN1150, 1477unlinking open files, 1552–1553volume header, 1493–1501volume notifications, 1572volume structure, 1491–1493volumes, 1515

hfsdebug, 1474–1475, 1558–1560, 1565hfs_extendfs(), 1572hfs_generate_volume_notifications(),

1574hfs_hotfilesync(), 1567hfs_recording_init(), 1566hfs_recording_start(), 1568hfs_relocate(), 1558hfs_truncatefs(), 1572HFSX, 39HID (hardware-implementation-dependent), 403HID (human interface device), 1241High-level architecture, 45High-level processor initialization, 405–421

after virtual memory, 415–421low-level VM initialization, 409–415before virtual memory, 407–409

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

1614 Index

High-level VM subsystem, 423–428High-water mark, 918HIServices, 101History list, BootCache, 353–354Hit rate, caching, 353–354HIToolbox, 106HIView, 106Host information, Mach, 519–522Host ports, 1050Host statistics, Mach APIs, 526–529host_get_boot_info(), 520host_info(), 519–520host_kernel_version(), 520host_notify_init(), 1060host_page_size(), 520host_processors(), 693, 1050host_processor_set_priv(), 690host_processor_sets(), 690host_request_notification(), 1060host_statistics(), 526–529, 892host_zone_info(), 985Hot File area, 1562Hot File Clustering (HFC), 1562–1564, 1566–1570Hot File thread, 1565Hot Files B-Tree, 1565–1566hotfiles_adopt(), 1570hotfiles_evict(), 1570–1571HotSpot Java Virtual Machine (JVM), 113Howarth, David J., 835–836HPC (high-performance computing) applications, 183HTML rendering, 106Huge allocations, 966Human-interface services, 101Hupp, Jon A., 146hwprefs, 178, 1587Hybrid drivers, 369HyperTransport (HT), 157–164HyperTransport Technology Consortium, 162

IIA-64 architecture, 365IA-32 computers, and EFI, 367IA-32 real mode, 362IBM

Jikes (Java compiler), 113nS/390 G5, 157Taligent, 4–5

iCal, Spotlight search results, 1440–1441iChat, 38–40.icns, 118Icon Browser application, 118Icon Composer, 118Icon status indication, 119IDE (integrated device electronics), 298iDisk, 38Idle kernel thread, 432–435idle_thread(), 711IEEE, 273IEEE 802 address, 375Ignore reset, 394ihandler(), 549–550Illegal instructions, 257, 1595iMac, 3Image activator table, 815Image formats, 93Image processing, 98ImageCapture, 106iMovie 2, 37Inactive queue, 871Indirect function calls, 228–229Indirect system call, 558Info.plist, 81, 84Information Access Toolkit (V-Twin), 90Information property list, 81Infrastructure initialization, 775–789Inheritance, entity, 111Inheritance, memory, 884init(), 1280init_domain(), 451Initialization

BSD, 443–469console, 416–419custom routine, 70–71data link interface layer (DLIL), 450domain and protocol, 451–452file system, 447–448high-level processor, 405–421high-level vm subsystem, 423–428infrastructure, 775–789I/O Kit, 435–443, 1253–1255IPC, 430kprintf(), 416–417Mach subsystem, 421–432networking subsystem, 450–453page frames, 425–426Pmap, 411–415

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

Index 1615

Processor-specific, 400–401protocol, 451–453Scheduler, 421–423Virtual memory, 409–415, 430

initialize(), 1254inittodr(), 455Ink (handwriting recognition), 106Inkwell, 38Inline assembly, 193Inline data, message, 516Input handler, 450Installation log viewer, 496Installation progress bar, 498Installation startup, 496–499install_name_tool, 129Instruction Cache Access (ICA), 206Instruction Decode Unit, 185Instruction Fetch Address Register (IFAR), 206Instruction Fetch Unit, 185, 210Instruction Match CAM (IMC), 224Instruction patching, 247, 249–256Instruction pipeline, 970FX, 205Instruction Prefetch Queue, 185Instruction set, 197–202Integrated chip (IC), 157Intel Boot Initiative (IBI), 366Intel Core Duo, 156, 173–174Intel Wired for Management specification, 375Interconnect mechanism, 161–162Interface Builder, 108Interfaces, file system, 1581Interfaces, Open Firmware, 298–300Internal objects, 853Internet, 24–25Internet Systems Consortium, Inc. (ISC), 35Interposition, 73–74, 1087Interpreter(s), 125–129

AppleScript, 125–126Automator, 126command-line support, 126–129scripts, 825–827

Interrupt, 201interrupt(), 550–551Interrupt line, 549Interrupt model, 718Interrupt vector relocation, 271interruptEventSource(), 1248interruptOccurred(), 1248In-use bitmap, 957

I/O addresses, 1257I/O Kit, 53–54, 1235

class hierarchy, 1239–1240classes, 1243–1246Device Interface, 1269–1271disk device and partitions, 1362–1363driver matching, 1255–1257driver methods, 1287driver personality, 1281–1283drivers, 1242Embedded C++, 1237–1238families, 1239–1241initialization, 435–443, 1253–1255I/O Catalog, 1253I/O Registry, 1251–1252memory allocation, 995–997nubs, 1242–1243planes, 1252traps, 554, 584Work Loop, 1246–1251

I/O Kit Device Driver Kext, 1280–1288I/O Media Filter, 1362–1364I/O protocol (UGA), 377I/O Registry, 54IOCatalogue, 1243IOCreateThread(), 711–713ioctl (I/O control), 1346IODiskMatching(), 459–460IOExternalMethod, 1300IOFindBSDRoot(), 457–461IOFindMatchingChild(), 460IOKernelDebugger, 1245iokit/, 502, 504IOKitResetTime(), 447IOLog(), 1325IOMalloc(), 995–997IOMallocContiguous(), 1259IONetworkInterface, 153IONetworkNamePrefixMatching(), 459–460IOPanicPlatform, 1253IOPlatformExpertDevice, 1598iops (internal operations), 206IORecursiveLockLock(), 1247IORecursiveLockUnlock(), 1247ioreg command-line utility, 269, 1252, 1338IORegisterNetworkInterface(), 460IORegistry, 442–443IORegistryEntry, 1243IORegistryExplorer.app, 1252

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

1616 Index

IORegistryIterator, 1243IOService, 1243

connection handle, 1302iostat, 1338IOWorkLoop class, 1246–1248IPC (interprocess communication), 16, 1021–1025

advisory-mode file locking, 1230–1232Apple Events, 1172–1181bootstrap servers, 1066–1079BSD condition variables, 1218CFMachPort, 1203CFMessagePort, 1203CFRunLoopTimer, 1209–1210CFSocket, 1206–1208client-server example, 1080–1084Core Foundation, 1197–1210dead names, 1084Distributed Objects, 1164–1172entry splay tree, 1043–1044entry table, 1043exceptions, 1112–1129file descriptors, 1148–1155Foundation notifications, 1181–1184funnels, 1223–1229initialization, 429interposition, 1087–1090I/O kit, 1223kernel event notification, 1191lock sets, 1218low-level locking, 1213–1217Mach IPC messages, 1031–1040Mach ports, 514–516, 1027–1031, 1044–1048messages, 516, 1031–1040messaging, 1057–1060MIG, 1094–1111msg traps, 578name servers, 1068–1079named pipes (fifos), 1147notifications, 1181–1197notify(3) API, 1184–1186out-of-line memory, 1090–1092pipes, 1145–1146port allocation, 1052–1057port rights, 1093–1094port sets, 1085–1087POSIX IPC, 1156–1164Pthreads synchronization interfaces, 1222ptrace() system call, 1144–1145

run loop, 1201–1210semaphores, 1219–1222signals, 1129–1145spaces, 1041–1044SPLs, 1230subsystem initialization, 1060–1062synchronization, 1210–1232tasks, 1048–1051threads, 1051–1052XSI IPC, 1155–1156

IPC-related data structures associated with a Mach task, 1048

iPhoto, 39iPod driver, 1283ISO 9660 file system, 1388–1389ISS, 208issignal(), 1141iSync, 38isync, 1212iTunes, 37iTunes application bundle, 76–77

JJaguar, 36, 38–39Java, 113–114

Abstract Windowing Toolkit, 102nand Cocoa, 107

java, 113Java 2 Standard Edition (J2SE), 37Java archives (jar files), 113Java Development Kit (JDK), 33, 113Java Native Interface (JNI), 113Java threads, 762–763Java Virtual Machine framework, 113javac, 113JavaVM.framework, 113JBOD (Just a Bunch of Disks), 151Jikes (Java compiler), 113nJobs, Steve, 9–10Journal info block, 1541Journaling, HFS+, 1538–1546journal_init(), 448JPEG (Joint Photographic Experts Group), 93Just-in-time (JIT) compiler, 33, 113Just-in-time (lazy) binding, 71JVM, 762

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

Index 1617

Kkalloc(), 992–993, 995kalloc_init(), 879kau_init(), 449, 619Kauth, 134Kauth authorization subsystem, 1445–1446

activity monitor, 1453–1469implementation, 1450–1453listeners and authorization, 1449scopes and actions, 1446–1448Vnode-level activity monitor, 1453–1469

kauth framework, 51kauth_authorize_action(), 814kauth_init(), 445KDB (Kernel Debugger), 50n, 603–604

commands, 1332–1336show all commands, 1336show commands, 1336and stabs, 1338

kdebug, 625–638KDP (Kernel Debugging Protocol), 50n, 602–603,

1245, 1324, 1329kdumpd, 1324Kerberos, 37Kernel, 48–57

address space, 907–911, 1594–1595auditing support, 619–625bootstrap thread, 431–432CHUD support, 603–612debugging support, 601–658diag, 638event queues, 484–485functions, 382funnel, 445kdebug, 625–638kext caches, 59, 335–338logging, 416Mach-O load commands, 337mode, 531modules (kmods), 1260–1266notes, 1192panic, 1322–1324port, 1049process tracing, 129, 617save areas, 538stack pointer, 538subsystems, 419–422symbols, 385–387

task, 513tracing (ktrace(2) and kdump), 129, 617–619traps, 1121version string, 650See also xnu kernel

Kernel arguments, 355–361for boot behavior, 355–356for locking behavior, 357for properties and debugging, 358–361for resource allocation, 356for root devices, 357for scheduling behavior, 357–358

Kernel Debug Kit, 1329Kernel Event Agent, 1572Kernel extension(s), 57, 79, 1259, 1296

auto loading, 1267–1269bundle, 1260caches, 335creating, 1271–1288generic, 1271–1279managing, 1266–1267static linking, 69Universal, 1261

Kernel memory, 841–845allocator, 428dd and /dev/kmem, 841–843kvm(3) interface, 843–845

Kernel profiling (kgmon and gprof), 612Mach task and thread sampling, 616–617per-process profiling (profil(2)), 614–616

Kernel programming interfaces (KPIs), 51n, 153–154, 1235, 1466

Kernel startup, 382–388BSD initialization, 443–469first thread, 432–435high-level processor initialization, 405–421I/O kit initialization, 435–443launching the user-space program, 469–470low-level processor initialization, 388–405Mach subsystem initialization, 421–432slave processors, 470–472

Kernel threads, Mach, 710–712Kernel User Notification Center (KUNC), 508kernel_bootstrap(), 431–432kernel_bootstrap_thread(), 711kernel_debug(), 638kernel_memory_allocate(), 983Kernel-space security, 133–134kernel_thread(), 712–713

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

1618 Index

kernel_trap(), 581kevent(), 1192–1196Kext, 1259–1269.kext, 79Kext management, 1268Kext repository cache, 59n, 335–338kextcache, 348kextd, 55–56, 1266–1267kextstat command, 49Key combinations

command-line editing (Open Firmware), 275for nvedit command-line editing, 327for Open Firmware startup, 274

Keychain, 135, 140Keychain (OS 9), 27Keynote file, 79kgmon, 612–617kHasBundle, 78Kilburn, Tom, 835–836kill(), 1129, 1138kmem_alloc, 983–985kmeminit(), 445kmem_init(), 878, 879kmod_dump_log(), 1326kmod_info, 1254, 1264, 1266kmod_init(), 431knote_init(), 449kprintf() initialization, 416–417, 604kqueue, 51, 484–485, 1572–1574

filters, 1193kqueue(2), 1191ksh shell, 125ktrace(), 129, 617–619K2 I/O device controller, 159kudos, 287kvm(3) interface, 843–845kvm_getargv(), 843–844kvm_getenvv(), 843–844kvm_getprocs(), 843–844kvm_nlist(), 843–844kvm_read(), 843–844kvm_write(), 843–844

LL1 and L2 caches, 176–178L2 cache, flushing, 404

L1 D-cache, 403LangAnalysis, 101Language Chooser Application, 496Languages

Forth, 279–289scripting, 125supported in Xcode, 124

LAPACK, 125Large allocations, 964–966Large pages, 184lastcomm command, 134Last-in first-out (LIFO), 280–281latency, 1338Launch Services, 116

framework, 828–833registration database, 829–830

LaunchAgents, 60LaunchApplication(), 767LaunchCFMApp, 104launchd, 60, 472–485

-compliant daemons, 478daemon configuration, 473–476daemon creation, 476–484debug messages, 1077–1078operation, 484–485session launching, 488–490

LaunchDaemons, 60Launching applications, 828

mapping entities to handlers, 828–830Uniform Type Identifiers (UTI), 830–833

Launching the kernel, 352–353LaunchServices, 101Lazy binding, 71LBA (logical block address), 374LCA, 498LC_LOAD_DYLINKER, 817–818LC_PREBOUND_DYLIB load command, 941LC_SEGMENT, 817–818LC_SEGMENT_64, 817–818LC_THREAD, 817–818LC_UNIXTHREAD, 817–818ld (static link editor), 62LDAP (Lightweight Directory Access Protocol),

140LDT (Lightning Data Transport), 162Leaf function, 234leaks, 129ledger_init(), 431

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

Index 1619

libc, 74libdbm, 74libdl, 74–75libdyldapis, 75libinfo, 74libkern/, 502

classes and routines, 505–506C++ environment, 1000–1001directory, 505library, 54–55

libkeymgr, 75libkmod.a, 1265libkmodc++.a, 1263libkvm, 74liblaunch, 75libm, 75libmacho, 75libnotify, 75libpoll, 75libpthread, 75Library Directory, 59–61librpcsvs, 75libsa/, 502, 506–507libsa library, 55–56libstreams, 75libSystem, 74libtool, 63libunc, 75Link Aggregation, 455Link register (LR), 248Link widths, 163Linkage area, 231–232Linking, 67

binding styles, 71dyld interposing, 73–74two-level namespaces, 71weakly linked symbols, 72ZeroLink, 123

Linux, 23, 845and Xgrid, 147n

lipo, 66, 129–130Liquid cooling, 220–222listDisplays(), 1292–1294Listeners (callbacks), 134Listeners (kauth), 1449, 1457Little-endian, 226Load commands, 337, 817–818

listing, 65

Load Miss Queue (LMQ), 185Load Reorder Queue (LRQ), 185load_context(), 784load_machfile(), 816–818load_shared_file(), 927, 930Load/Store Unit (LSU), 185, 186Load-time binding, 71Local busses, 160Local domain, 58Local file systems, 1386Local lock implementation, 1232Local notification center, 1197Lock attributes, 1217Lock groups, 1217lockf(), 1231Locking behavior

kernel arguments, 357Locking data structures, 407, 449, 450, 451, 1214,

1218Log buffer daemon, 496–497Log messages, 1327–1328Logging

audit, 449debugging, 1325–1328kernel, 416in Mac OS X, 1326malloc operations, 976–978

Logical Block Addressing (LBA), 1346Logical partitions, 363Logical unit number (LUN), 150–151Logical-to-real address, 644–645Login

hook, 491–493multiuser startup, 490–493

loginwindow, 488, 490–495system restart, 494system shutdown, 494user logout, 494

loginwindow.app, 60Lookup function, 870lookupd, 132Loopback interface, 450, 454Love, Tom, 11Low tracing, 655–658Low-level diagnostics, 638–649

firmware call interface, 640–641system call interface, 641–649

Low-level kernel tracing, 649–659

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

1620 Index

Low-level locking, 1213–1217lock groups, 1217mutexes, 1215read/write locks, 1216spinlocks, 1213

Low-level processor initialization, 388–405memory patching, 398–400processor types, 395–398processor-specific initialization, 400–401reset types, 392–394

Low-memory global data area, 651Low-memory global data structures, 650–655Low-trace record generation, 658Low-water mark, 918LPAR (Logical Partitioning), 169–170LRU (least recently used), 841lsof, 130LSOpenCFURLSpec(), 828LSOpenFromRefSpec(), 828LSOpenFromURLSpec(), 828LSOpenFSRef(), 828LSPrefersPPC, 1594lsregister, 829–830lwsync, 1212LZ77 compression, 368LZSS compression, 337n

M.Mac account, 37, 1397Mac OS 7.6, 6, 24Mac OS 8, 24–27Mac OS 9, 25–27, 114–116

driver partitions, 1350Mac OS X

auditing system, 621block and character device, 1364Bootstrap Server, 1068command-line tools, 1476creation, 31–36Disk Arbitration subsytem, 1353–1361Disk Images framework, 1367file descriptors, 1375file system APIs, 1386–1387file system comparisons, 1575–1582IPC, 1024, 1041–1060logging, 1326memory management, 838–846

process subsystem, 688scheduler priorities, 792Spotlight, 1410–1441supported file systems, 1386–1409system call processing, 553–557system startup, 388and Unicode filenames, 1533virtual memory subsystem, 83710.x, 36–41

Mac OS X 10.0, 36–37shuttle and thread data structures, 715

Mac OS X 10.3current thread and activation, 716shuttle and thread, 715

Mac OS X 10.4, 39–41current thread and activation, 716dyld, 932–933prebinding, 942

Mac OS X Server, 31, 145Xgrid, 146–150Xsan, 150–153

MacBook Pro, 3Mach, 18–22, 49–50, 510–519

activation and shuttle, 714–716continuations, 717–726exceptions, 518–519, 1112–1129kernel fundamentals, 511–518kernel threads, 710–712ledgers, 431lock sets, 1218memory objects, 516–518nomenclature, 20page map, 921pager interface, 857processor sets, 689–691processors, 692–702remote procedure call (RPC), 712–714semaphores, 1219–1222subsystem initialization, 421–432system calls, 554task and thread sampling, 616–617and task API, 702–705tasks and threads, 727–746threads, 705–712, 717, 730–732traps, 53, 576–584zone allocator, 985–992

Mach APIs, 519alarm, 524–526clock services, 522–524

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

Index 1621

host information, 519–522host statistics, 526–529processor, 693–696task, 702–705thread, 707–710

Mach Emulation Daemon (machd), 30Mach Interface Generator (MIG), 18, 429, 578Mach IPC. See IPCMach Object File Format, 62Mach port(s), 689–690, 1027–1031

allocation, 1031communication, 1027and fork(), 755internal structure, 1045as objects, 1030rights, 134, 1028

Mach VM, 846–868architecture, 850backing stores, 853map entries, 851maps, 849–851objects, 851–853pager, 428npagers, 853–861protection values, 884task address space, 849

Mach VM interfaces, 893controlling memory inheritance, 893debugging, 896naming and sharing memory, 901–907protecting memory, 897–898user-space, 878–893

mach_absolute_time(), 782, 807Machine check exception (MCE), 272Machine State Register (MSR), 188, 194–195, 401Machine-dependent thread state, 538–539machine_init(), 430machine_startup, 419–421machine_thread_create(), 751–753mach_msg(), 1025, 1031mach_msg_overwrite(), 1025, 1031, 1058mach_msg_overwrite_trap(), 1032Mach-O, 62–66

filetypes, 63–64header load commands, 65header structure (32-bit version), 63listing the load commands, 87prebinding, 89

mach_port_allocate(), 1031, 1052

mach_port_allocate_full(), 1052mach_port_get_attributes(), 1055–1056mach_port_names(), 1055mach_task_self(), 703MachTen, 23mach_thread_self(), 707MACH_TRAP(), 579–582mach_vm_allocate(), 885, 893–896, 948mach_vm_behavior_set(), 889–890mach_vm_copy(), 888mach_vm_deallocate(), 885mach_vm_inherit(), 884, 886mach_vm_map(), 881–884mach_vm_msync(), 891mach_vm_protect(), 886, 897mach_vm_read(), 887, 899–901mach_vm_read_overwrite(), 887mach_vm_region(), 893mach_vm_region_info(), 896–897mach_vm_remap(), 884–885mach_vm_wire(), 889mach_vm_write(), 888, 899–901Macintosh File System (MFS), 1386Macworld Conference, 3MacWorld Expo, 33–34macx_swapoff(), 919macx_swapon(), 919macx_triggers(), 919–920Magic number, 323nMagnified mode, 118makecontext(), 1138malloc

implementation, 954zones, 951–956

malloc(), 966–967, 1000MallocDebug.app, 130malloc_history, 130Managed Object Context, 112–113MAP, 207–208Mapping tables, 414–415mapping_adjust(), 433Master boot record (MBR), 363, 1352Master CPU, 264nMaster directory block, 1503Master processor, 388–391, 397, 405, 407Matching dictionaries, 1268–1269Matching dictionary, 1359–1361Matchmaker (language), 18maxmem, 296

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

1622 Index

MAXUSERS, 686mbuf_expand_thread(), 711mdcheckschema, 1439mdfind, 1439mdfind command, 128–129mdimport, 1414, 1439.mdimporter, 79MDItem attributes, 1412mdls command, 128MDQuery, 1431–1434mdutil, 1439memberd, 132Memex, 1410Memory, 835

addresses, 182allocated, 414classes, 1244controller, 157, 171copy-on-write, 862–864data structures, 410deallocation, 982debugging, 976debugging Mach VM, 896dynamic pager program, 918–921inheritance, 893–895kalloc zones, 992–993kernel and user address space, 907–911kmem_alloc, 983–985Mach VM, 846–868Mach VM interfaces, 893–907Mach VM user-space interface, 878–893mach_vm_allocate(), 893–896mach_vm_map(), 881–884mach_vm_protect(), 897–898mach_vm_remap(), 884–885manager, 851map, 333memory management, 838–846memory-mapped files, 1001–1005NVRAM, 266objects, 20, 516–518OSMalloc, 993–994page faults, 876–877page replacement, 871–872pagers, 853–861patching, 398–400PRAM, 265–266protection, 6–7, 34

reading kernel memory, 841–845regions, 409, 466–468, 517resident memory, 868–877shared memory, 902–907, 922–94264-bit computing, 1005–1020subsystem, 839swap files, 918–921synchronization, 202Task Working Set (TWS), 942–948transfer, 888unified buffer cache (UBC), 913–918universal page lists (UPLs), 912update daemon, 921–922virtual memory initialization, 877vm_page structure, 868–869See also Virtual Memory

Memory allocation in the kernel, 980BSD portion, 997–1000I/O kit, 995–997kalloc, 992–993kmem_alloc, 983–985libkern’s C++ environment, 1000–1001Mach zone allocator, 985–992OSMalloc, 993–994page-level allocation, 980

Memory allocation in user space, 948–951enumerating all pointers, 971–974intercepting malloc layer, 979logging malloc operations, 976–978malloc() routine, 966–968memory allocator internals, 951, 957–964scalable zone statistics, 974–976

Memory Management Unit (MMU)address translation, 181–183block address translation, 184–185ERATs, 183large pages, 184segment lookaside buffer (SLB), 181–182translation lookaside buffer (TLB), 181–182

Memory propertiesPower Mac G5, 295PowerBook G4, 294

memory_manager_default_init(), 879Memory-mapped files, 1001–1005memory_object_control_bootstrap(), 879memory_object_data_request(), 859, 877memory_object_data_return(), 860memory_object_destroy(), 861

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

Index 1623

memory_object_get_attributes(), 859memory_object_init(), 856–858memory_object_lock_request(), 860memory_object_server(), 856memory_object_terminate(), 861MergePef, 130MERSI, 180Message header fields, 1034–1035Message passing. See IPCMessage trailer, 1038–1039Messages, 20, 516, 1031–1040Messaging implementation, 1057Metadata

allocation zone, 1561–1562attributes, 1432controllers, 151–152framework, 1411–1412importer, 79, 1428–1430

Metadata server (mds), Spotlight, 1414Methods, Open Firmware, 296–297Microcoded instructions, 206Micropartitioning (processor), 170Microsoft

Active Directory, 140Chicago, 2Windows 95, 2, 24

Microsoft WindowsNTFS, 1582–1585

microtime(), 455MIDI System Services, 99MIG, 1094–1111

and client-server systems, 1100and kernel, 1108specification files, 1095

Migrating threads model, 717MiniPCI, 161–162mkext cache (multiextension cache), 335–338mkfifo(), 1147MkLinux, 23mmap(), 1001, 1004, 1349Mobile Motion Module. See Sudden Motion Sensor

(SMS)MODE32 software, 267Model (Core Data), 111Model-View-Controller (MVC), 108, 110nMONster.app, 131Moore, Charles, 279Morphemes, 101

mount command, 1348mount_ftp, 1395–1396Mounting, root file system, 455–464Mouse pointer demo, 314–317MP Services. See Carbon Multiprocessing Services.mpkg, 79Mr. Registry.app, 54, 1252MS-DOS file system, 1390MsgType, 1099msleep(), 1218msync(), 922multicast DNS (mDNS), 148Multichip module (MCM), 170MULTICS IPC, 1024Multiextension (mkext) cache, 59Multimedia extension sets, 214Multiple users, fast user switching, 119Multiprocessing, 170, 771Multiprocessor system processes, 700–702Multiprocessor system startup, 388–395Multitasking, 771Multithreading, 169–170

and signals, 1135Multiuser startup, 485–495

user login, 490–493Munging, 562–566Musical names, 24Mutexes, 52, 1215, 1224–1225my_thread_setup(), 730–732, 1596–1597

NNaked rights, 1050Name servers, 1060–1079Named entry handle, 883Named Pipes (Fifos), 1147Named POSIX semaphores, 1160Nanokernel, 25–26NaNs (Not a Number), 402Natural unit, 378natural_t, 1043Navigation Services, and UTIs, 831NavigationServices, 106nchinit(), 448Nested pmap, 867netboot_mountroot(), 462–463NetInfo, 140

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

1624 Index

Netname server (nmserver), 30netstat, 276Network booting, 346–349, 463–464Network Data Representation (NDR), 1123Network Diagnostics.app, 60Network domain, 58Network file systems, 1386Network funnel, 445Network Kernel Extensions (NKE), 51, 153–154Network Message Server, 515, 1060, 1063–1064Network Name Server, 1063Networking, 153–154Networking, user-level, 90Networking subsystem initialization, 450–453Network-Transparent Ports, 515New World architecture, 268NeWS, 10new_system_shared_regions(), 927, 931NeXT, 9–10

and Cocoa, 107NEXTSTEP, 10–13OPENSTEP, 13–15Plan A, 9and Ross Perot, 10startup history, 9StepStone, 11

NeXT Interface Builder, 108NEXTSTEP Driver Kit, 1234NFS, 463

asynchronous I/O server, 723–724buffer cache, 916–918file system, 1396–1397

nfs_bind_resv_thread(), 711nfsd, 724NFSEXPORT, 1581nfsiod program, 723–724nfssvc(), 724nib files, 108nibtool, 109niutil, 141nm (object file symbol table), 63Node identifier, 375Nodes, B-Tree, 1484Nonexecutable stack, 1595–1596Non-Java (NJ) bit, 402Nonleaf class, 55Nonmaskable interrupt (NMI), 394Nonvolatile memory. See NVRAMNonvolatile register, 226

North Bridge/South Bridge, 161Not Quite NFS (NQNFS), 1397Notifications, 1181–1197

kqueue(2), 1191notify(3) API, 1184, 1191

notify_post(), 1185–1186Novell, 3np (nonportable) calls, 759–761, 929NSBundle, 78NSManagedObject, 111NSMovie, 114NSMovieView, 114NSNotification, 1181NSTask Cocoa Class, 763–764NSThread Cocoa Class, 764–766NSUndoManager, 110NSWorkspace class, 116NTFS file system, 1391Nubs, 56, 1242–1243NuBus, 269NuKernel, 4Null mount file system, 1405Null port, 1048nvedit, 326, 327NVRAM

dumping contents, 300–301EFI, 369–370and Open Firmware, 266panic log, 343Platform Expert, 57the script, 325variables, 296, 343, 1590

OOBEXAgent.app, 60Obfuscation scheme, password, 491Object graph, 110ObjectAlloc.app, 130Objective-C, 11

and Cocoa, 107protocols, 1165

Objects, Mach VM, 851–853OEA registers, 194open(), 1002–1009Open Firmware, 46, 264, 272

ASCII password, 350character display, 317–320

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

Index 1625

clock implementation, 320–321command-line editing, 275console, 325creating windows, 323–324drawing images, 322–323emulators, 278features, 273font demo, 318–320and Forth, 279–289Forth shell, 274–275getfwpath, 341interfaces, 298–300Mach-O binaries, 326mouse pointer, 314–317mouse pointer demo, 315–317password, 349–352pixel-addressable printing, 318–320programming, 300–324serial download, 278startup key combination, 274TELNET, 275–276TFTP, 276–278Towers of Hanoi problem, 303–314window, 324See also Firmware

Open Firmware Working Group, 272–273Open Group, 21nOpen Scripting Architecture (OSA), 106Open Software Foundation (OSF), 21

and Apple, 23Open source compilers, 124nOpen source development, 35Open source software, 43Open Transport, 90OpenAL, 100OpenBoot, 272OpenDarwin, 35OpenDoc, 5, 7openGate(), 1246OpenGL, 37, 96OpenGL interfaces, 97OpenGL Profiler.app, 130OpenScripting, 106OPENSTEP, 13–15Operators, Forth words, 285Option ROM, 363Organick, Elliott I., 1024OS Picker, 330osacompile, 126

osascript, 125OSBacktrace(), 1326osfmk/, 502

directory, 508–509osfmk, MkLinux, 23OSlibkerninit(), 1254OSMalloc functions, 993–994OSReportWithBacktrace(), 1326OSRuntimeFinalizeCPP(), 1264OSRuntimeInitializeCPP(), 1254, 1264otool, 65, 69, 87, 89, 130Out-of-line data, 699–700

message, 516Out-of-line memory, 1090Out-of-order execution, 169Overwrite call, 888

PPackageMaker.app, 79Packages/, 496Pad word, 957Page deactivation, 890Page faults

resident memory, 876–877and TWS, 947

Page frame, 835Page frames, initializing, 425–426Page queues, 870Page table, 181, 403Page table entry group (PTEG), 411–413Pageable memory, 995–997Pageable resident page, 870–871Page-in, 857Page-in operation, 1006–1007Page-level allocation, 980Page-out, 857, 1008–1009Pageout daemon, 435, 872–874Pager

Mach VM, 428n, 853–861port, 855–856problems, 860reply port, 858

Pages (address translation), 181pagestuff, 130Palette bundle, 79Palm, Inc., 9Panic image, 437–438

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

1626 Index

Panic log, 343Panic server, 1324Panic UI, testing, 439Panther, 36, 39Parameter area, 231–234Parameter memory. See PRAMParameter passing, 231, 239–240Parameter (use of term), 231Parity bits, 180parse_bsd_args(), 445parse_machfile(), 818Partition map, 1350, 1371–1372Partition map entries, 1350Partition table editor, 1348Partitioning, GPT, 374–376Partitioning, x86 computers, 1590–1591Partitioning (drive), 363Partitioning (processor), 170Passing parameters, 239–240Passive data, 1036Passive matching, 1256Password

obfuscation scheme, 491Open Firmware, 349–352

password command, 349–350Pasteboard Manager, 831Pasteboard Server (pbs), 31, 60Patch partition, 1350Patch tables, 398–400Pathnames, and kernel functions, 382Payne, R. Bruce, 835–836pbprojectdump command-line program, 124PC Card Standard, 162PCA PTEG Control Area, 411pcb, 538PCBs process control blocks, 414PCI bus bridge, 157PCI devices, listing, 1303–1304PCI Express, 160–162PCI-X, 159PCMCIA, 162nPC-style partitioning, 1352PDF, and Quartz 2D, 92–93PDF Kit, 40pdisk command, 1348–1350, 1352PE32 binary format, 378PEF files, merging, 130PEFViewer, 130

perfmon_init(), 430Perforce Software, Inc., 124Performance Monitoring Counter (PMC), 131Perl, 125, 1559–1560Permissions, HFS+, 1534–1538Perot, Ross, 10Per-process kernel tracing, 617–619Per-process profiling, 614–616Per-processor data, 390–392Per-processor information areas, 650–655Perq computers, 17Persistent Store Coordinator, 112Personalities, driver, 1255–1257, 1282pexpert/, 502

directory, 509–510PHP, 125Physical addresses, 1257Physical memory, examining, 645–648Physical memory window, 865PI (processor-interconnect), 164pid_for_task(), 581–584, 703Pink project, 2, 4–5pipeinit(), 449Pipes, 1145–1146PIR Processor ID Register, 394Pixel-addressable printing, Open Firmware, 318–320.pkg, 79PkgInfo file, 78PKZip archives, 1557Plan A (NeXT), 9Platform, 155–156Platform Expert, 56–57, 408, 509–510, 1255

computer serial number, 1304–1305temperature sensor readings, 1305–1308

Platinum-look user interface, 25Play list (BootCache), 353plist files, 81–82Plug-and-play, 53Plug-in API, 81Plug-in architecture, Core Image, 97Plug-in bundle, 79plutil, 82pmap, 411, 865–868

initialization, 411–415pmap_create(), 865–866pmap_destroy(), 866pmap_enter(), 866–867pmap_init(), 877, 879

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

Index 1627

pmap_map(), 865–868pmap_map_iohole(), 865pmap_page_protect(), 867pmap_protect(), 867pmap_reference(), 866pmap_remove(), 867pmap_switch(), 868pmap_vm_init(), 410PMC Index.app, 131Pointer enumeration, 972Polled-mode, 602Port(s)

allocation, 1031, 1052, 1053descriptor, 905–907Mach, 134, 514, 689, 755, 1027, 1045pager, 855–856renaming, 1047rights, 1027–1030, 1053, 1088–1094set, 515, 620–621, 1029, 1085

Portable Executable (PE), 378POSIX, 533

BSD init, 449threads (Pthreads), 75, 759–774

POSIX IPC, 1156semaphores, 1156shared memory, 1160

Postfix notation, 279postModLoad(), 1265postsig(), 1141POWER4+, 169–172POWER6, 171Power Mac G5, 156–166

amber, 256–261architecture and platform, 164atomic compare-and-store function, 244–246comparison with other processors, 166–174dual-processor architecture, 158elastic I/O interconnect, 164–166function rerouting, 246–256HyperTransport, 162–164Intel Core Duo, comparison with, 173–174K2 I/O device controller, 159out-of-order execution, 169PCI Express, 160–162PCI-X, 159–160POWER 4 processors, 166, 169POWER5 processors, 169PowerPC 970, 970FX, and 970MP, 171–224recursive factorial function, 241–244

sensors, 222, 129764-bit processor, 167–168software conventions, 224–240speculative execution, 168–169split transactions, 163superscalar, 168thermal and power management, 220–222U3H system controller, 157–159

Power Management Unit (PMU), 265–266Power plane, 1252POWER4 processors, 166, 169POWER4+ processor specs, 172–174POWER5 processors, 169–171POWER5+ processors, 171Power-on reset (POR), 271–272Power-on self-test (POST), 264, 366–369PowerPC

bootloader, 46exceptions, 383–385executables, 68, 116–117970s, 171–173processors, 155–156registers, 189–191system calls, 554, 584–586unconditional branch instruction, 249

PowerPC 970FX, 174–224AltiVec, 212–219branch prediction, 211–212caches, 175–181core, 202–212cycle-accurate core simulator, 256–261D0, 206D1, D2, D3, 206–207GD, DSP, WRT, GCT, MAP, 207–208IFAR, ICA, 206instruction pipeline, 205–210instruction set, 197–202internal buffers and queues, 185ISS, RF, 208–210maximum instructions, 210Memory Management Unit, 181–185power management, 219–222prefetching, 186–187processor-type table entry, 395–397registers, 188–194rename registers, 194–19764-bit architecture, 222–224softpatch facility, 224XFER, 207

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

1628 Index

PowerPC 970MP, 395nPowerPC OEA registers, 195PowerShare, 5, 7PowerTalk, 5, 7PowerTune, 220ppc_init(), 405–409, 470ppc_init_cpu(), 470–471ppc_vm_init(), 410, 877PPM (portable pixmap) image data, 322PRAM, 57, 265

resetting, 266resetting, and password security, 352n

Prebinding, 71, 86–89, 941Mac OS X 10.4, 942

Preboot Execution Environment (PXE), 363–364Preboot software, and EFI, 364Precious pages, 891Precompiled headers, 123Predefined queries, 111Predictive compilation, 122Predictor tables, 211–212Pre-EFI Initialization Layer (PEI), 366Preemptible parameter, 805Preemption rate, 775Preemptive multitasking, 7, 771Preference pane bundle, 80Preferred Executable Format (PEF), 104Prefetch Filter Queue (PFQ), 185, 186Prefetch Request Queue (PRQ), 186Prefetching, 187Prefix matching, 459–460preModLoad(), 1264prepare(), 1258Prerequisite packages, 677–680Primary partitions, 363Print (Carbon subframework), 106PrintCore, 101printf(), 1325

without using malloc(), 971–972Printing libraries, 88printlibs, 88Priority ranges, 791–792Private frameworks, 60, 84–85Privileged state mode, 188probe(), 1256, 1280Probe score, 1256Problem state mode, 188/proc file system, 1409proc structure, BSD, 747

procdup(), 465, 751Procedure (use of term), 231Process accounting, 134Process control block (PCB), 689Process model, 718Process serial number (PSN), 767Processes, 683–684

activation and shuttle, 714–716BSD processes, 746–759continuations, 717–726in early UNIX, 684–685execution environments, 686–687execve() system call, 812–827Launch Services, 828–830Mach tasks and threads, 727–746POSIX threads (Pthreads), 759–774process limits, 685–686processors, 689–702remote procedure call, 712–714scheduling, 774–811task structure, 702–705thread migration, 717thread structure, 705–712Uniform Type Identifiers (UTI), 830–833

Processor Abstraction Layer (PAL), 365Processor API, 693–696Processor cache information, retrieving, 178Processor event labels, 260Processor initialization, 388–421Processor interconnect, 158, 165Processor set API, 689–691processor structure, 692Processor traps, 532Processor types, 395–398Processor usage, conversion factor, 796–799processor_exit(), 693–696, 700processor_get_assignment(), 696processor_info(), 693processor_set_create(), 690processor_set_default(), 690processor_set_destroy(), 690–691processor_set_info(), 691processor_set_stack_usage(), 691processor_set_statistics(), 691processor_set_tasks(), 691Processor-specific initialization, 400–401processor_start(), 693–696, 700processor_start_thread(), 711Processor-type table entry, 395–397

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

Index 1629

processor_up(), 784procinit(), 445Productivity features, 119

Dashboard, 119–120fast user switching, 119Spotlight, 120

profil(), 614–616.profile bundle, 80Programmable read-only memory (PROM), 264Programming, 121–131

compilers and libraries, 124–125Disc Recording framework, 127Disk Images framework, 127interpreters, 125–129precompiled headers, 123sips command, 128tools, 129–131trivial AppleScript program, 125Xcode, 122–124

Prologue, 233Properties, kernel arguments, 358–361Properties, Open Firmware, 292–296Property List Editor, 82Property list (plist) files, 81–82Protected mode, 363Protection values

Mach VM, 884vm_protect(), 1596

Protocol, EFI, 369Protocol initialization, 451–453proto_input_run(), 711proto_kpi_init(), 450ps command, 829Pseudo file systems, 1386–1387Pseudo-devices, 297Pseudo-extensions, 441PseudoKernel, 591–594PTEG (Page table entry group), 411–413

hash table size, 412–413ptesync, 403Pthread data structure, 751pthread_cond_signal_thread_np(), 760pthread_cond_timedwait_relative_np(), 760pthread_create_suspended_np(), 760pthread_get_stackaddr_np(), 760pthread_get_stacksize_np(), 760pthread_is_threaded_np(), 760pthread_mach_thread_np(), 760pthread_main_np(), 760

Pthreads, 1222Pthreads API, 759–760, 802Pthreads library, 707–710pthread_yield_np(), 760ptrace() system call, 1144Public beta, 35Puma, 36–38PVR Processor Version Register, 397Python, 125

resolving an alias, 1555

QQNaN (Quiet NaN), 402QNIX, 17–18.qtif, 437QTKit.framework, 114Quality of Service structure, 1054Quartz, 91Quartz Composer, 40Quartz Compositor, 92–94Quartz 2D, 37, 92–93Quartz 2D Extreme, 40Quartz Debug.app, 119, 130Quartz Extreme, 38, 94–95Quartz Extreme with Accelerated 2D, 94–95Quartz Services, 94, 1293quartz-wm (window manager), 103Queues, 970FX, 185, 209QuickDraw, 101QuickDraw GX, 5, 7QuickDraw 2D, 95–96QuickDraw 3D, 5, 7QuickTime, 36–41, 114

Core Image and Core Video, 98RAW file, 437video-rendering pipeline, 98

QuickTime Virtual Reality (QTVR), 99Quotas, HFS+, 1546–1547

RRAID

AppleRAID, 344–345booting from a software RAID, 344and BootX, 346ndisk supersets, 1362

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

1630 Index

RAID, (continued)headers, 345–346Xsan, 150–151Xserve, 150, 153

RAM, 223, 268, 294, 354RAM disks, 459, 1370Random number generator (RNG), 637Raptor, 4, 152RAS, 180Rashid, Richard, 17, 18, 22Raster graphics, 93Raster image formats, 93Raw devices, 1349Raw kernel memory access, 845Rcsid, 1099Reachability (of a branch), 248READDIRATTR, 1581readdirattr(), 1582Read/write locks, 1216Real address (RA), 181Real mode, 363Real-time clock, 778–780Receive rights, 514, 1027–1030Receive side (data transmission), 165receivePacket(), 602Reconnect UAM, 1394Recorder function, 972Records, B-Trees, 1487Recursion, 305Recursive factorial function, 241–244Recursive invocation, 73Red project, 2, 4Reggie SE.app, 131, 194Register contents, viewing, 194Registers, 227–228

direct calls, 230OEA, 19432-bit, 222nVEA, 188–191

registerService(), 443Registry, I/O, 1251–1252Relative branching, 201Remote core dumps, 1324–1325Remote debugging, 122Remote disk mounting, 463Remote procedure call (RPC)

Mach, 712–714, 717MIG, 1094

remove_all_shared_regions(), 931Rename registers, 194–197Rendezvous, 39Repairing permissions, 1536Request, split transactions, 163Resampling an image, 128Reserved areas, 1493Reset

exception, 271handler, 392interrupt, 271the PRAM, 266types, 392–394

ResetHandler, 394reset_shared_file(), 927, 931Resident memory, 868

module, 423–425page faults, 876–877page queues, 870page replacement, 871resident pages, 869–870vm_page structure, 868–869vm_page_grab(), 872–875

Resolution-independent user interface, 118–119Resource allocation, kernel arguments, 356Resource forks, 1556–1558, 1567Resource ledgers, 729Response, split transactions, 163Restartable system call, 570Return from interrupt, 537Return stack, 280Reverse DNS, 82, 136n, 831Reverse Polish notation (RPN), 279revoke(), 1400RF (register file), 208–210rfid, 401, 537Rhapsody, 24, 27–31

Blue Box, 29Yellow Box, 29–31

Rich Site Summary (RSS), 99RIG. See Rochester’s Intelligent Gateway (RIG)RISC (reduced instruction-set computing), 5–6Rochester’s Intelligent Gateway (RIG), 16ROM-in-RAM design, 268Root device, 457–458

kernel arguments, 357Root file system, 456

mounting, 455–464

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

Index 1631

rootdev, 456–457rootpath, 334Rosetta, 116–117, 1591n

translate, 1593x86-based Mac computers, 1592–1594

Rotating a framebuffer, 1288–1292Round-robin strategy (Xsan), 152Roving pointer, 1507RPC. See Remote procedure call/rsrc, 1556rtclock_intr(), 550–551, 780, 785RTP (Real-Time Transport Protocol), 99RTSP (Real-Time Streaming Protocol), 99r12, 229Ruby, 125Run loop, 1201–1203

sources, 1203–1210Run queues, 791–793Runtime architecture, 61

fat binaries, 66–67linking, 67–74Mach-O files, 62–66

Runtime recording list, 1568Runtime services, EFI, 367

Ssa (stand-alone), 55Safari web browser, 39, 41

Spotlight search, 1440–1441Safe mode, 332, 339, 469Samba, 1397sample (process profiler), 130Sampler.app, 130Sampling tasks and threads, Mach, 616–617Saturate (SAT) bit, 402Saturn.app, 131Save area(s), 414

argument munging, 563BSD system calls, 557exception, 539LowTraceRecord structure, 658pointers (pcb and upcb), 538vector, 333

Save area free list, 540Save area free pool, 540.saver, 80

say command, 125, 128/sbin/init, 469/sbin/launchd, 469/sbin/mach_init, 469sbrk(), 949Scalable malloc allocation categories (32-bit), 956Scalable malloc allocation categories (64-bit), 956Scalable zone allocator, 953Scalable zone data structures, 955Scalable zone statistics, 974–976Scalar, 168Scaling modes, 118sched_init(), 421–423sched_pri_shift, 796–797sched_startup(), 785sched_tick_continue(), 786–789, 801sched_tick_interval, 796–797sched_tick_thread(), 711Scheduler initialization, 421–423Scheduler operation, 789–802Scheduler services, 432–435Scheduler startup, 784–786Scheduler tick, 786Scheduler tick thread, 432Scheduling, 774–775

absolute- and clock-time intervals, 782–784behavior, 357–358policy, 774, 802–811statistics, 527–529timeslicing quantum, 775–777timing and clocks, 777–782

SCOM (Scan Communications) facility, 403–404SCOMC (control) registers, 404SCOMD (data) registers, 404Scopes (kauth), 1446–1448Screen dimensions, 301–302Screensaver bundle, 80Screenshot, text console, 648–649Script, the, 326–327Scriptable applications, 1172Scriptable Image Processing System. See sips com-

mandScripting languages, 125

AppleScript, 106, 115, 125–126, 1173–1175Perl, 125, 1559–1560PHP, 125See also Open Scripting Architecture (OSA)

sc_usage, 130

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

1632 Index

scutil command, 142SEARCHFS, 1581searchfs(), 1571, 1582Searching. See SpotlightSearchKit.framework, 90Sector, hard drive, 1345–1346Secure empty trash, 39, 132, 139Secure transport, 135Security, 131–133

architecture, 133auditing system, 143–145authorization services, 137Basic Security Module (BSM), 134command-line tools, 141and daemons, 132firmware, 349–352kernel-space security, 133–134Security Agent, 136security command, 140Security Server, 135–136snag keys, 351system administration, 139–142token, 1038–1040user-space security, 134–139

Security Agent, 135–136and Apple Remote Desktop, 136n

security command, 139–140Security Server, 135–136Security.framework, 139–140SecurityHI, 106security-mode, 350–351Segment descriptors, 181Segment lookaside buffer (SLB), 181–182, 405Segment registers (SRs), 404Segment table entries (STEs), 181–182, 404Segments (address translation), 181select() system call, 722Self port, 577, 1049semaphore_create(), 759, 1219Semaphores

Mach, 1219–1222Named POSIX, 1160

semaphore_signal(), 759semaphore_signal_all(), 759semaphore_signal_thread(), 759semaphore_wait(), 759, 1219semaphore_wait_signal(), 759semexit(), 824

sem_open(), 1156sem_unlink(), 1156Send rights, 514, 1027–1030, 1088Send-once rights, 1029sendPacket(), 602Sequence number, 1038Serial console, 417–418Serial download, Open Firmware, 276–278Serial port names, 417nserial_keyboard_poll(), 711Serial-line-based debugging, 603–604Server. See Mac OS X ServerServer 1.x, 31ServerPrefix, 1099Service bundle, 80Service plane, I/O Kit, 1252Set-associative cache, 179setattrlist(), 1570set-colors, 302setconf(), 455–456setcontext(), 1138Setgid, 819SETI project, 147nsetthetime(), 455Setuid, 819Shadow chain, 862–863, 896Shadow objects, 848, 862–863Shadowed clone, 929Shadowing, 1370shandler(), 557, 590Shared bus, 159Shared memory

client, 903client-server example, 902regions, 466–468server, 905, 922–942setup, 923

Shared object files, 932–935shared_file_init(), 468shared_region_make_private_np(), 927–928shared_region_map_file_np(), 927–929,

936–940Shark.app, 131, 1338Shell, EFI, 370–374Shell scripts, 825–827, 842–843Shells, 125Sherlock, 25Sherlock version 3, 39

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

Index 1633

shmexec(), 824shm_open(), 1160Shoch, John F., 146show commands, KDB, 1336show all commands, KDB, 1336Shuttle/activation, 714–716Sideband signals, 161sifting, 287sifting (Forth dictionary), 287–288sigalstack(), 1136Signaling NaN (Not a Number), 402Signals, 1129–1131

application-defined signals, 1132asynchronous I/O, 1132and debugging, 1144default action, 1130delivery, 1130, 1138generation, 1130, 1138and IPC, 1132and Mach exceptions, 1141maximum number, 1131–1132and multithreading, 1135ptrace() system call, 1144reliability, 1131signal actions, 1135–1136

Signature, BootX, 338SIGTRAP, 819Silicomp, 21nSIMD (single-instruction, multiple data), 213simg4, 131simg5, 131, 256–261Simple integers, 204nSimple message, 1034SimpleCryptoDisk, 1311, 1321

I/O Kit driver, 1311–1320Single Partition UDIF (SPUD), 1369Single-precision floating-point values, 240Single-user mode, 332, 339, 349, 469Single-user startup, 495–496

bootstrap through launchd, 495sips command, 12864-bit architecture, 222–22364-bit comm area, 59464-bit computing, 1005–102064-bit processor, 167–16864-bit support, 40Sizing memory, 409–411Skidmarks GT.app, 131

Slash character, 1156Slave processor, 388–391, 401, 405, 470–472slave_machine_init(), 471slave_main(), 470–471Sleep, 1179–1181

and reset handlers, 393–394Slice (disk partition), 1348.slideSaver, 80Small allocations, 964–965SMB/CIFS, 38, 1397SMP (symmetric multiprocessing), 170SMT (simultaneous multithreading), 169–170Snag keys, 327–328, 340

and security mode, 351Snoop response (SR), 165SOAP (Simple Object Access Protocol), 90socketinit(), 450Soft limits, 685Soft reset, system reset exception, 271Software conventions, 224

byte ordering, 225–226passing parameters, 239–240register usage, 226–228returning values, 240stack usage, 230–238

Software debouncing, 394Software dependencies, 679Software traps, 532Source code editor, Xcode, 122Spam filtering, 38Sparse disk images, 1574–1575Sparse file, 1392specfs (special files), 1403Speculative execution, 168SpeechRecognition, 106, 121SpeechSynthesis, 101SPICE, 17Spider Systems, 17–18Spier, Michael J., 1024Spin Control.app, 130SpindownHD.app, 131Spinlocks, 1213–1215Spinning globe data, 336SPL (set-priority-level) call, 1230Splay tree, 1043–1044Split transactions, 163SplitFork, 1557Split-segment library, 924–925, 927–931, 939

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

1634 Index

Spotlight, 39–40, 90, 119, 120, 1409architecture, 1410–1415command-line tools, 1439–1440compared with BFS, 1415Fsevents, 1416–1428limitations, 1440–1441metadata importers, 1428–1430metadata server (mds), 1414queries, 1431–1438search, 51temporary files, 1430

.spreporter, 80SPRG1 register, 432SPRG registers, 537Spring-loaded folders, 25SQLite, 40SRR0, 536–537SRR1, 537SSB (source-synchronous bus), 164–165SSH daemon, 474–475ssh-agent, 122SSL (Secure Socket Layer), 135Stabs, 1338–1344Stack allocation queue, 433Stack usage, 230–238

in functions, 235–236printing stack frames, 235–238

Stack-based language, 279–280Stacks, Forth, 279–280, 283Stallman, Richard, 533Star Trek, 3start(), 1280startCPU(), 394StartIOKit(), 442–443, 1253–1255startMatching(), 1255Startup extensions dictionary, 443Startup file, HFS+, 1530Static archive libraries, 69Static branch prediction, 212Static link editor, 62Static linking. See Dynamic linkingStatic prediction, 212Statistics, Mach VM, 892–893StepStone Corporation, 11Sticky Keys, 121stop(), 1280Storage area network. See XsanStorage Description Register (SDR1), 194

Storage pools, 151Store Data Queue (SDQ), 185Store policy, caches, 179Store Queue (SQ), 185Store Reorder Queue (SRQ), 185StorNext, 150Streaming SIMD Extensions 2 (SSE2), 174Streaming SIMD Extensions 3 (SSE3), 174Streams, and prefetching, 186struct machine_thread, 687struct proc, 687struct processor, 687struct processor_set, 687struct run_queue, 687struct task, 687struct thread, 687struct uthread, 687Subframeworks, 101Subnormal numbers, 219nSubprocessor partitioning, 170Subroutine (use of term), 231Sudden Motion Sensor (SMS), 1297–1303Sun Microsystems

Network Information Service (NIS), 140NeWS, 10and Open Firmware, 272–273OpenStep, 13Solaris, 7

Superscalar, 168Support packages, 297–298Suspend count, 704, 708SVG (Scalable Vector Graphics), 93Swap files, 518

memory, 918–921swapcontext(), 1138Swing, 102, 113Symbol table. See StabsSymbolic link, 1390Symbolic links (symlinks), 1553–1554Symmetric copy-on-write, 862–864Symmetric multiprocessing (SMP), 771sync(), 921–922, 1212, 1567Sync flags, 891Synchronization, 1210–1232

advisory-mode file locking, 1230–1232atomic operations, 1213BSD condition variables, 1218classes, 1244

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

Index 1635

funnels, 1223–1229low-level locking, 1213–1217Mach lock sets, 1218Mach semaphores, 1219–1222Pthreads, 1222SPLs, 1230

Synchronous bus, 165synthfs, 1404sysctl(), 178, 845–846, 1279sysctl hierarchy, 1277sysctl nodes, 1277sysctlbyname(), 845–846, 1594sysctl_handle_init(), 1277sysctl_handle_string(), 1277sysctl_register_fixed(), 450sysfs, 845syslogd, 1077System Abstraction Layer (SAL), 365System administration, and security, 139–142System architecture, 164System call, 201, 533, 537

cancellation, 562categories, 557–601processing, 553–557return values, BSD, 571x86-based Mac computers, 1597

System call data structuresThird Edition UNIX, 572

System clock configuration, 781System Configuration, 142System domain, 59System Enabler, 267System entry mechanisms, 533–543/System/Library/ Directory, 59–61System linkage instructions, 537System Management Unit (SMU), 265–266System preferences, 34System Profile reporter, 80System reset exception, 271System reset interrupt (SRI), 271System restart, 493–495System shutdown, 493–495System size configuration, 686System startup, 388–395System V IPC, 449system_profiler

x86-based Mac computers, 1588SystemStarter

and daemons, 498

TTaligent Object Services (TalOS), 4–5Target disk mode, 328tart, 237nTask(s)

address spaces, 849API, 702–705functions, CHUD, 605and IPC, 1048Mach, 431port, 514roles, 810–811sampling, Mach, 616–617and threads, 512–514, 727–746

Task (Mach), 19task structure, 702Task Working Set (TWS), 942–948

execve() system call, 947global user profile cache, 945and page-faults, 947

task_assign(), 696TASK_BACKGROUND_APPLICATION, 811TASK_CONTROL_APPLICATION, 811task_create(), 704, 727–729TASK_FOREGROUND_APPLICATION, 811task_for_pid(), 704, 899task_get_exception_ports(), 704task_get_special_port(), 704TASK_GRAPHICS_SERVER, 811task_halt(), 818task_info(), 704task_init(), 431task_policy_get(), 705task_policy_set(), 705task_resume(), 704task_set_exception_ports(), 704task_set_64bit, 816task_set_special_port(), 705task_suspend(), 704task_swap_exception_ports(), 704task_terminate(), 704task_threads(), 704TASK_UNSPECIFIED, 810tbxi (Toolbox image), 270Tcl, 125tcsh shell, 125TELNET, 275–276telnet support package, 275–276

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

1636 Index

Temperature, Hot File Clustering, 1563–1564, 1567, 1569

Temperature sensor readings, 1305–1308Templates, Xcode, 124Temporary files, 1430Tenon Systems, 23terminal-emulator, 317Test-and-set, 1211Tevanian, Avadis, 20, 22Text-to-Speech, 121Textual console, 648TFTP (trivial file transfer protocol), 276–278

daemon, 276thandler(), 548, 551–552Thermal and power management

Power Mac G5, 220–222Thermal monitoring, 421Thermometers, 221–22232-bit comm areas, 594–60132-bit processor, exception processing, 544–54532-bit registers, 222n32-bit system enabler, 267Thrashing, 837Thread(s)

call graph, 789–790creation, x86 computers, 1596–1597functions, 605info UFT, 587–589interface functions, 730–732and IPC, 1051Mach, 20, 431, 512–514, 705–712migration, 717port, 514sampling, 616–617

thread structure, 706–707Thread Viewer.app, 130thread_abort(), 709, 1118thread_bind(), 435thread_block(), 718thread_block_reason(), 718thread_bootstrap(), 407thread_create(), 707, 730, 759thread_create_running(), 708, 759thread_dup(), 751THREAD_EXTENDED_POLICY, 802–803thread_funnel_set(), 1228thread_funnel_switch(), 1228thread_get_exception_ports(), 709thread_get_special_port(), 710

thread_get_state(), 707, 759thread_info(), 707thread_init(), 431thread_invoke(), 718threadMain(), 1246thread_policy_get(), 710thread_policy_set(), 809THREAD_PRECEDENCE_POLICY, 803–805thread_resume(), 465, 708, 759thread_set_exception_ports(), 710thread_set_special_port(), 710thread_set_state(), 707, 759thread_stack_daemon(), 711THREAD_STANDARD_POLICY, 802thread_suspend(), 708, 1118thread_switch(), 708thread_switch_continue(), 708thread_terminate(), 708, 759thread_terminate_daemon(), 711THREAD_TIME_CONSTRAINT_POLICY, 805–809thread_update_scan(), 801thread_wakeup(), 453thread_wire(), 709Three Rivers Corporation, 17–18Throughput, 160, 165TIFF (Tagged Image File Format), 93Tiger, 36, 39–41Timebase Register (TB), 192, 407, 470, 777, 782timeout(), 453Timer call processing, 788timer_call_interrupt(), 786–788timer_call_setup(), 775Timeslicing quantum, 775–777Timing and clocks, 777–782Tiny allocations, 957–964Tiny block, 958Tiny quanta, 957Tiny regions, 957tlbie, 403tlbsync, 403TLS (Transport Layer Security), 135Toll-free bridging, 89nToolbox ROM, 267Tools, 129

CHUD, 130–131debugging and analysis, 129–130programming, 129–131Visual Tools, 131

Towers of Hanoi problem, 303–314

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

Index 1637

Trace points, 617–618Tracing, 256–261, 649–659

using amber, 257–259Trailer attributes, 1038Trailer formats, 1038–1039Transfer-handshake (TH) packets, 165Transient attribute, 111Transistors, 167translate (Rosetta), 1593Translation lookaside buffer (TLB), 181–182trap(), 466, 548, 876Trap instruction, 201Trap table, 593Trap vectors, 536Traps and exception data, 1119Trash can, secure empty, 39, 139Trigger events, 143Trivial AppleScript program, 125Trivial executable, 64TruBlueEnvironment, 33, 114, 591Trust policies, security, 135Two-level namespaces, 71tws_handle_startup_file(), 816

UU-area (user structure), 52n, 563, 685, 720UDF (Universal Disk Format) file system, 1391UFS file system, 1391–1393UFS2, 1392UIDs (user identifiers), 133UISA registers, 188–191ulocks, 1218Ultra-fast traps (UFTs), 554, 587–594

Blue Box calls, 591–594fast traps, 590

Umbrella frameworks, 84–86Unconditional branch, 201, 249Underscore, removed, 237nUnderscore character prefix, 545Unicode filenames, 1533Unidirectional links, 162–163Unified buffer cache (UBC), 52, 447, 913–918

routines, 915–916Uniform Type Identifiers (UTI), 830–833

declaration, 832–833union mount file system, 1405–1407Uniprocessor patch table, 400

Universal access support, 40, 120–121Universal Binaries, 12n

x86-based computers, 1591–1592and Xcode, 122

Universal Binary format, 66–69UNIVERSAL CD, 1350Universal Disk Image Format (UDIF), 1369Universal Graphics Adapter (UGA), 376–377UNIVERSAL HD, 1349–1352Universal kernel extension, 1261Unix, 33

exception handler, 466, 1114, 1141shells, 125

UNIXprocesses, 684system call data structures, 572and virtual memory, 836

unix_syscall(), 557, 568Unlinking open files, 1552–1553Unnamed pipes, 1146Unnamed POSIX semaphores, 1160Unresolved kernel traps, 1121–1122Unstable write, 916Untyped data, 1034Upcall, 856upcb, 538Update daemon, 921UPL (universal page lists), 840, 912upl_abort(), 912upl_commit(), 912upl_create(), 912Uptime, 699URLMount, 1395USB plane, I/O Kit, 1252User area (u-area), 52User Authentication Method (UAM), 1394User domain, 58User interface, 117

Open Firmware, 299productivity features, 119–120resolution-independent, 118–119universal access support, 120–121visual effects, 118

User login, multiuser startup, 490–493User logout, 493–495User memory window, 909User mode, 531User save areas, 538User stack configuration, execve(), 820–824

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

1638 Index

User structure, 563USERACCESS, 1581User-level startup, 472

installation startup, 496–499multiuser startup, 485–495single-user startup, 495–496

UserPrefix, 1099User space, 530User-space interface, Mach VM, 878–893User-space pagers, 854User-space program, 469–470User-space security, 134–139User-space system call stub, 573–574/usr/bin/ditto, 1557/usr/include, 103/usr/lib, 103UTF-8, 1533uthread structure, 721, 748U3H system controller, 157–159UUID (universally unique identifier), 334UVM, 23ux_handler(), 711ux_handler_init(), 466

VValid array, 1575Valid ports, 1048Van Horn, Earl C., 683vBigNum, 125vCards, 38vclean(), 861, 1400vDSP, 125VEA registers, 188–191vecdst(), 187vecLib, 213Vector graphics, 93Vector image formats, 93Vector instructions, 199–200Vector parameters, 239–240Vector save area, 333Vector streams, 186-verbose, 1368Verbose mode, 332, 340, 349, 469Version control systems, 124Versioning, 84vfork() system call, 756–759

vfs (virtual file system), 1376–1386functions, 1376–1378

VFS layer, 1376–1386journaling, 1541

vfsconf, 1379vfs_event_signal(), 1574vfsinit(), 1384–1385vfs_mountroot(), 455–456, 461–462vfs_op_init(), 1384vfstable, 1379VGA, 363, 376–377Victim thread, 518, 1115Video, 96–100Video console, 418Video-rendering pipeline, 98vImage, 125, 213Virtual address, 181, 644–645Virtual address space, 529–530, 910–911Virtual disks, 1371–1374Virtual file system (VFS), 51Virtual I/O Server Partition, 170Virtual machine interface, 511Virtual machine monitor (VMM), 659

control data structures, 659–660running code in a virtual machine, 662–676using the VMM facility, 661–662

Virtual memory, 836contiguous, 20encrypted, 134initialization, 409–415, 877and IPC initialization, 430Mach, 49, 516–518map, 817map entries, 847–848and memory objects, 516–518and MMU, 181, 836and Mode32, 267object, 847–848pages, 847–848regions, 468statistics, 130, 527–529subsystem, 52, 408, 837system limits, 908–909and UNIX, 836

Virtual page number (VPN), 182Virtual PC, 673Virtual segment ID (VSID), 182Virtualizer, Classic Startup, 115

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

Index 1639

Virtual-to-physical (VP) table, 869Visual effects, 118Visual tools, 131VLANs (Virtual LANs), 455VLIW (very-large instruction-word), 168vmachmon32 program, 674–676vm_allocate(), 663, 930–931vMathLib, 125vm_deallocate(), 856, 931vm_fault(), 876vm_fault_init(), 879vm_initialized, 408–409vmmap, 130vm_map(), 856vm_map_copyin(), 931vm_map_copy_overwrite(), 931vm_map_create(), 817vm_map_deallocate(), 818vm_map_fork(), 878vm_map_get_upl(), 912vm_map_init(), 879vm_map_lookup_entry(), 851vm_map_protect(), 931vmm_dispatch(), 662vm_object_bootstrap(), 879vm_object_iopl_request(), 912vm_object_update(), 860vm_object_upl_request(), 912vm_page structure, 868–869vm_page_bootstrap(), 879vm_page_free_reserve(), 874–875vm_page_grab(), 872–875vm_page_module_init(), 879vm_protect(), 1596vm_stat, 130vn device nodes, 1370–1371vndevice interface, BSD, 463vn_getpath(), 1457Vnode (virtual node), 840, 1376–1386

activity monitor, 1453–1469pager, 518, 854, 1002–1009structures, 447–448, 1383tag, 1457

vnode_authorize(), 814, 1452vnode_pagein(), 859–860vnode_pager_init(), 858vnode_pager_zone, 455vnode/vfs layer, 1377VNOP_BLOCKMAP(), 1366

vn_rdwr_64(), 920vn_read(), 920vn_read_swapfile(), 921VoiceOver, 121Volatile register, 226volfs (volume ID file system), 1407–1409VOL_RENAME, 1581Voltmeters, 222Volume

extending and shrinking, 1572formats, 1581freezing and thawing, 1571

Volume (disk partitions), 1348Volume header, HFS+, 1493–1501Volume notifications, 1572Volume Status Database, 1355Volume status database (vsdb), 1355Volume UUIDs, 1355Volume (Xsan), 150VRSAVE, 216–217, 402vsdbutil, 1355

WWaitTime, 1099wakeup(), 1218wakeup_one(), 1218Walden, David C., 1026Watcher (fsevents), 1416.wdgt, 78Weakly linked symbols, 72Web browser, origins, 12Web Kit, 41Web plug-in bundle, 80WebDAV, 1397–1399WebObjects, 15, 31, 113White, Jim E., 1094Widgets, 40, 78, 119WIMG, 854Window backing-store, 94Window management (Quartz), 91–92Window ports, 515Window project, Open Firmware, 324Window Server, 31Windows compatibility, 39Windows NT, Yellow Box, 30WindowServer application, 92wm_ffm, 103

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

1640 Index

Words, Forth, 281–288Work Loop

I/O Kit, 1246–1251Working Set Model, 942–943Working Set Principle, 837, 943Workspaces, Xcode, 122Worldwide Developers Conference (WWDC),

28, 31Worms, 146Wrapper, HFS, 1501–1505Write-after-read (WAR), 196Write-after-write (WAW), 196Write-back, 179Write-through, 179WRT, 207WRT, GCT, MAP, 207–208

XX Window System, 39, 103X Window System and Aqua, 117Xcode, 121–124, 1271–1274

class-modeling tool, 107command line program, 124data-modeling tool, 107plug-in, 80supported languages, 124template, 1281–1282, 1311

x86 computersACPI plane, 1598architecture, 1587–1588boot.efi, 46, 60, 1589byte ordering, 1594Darwin, 3/dev/mem and /dev/kmem, 1597–1598Extensible Firmware Interface (EFI), 362–379,

1589–1590GUID Partition Table (GPT), 1352–1353,

1590–1591hwprefs, 1588kernel address space, 1594–1595nonexecutable stack, 1595–1596partitioning, 1590–1591Rosetta, 1591n, 1592–1594Star Trek, 3system calls, 1597thread creation, 1596–1597Universal Binaries, 1591–1592

x86 Mach-O executables, 68Xerox worms, 146XFER, 207Xgrid, 146

architecture, 147–149software, 149–150

XML-RPC, 90xnu kernel, 48

BSD, 50–53compiling, 676–681debugging, 601–658debugging (KDB), 50directories, 502–510drivers, 48entering the kernel, 529–543exception processing, 543–553extensions, 49I/O kit, 53–54kernel extensions, 57libkern library, 54–55libsa library, 55–56Mach, 49–50, 510–519Mach APIs, 519–529Platform Expert, 56–57source, 501–510system call categories, 557–601system call processing, 553–557virtual machine monitor (VMM), 659–676

xnu package, 680–681xnu source, 501–510XOR masks, mouse pointer demo, 317Xsan, 150

allocation strategies, 152client systems, 152command-line utilities, 153communication infrastructure, 153metadata controllers, 152storage, 150–152

Xserve, 145nXSI IPC, 1155–1156

YYellow Box, 28, 29–31

Cocoa, 33Windows NT, 30

YieldToAnyThread(), 772YieldToThread(), 772

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

Index 1641

Zzalloc(), 987zalloc_async(), 988zalloc_canblock(), 990–991zalloc_noblock(), 989Zero page, 910Zero-filled memory, 853ZeroLink, 123zfree(), 990, 991zget(), 989zget_space(), 987zinit(), 877, 987–988

Zone allocator functions, 988–989Zone map size, 428Zone of zones, 987Zone page table, 990zone structure, 986zone_bootstrap(), 879zone_change(), 989zone_gc(), 991zone_init(), 879, 990zone_page_init(), 991zone_zone, 427zprint, 986zsh shell, 125

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