Important: The information in this document is obsolete and should not be used for new development.
Figures, Tables, and Listings
Preface About This Book xviiFigure 1-1 Devices and the Macintosh 1-4
Figure 1-2 Communication with devices 1-5
Figure 1-3 The device control entry 1-7
Figure 1-4 The unit table 1-9
Figure 1-5 Relationship of the Device Manager data structures 1-11
Table 1-1 Device Manager I/O functions and responsible driver routines 1-12
Figure 1-6 Structure of a driver resource 1-13
Figure 1-7 Hierarchy of Device Manager functions 1-14
Figure 1-8 Device Manager parameter blocks 1-16
Listing 1-1 Opening a device driver 1-18
Listing 1-2 Closing a device driver 1-20
Listing 1-3 Reading from a device driver 1-21
Listing 1-4 Writing to a device driver 1-22
Listing 1-5 Controlling and monitoring a device driver 1-23
Figure 1-9 The driver header 1-25
Listing 1-6 Driver flag constants 1-27
Listing 1-7 An assembly-language driver header 1-28
Listing 1-8 An assembly-language dispatching routine 1-29
Listing 1-9 Example driver open routine 1-32
Listing 1-10 Example driver close routine 1-33
Listing 1-11 Example driver prime routine 1-34
Listing 1-12 Example driver control routine 1-35
Listing 1-13 Example driver status routine 1-36
Table 1-2 Reserved unit numbers 1-38
Listing 1-14 Finding space in the unit table 1-39
Figure 1-10 The Chooser window 1-41
Figure 1-11 Structure of a device package 1-45
Table 1-3 Device package flags 1-46
Table 1-4 Chooser messages and their meanings 1-47
Listing 1-15 'DRVR' resource format 1-89
Figure 2-1 Simplified processor-bus and NuBus architecture 2-4
Figure 2-2 The NuBus 32-bit address space 2-6
Table 2-1 Slot address allocations by slot ID 2-6
Figure 2-3 The structure of a typical sResource 2-8
Figure 2-4 The format of the sBlock and sExecBlock data structures 2-9
Table 2-2 Large data types used in sResources 2-9
Figure 2-5 The sRsrcType entry format 2-10
Figure 2-6 A sample board sResource 2-12
Figure 2-7 The structure of the sResource directory 2-13
Figure 2-8 The format block and sResources for a sample video card 2-14
Listing 2-1 Disabling and enabling an sResource 2-18
Listing 2-2 Searching for a specified type of sResource 2-19
Table 2-3 The Slot Manager search routines 2-19
Listing 2-3 Searching for the name of a board sResource 2-21
Table 2-4 How the Slot Manager determines the base address of a slot device 2-55
Table 3-1 SCSI bus signals 3-5
Figure 3-1 SCSI bus phases and allowable transitions 3-6
Figure 3-2 The role of the SCSI Manager 3-9
Listing 3-1 Reading data from a SCSI device 3-16
Listing 3-2 Using TIB and CDB structures 3-18
Chapter 4 SCSI Manager 4.3 4-1
Figure 4-1 The SCSI Manager 4.3 architecture 4-4
Table 4-1 Original SCSI Manager parameter conversion 4-17
Table 4-2 SCSIAction function selector codes 4-39
Figure 5-1 The ADB Manager and device handlers 5-6
Figure 5-2 Command formats for Talk, Listen, and Flush 5-8
Figure 5-3 Command format for SendReset 5-8
Figure 5-4 A typical ADB transaction 5-9
Table 5-1 Register 0 in the Apple Standard keyboard 5-10
Figure 5-5 Format of device register 3 5-11
Table 5-2 Bits in device register 3 5-11
Table 5-3 Defined default ADB device addresses 5-12
Table 5-4 Special device handler IDs 5-13
Table 5-5 Typical ADB device table at initialization 5-14
Figure 5-6 Resolving address conflicts 5-16
Figure 5-7 Polling the ADB 5-18
Figure 5-8 How an ADB device responds to a polling request by the ADB Manager 5-19
Figure 5-9 The ADB service request signal 5-20
Figure 5-10 An ADB device asserts the service request signal 5-21
Listing 5-1 Determining whether an ADB device is an Apple Extended keyboard 5-23
Figure 5-11 The ADBOp routine and an ADB completion routine 5-25
Listing 5-2 Sending an ADB command synchronously 5-25
Listing 5-3 Reading the current state of the LED lights 5-26
Listing 5-4 Setting the current state of the LED lights 5-27
Listing 5-5 Counting in binary using a keyboard's LED lights 5-28
Listing 5-6 Installing an ADB device handler 5-32
Listing 5-7 Installing a routine pointer into JADBProc 5-35
Listing 5-8 A sample device handler 5-37
Figure 6-1 A network driver's sleep dialog box 6-5
Table 6-1 Response of network services to sleep requests and sleep demands 6-10
Listing 6-1 Determining which Power Manager dispatch routines exist 6-15
Listing 6-2 Setting the wakeup timer 6-17
Listing 6-3 Adding an entry to the sleep queue 6-18
Listing 6-4 Installing a sleep procedure that uses application global variables 6-20
Listing 6-5 Accepting and denying a sleep request 6-21
Listing 6-6 A sleep procedure 6-21
Listing 6-7 Retrieving the sleep queue record and the selector code 6-22
Listing 6-8 Displaying a dialog box in response to a sleep demand 6-23
Listing 6-9 A modal dialog filter function that times out 6-24
Figure 7-1 The format of serialized bits 7-5
Figure 7-2 The role of the Serial Driver 7-9
Listing 7-1 Using the Serial Driver 7-11
Figure 7-3 The serConfig parameter format 7-19