ð Developer Note Macintosh PowerBook 5300 Computer Macintosh PowerBook 5300/100 Macintosh PowerBook 5300c/100 Macintosh PowerBook 5300cs/100 Macintosh PowerBook 5300ce/117 ð Developer Press Apple Computer, Inc.
ð Apple Computer, Inc. 1995 Apple Computer, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Computer, Inc. Printed in the United States of America. The Apple logo is a trademark of Apple Computer, Inc.
Contents Figures and Tables Preface ix About This Developer Note xi Contents of This Note xi Supplemental Reference Documents xii Apple Publications xii Other Publications xiii Conventions and Abbreviations xiii Typographical Conventions xiii Standard Abbreviations xiv Chapter 1 Introduction 1 Features 2 Appearance 3 Peripheral Devices 4 Configurations 5 Compatibility Issues 5 RAM Expansion Cards 5 Number of Colors 5 Video Mirror Mode 6 Sound Sample Rates 6 Power Manager Interface 6 Microprocessor
Input/Output Subsystem 13 Whitney Peripheral Support IC Combo IC 14 Singer IC 14 Power Manager IC 14 Display Controller IC 14 Baboon Custom IC 15 TREX Custom IC 15 Video Card 16 Keystone Video Controller IC Ariel Video Output IC 16 Chapter 3 I/O Features 13 16 17 Internal IDE Hard Disk Drive 18 Hard Disk Specifications 18 Hard Disk Connector 19 Connector Location 20 Signal Assignments 20 IDE Signal Descriptions 21 Trackpad 22 Keyboard 23 Flat Panel Display 24 Flat Panel Display Circuitry 24 Number of
RAM Expansion 39 Electrical Design Guidelines for the RAM Expansion Card Connector Pin Assignments 40 Signal Descriptions 42 Address Multiplexing 43 Banks of DRAM 45 DRAM Device Requirements 45 Expansion Card Electrical Limits 46 Mechanical Design of the RAM Expansion Card 47 RAM Card Dimensions 47 RAM Card Connector 48 Video Card 49 The Apple Video Card 49 Monitors Supported 49 Video Mirroring 50 External Video Connector 51 Monitor Sense Codes 52 Video Card Design Guide 53 Video Card Connector 53 Signals o
System Software 65 Control Strip 66 Support for ATA Devices 66 Large Partition Support 66 64-Bit Volume Addresses 66 System-Level Software 67 Application-Level Software 67 Limitations 68 Drive Setup 68 Improved File Sharing 68 Dynamic Recompilation Emulator 68 Resource Manager in Native Code 69 Math Library 69 New BlockMove Extensions 69 POWER-Clean Native Code 71 POWER Emulation 72 POWER-Clean Code 72 Emulation and Exception Handling 72 Code Fragments and Cache Coherency 72 Limitations of PowerPC 601 Compa
Chapter 8 Software for ATA Devices 115 Introduction to the ATA Software 116 ATA Disk Driver 117 Drives on PC Cards 118 Drives in the Expansion Bay 119 ATA Manager 119 ATA Disk Driver Reference 120 Standard Device Routines 120 The Control Routine 120 The Status Routine 121 Control Functions 122 Status Functions 130 ATA Manager Reference 135 The ATA Parameter Block 135 Functions 141 Using the ATA Manager With Drivers 168 Notification of Device Events 168 Device Driver Loading 169 New API Entry Point for De
Figures and Tables Chapter 1 Chapter 2 Chapter 3 Chapter 4 Introduction 1 Figure 1-1 Figure 1-2 Front view of the computer Back view of the computer Table 1-1 Configurations Architecture 9 Figure 2-1 Block diagram I/O Features 17 Figure 3-1 Figure 3-2 Figure 3-3 Figure 3-4 Figure 3-5 Figure 3-6 Figure 3-7 Maximum dimensions of the internal IDE hard disk Connector for the internal IDE hard disk 20 Position of the hard disk connector 20 Keyboard, United States layout 23 Keyboard, ISO layout
Table 4-1 Table 4-2 Table 4-3 Table 4-4 Table 4-5 Table 4-6 Table 4-7 Table 4-8 Table 4-9 Table 4-10 Table 4-11 Table 4-12 Table 4-13 Table 4-14 Table 4-15 Chapter 5 Software Features Table 5-1 Chapter 7 x 61 Summary of BlockMove routines Power Manager Interface Table 7-1 Chapter 8 Signal assignments on the expansion bay connector 34 Control signals on the expansion bay connector 36 Floppy disk signals on the expansion bay connector 36 IDE signals on the expansion bay connector 36 Unused IDE signal
P R E F A C E About This Developer Note This developer note describes the Macintosh PowerBook 5300 computer, emphasizing the features that are new or different from those of other Macintosh PowerBook computers. This developer note is intended to help hardware and software developers design products that are compatible with the Macintosh products described in the note.
P R E F A C E Supplemental Reference Documents 0 The following documents provide information that complements or extends the information in this developer note. Apple Publications 0 Developers should have copies of the appropriate Apple reference books, including Guide to the Macintosh Family Hardware, second edition, Designing Cards and Drivers for the Macintosh Family, third edition, and the relevant volumes of Inside Macintosh.
P R E F A C E To order products or to request a complimentary copy of the APDA Tools Catalog, contact APDA Apple Computer, Inc. P.O. Box 319 Buffalo, NY 14207-0319 Telephone 800-282-2732 (United States) 800-637-0029 (Canada) 716-871-6555 (International) Fax 716-871-6511 AppleLink APDA America Online APDAorder CompuServe 76666,2405 Internet APDA@applelink.apple.
P R E F A C E Sidebar Sidebars are used for information that is not part of the main discussion. A sidebar may contain information about a related subject or technical details that are not required reading. Hexadecimal numbers are preceded by a dollar sign ($). For example, the hexadecimal equivalent of decimal 16 is written as $10. ] Note A note like this contains information that is of interest but is not essential for an understanding of the text.
P R E F A C E Other abbreviations used in this note include $n hexadecimal value n AC alternating current ADB Apple Desktop Bus API application program interface ASIC application-specific integrated circuit ATA AT attachment ATAPI ATA packet interface AUI auxiliary unit interface BCD binary coded decimal CAS column address strobe (a memory control signal) CCFL cold cathode fluorescent lamp CD compact disc CIS card information structure CLUT color lookup table CMOS complementary
P R E F A C E xvi NiCad nickel cadmium NiMH nickel metal hydride PCMCIA Personal Computer Memory Card International Association PDS processor-direct slot PROM programmable read-only memory PWM pulse width modulation RAM random-access memory RAMDAC random-access memory, digital to analog converter RAS row address strobe RGB red-green-blue (a type of color video system) RISC reduced instruction set computing rms root-mean-square ROM read-only memory SCC Serial Communications Contr
C H A P T E R Figure 1-0 Listing 1-0 Table 1-0 1 Introduction Thi d t t d ith F 1 M k 404
C H A P T E R 1 Introduction The Macintosh PowerBook 5300 computer is the first of a new generation of all-in-one notebook computers featuring the PowerPC 603 microprocessor. Inside the computer’s contoured case are a PCMCIA slot, an expansion bay for a floppy disk drive or other device, and space for a rechargeable battery. Features 1 Here is a summary of the major features of the Macintosh PowerBook 5300 computer. Each feature is described more fully later in this developer note.
C H A P T E R 1 Introduction ■ Trackpad: The cursor-positioning device is an integrated flat pad that replaces the trackball used in previous Macintosh PowerBook computers. ■ Infrared link: The computer has an infrared module that can communicate with Newton PDAs and other communications devices. ■ Batteries: The computer has space for one Macintosh PowerBook Intelligent Battery. The battery is a 16.
C H A P T E R 1 Introduction Figure 1-2 Back view of the computer Video port IR window PC card slots Reset button PC card eject buttons Sound input jack Power adapter jack Sound output jack ADB port SCSI port (HDI-30) / Serial I/O port Peripheral Devices 1 In addition to the devices that are included with the computer, several peripheral devices are available separately: ■ The Macintosh PowerBook 8 MB Memory Expansion Kit expands the RAM in the Macintosh PowerBook 5300 computer to 16 or
C H A P T E R 1 Introduction Configurations 1 The Macintosh PowerBook 5300 computer is available in several configurations, as shown in Table 1-1.
C H A P T E R 1 Introduction optimizes the available colors. For the active matrix color display, the effective range of the CLUT is about 260,000 colors. For the DualScan color display, the range of the CLUT is about 4000 colors. See the section “Flat Panel Display” beginning on page 24 for more information about the internal display hardware and LCD screen.
C H A P T E R 1 Introduction Developers should not assume that the Power Manager’s data structures are the same on all PowerBook models.
C H A P T E R 1 Introduction While it is essential to use 16-bit alignment for data that is being shared with 680x0 code, you should use PowerPC alignment for all other kinds of data. In particular, you should not use global 680x0 alignment when compiling your PowerPC applications; instead, use alignment pragmas to turn on 680x0 alignment only when necessary.
C H A P T E R Figure 2-0 Listing 2-0 Table 2-0 2 Architecture Thi d t t d ith F 2 M k 404
C H A P T E R 2 Architecture The architecture of the Macintosh PowerBook 5300 computer is partitioned into three subsystems: the processor/memory subsystem, the input/output subsystem, and the video card. The processor/memory subsystem operates at 33.33 MHz on the PowerPC 603 microprocessor bus. The input/output subsystem operates at 25 MHz on the I/O bus, a 68030-compatible bus.
C H A P T E R 2 Architecture Processor/Memory Subsystem 2 The processor/memory subsystem includes the PowerPC 603 microprocessor, main RAM, and ROM. An optional RAM expansion card can be plugged into the logic board and becomes part of the processor/memory subsystem. Main Processor 2 The main processor in the Macintosh PowerBook 5300 computer is a PowerPC 603e microprocessor, an enhanced version of the PowerPC 603.
C H A P T E R 2 Architecture ROM 2 The ROM in the Macintosh PowerBook 5300 computer is implemented as a 1M by 32-bit array consisting of two 1 M by 16-bit ROM ICs. The ROM devices support burst mode so they do not degrade the performance of the PowerPC 603 microprocessor. The ROM ICs provide 4 MB of storage, which is located in the system memory map between addresses $3000 0000 and $3FFF FFFF. The ROM data path is 32 bits wide and addressable only as longwords.
C H A P T E R 2 Architecture Input/Output Subsystem 2 The input/output subsystem includes the components that communicate by way of the I/O bus: ■ the Whitney custom IC ■ the Combo I/O controller IC ■ the Singer sound controller IC ■ the Power Manager IC ■ the display controller IC (ECSC) ■ the Baboon custom IC that controls the expansion bay ■ the TREX custom IC that controls the PCMCIA slots The next sections describe these components.
C H A P T E R 2 Architecture The Whitney IC provides the device select signals for the following ICs: ■ the flat panel display controller ■ the external video controller The Whitney IC also provides the power off and reset signals to the peripheral device ICs. Combo IC 2 The Combo custom IC combines the functions of the SCC IC (85C30 Serial Communications Controller) and the SCSI controller IC (53C80). The SCC portion of the Combo IC supports the serial I/O port.
C H A P T E R 2 Architecture Baboon Custom IC 2 The Baboon custom IC provides the interface to the expansion bay.
C H A P T E R 2 Architecture Video Card 2 The video card includes two additional components that communicate by way of the I/O bus: ■ the Ariel custom video controller IC ■ the Keystone custom video output IC Keystone Video Controller IC 2 The Keystone custom IC contains the timing and control circuits for the external video circuitry. The Keystone IC has internal registers that the video driver uses to set the horizontal and vertical timing parameters.
C H A P T E R Figure 3-0 Listing 3-0 Table 3-0 3 I/O Features Thi d t t d ith F 3 M k 404
C H A P T E R 3 I/O Features This chapter describes both the built-in I/O devices and the interfaces for external I/O devices. Like the earlier chapters, it emphasizes the similarities and differences between the Macintosh PowerBook 5300 computer and other PowerBook models.
C H A P T E R 3 I/O Features Figure 3-1 Maximum dimensions of the internal IDE hard disk 19.25 maximum [0.757 maximum] 3.00 [0.118] 34.93±0.38 [1.375±0.015] 38.10 [1.500] 101.60 maximum [4.00 maximum] 4.06 [0.160] 61.72 [2.430] 70.00 [2.755] M3, 3.5 deep, minimum full thread, 8X Note: Dimensions are in millimeters [inches] Hard Disk Connector 3 The internal hard disk has a 48-pin connector that carries both the IDE signals and the power for the drive.
C H A P T E R 3 I/O Features Figure 3-2 Connector for the internal IDE hard disk 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1 47 45 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 14 12 10 8 6 4 2 48 46 Note: gaps are equivalent to missing pins. Connector Location 3 Figure 3-3 shows the position of the connector on the hard disk drive. Figure 3-3 Position of the hard disk connector Key: vacant position at pin 20 Pin 1 3.99 [0.157] 19.25 maximum [0.
C H A P T E R 3 I/O Features Table 3-1 Pin number Pin assignments on the IDE hard disk connector (continued) Signal name Pin number Signal name 9 DD4 10 DD11 11 DD3 12 DD12 13 DD2 14 DD13 15 DD1 16 DD14 17 DD0 18 DD15 19 GROUND 20 KEY 21 DMARQ 22 GROUND 23 /DIOW 24 GROUND 25 /DIOR 26 GROUND 27 IORDY 28 CSEL 29 /DMACK 30 GROUND 31 INTRQ 32 /IOCS16 33 DA1 34 /PDIAG 35 DA0 36 DA2 37 /CS0 38 /CS1 39 /DASP 40 GROUND 41 +5V LOGIC 42 +5V MO
C H A P T E R 3 I/O Features Table 3-2 Signals on the IDE hard disk connector (continued) Signal name Signal description /CS0 IDE register select signal. It is asserted low to select the main task file registers. The task file registers indicate the command, the sector address, and the sector count. /CS1 IDE register select signal. It is asserted low to select the additional control and status registers on the IDE drive.
C H A P T E R 3 I/O Features The trackpad is a solid-state device that emulates a mouse by sensing the motions of the user’s finger over its surface and translating those motions into ADB commands. The trackpad is lighter and more durable than the trackball used in earlier PowerBook computers, and it consumes less power. Also see the section “Trackpad Support” on page 65. Keyboard 3 A new keyboard design provides 76 (United States) or 77 (ISO) keys, including 12 function keys.
C H A P T E R 3 I/O Features After removing two screws, the user can lift out the keyboard to obtain access to the internal components and expansion connectors inside the Macintosh PowerBook 5300 computer. Flat Panel Display 3 The Macintosh PowerBook 5300 computer has a built-in flat panel display. Four display options are available, as shown in Table 3-3. All four displays are backlit by a cold cathode fluorescent lamp (CCFL).
C H A P T E R 3 I/O Features Types of Displays Flat panel displays come in two types: active matrix and passive matrix. Active matrix displays, also called thin-film transistor (TFT) displays, have a driving transistor for each individual pixel. The driving transistors give active matrix displays high contrast and fast response time. Passive matrix refers to a display technology that does not have individual transistors.
C H A P T E R 3 I/O Features Table 3-4 Serial port signals Pin number Signal name Signal description 1 HSKo Handshake output 2 HSKi Handshake input 3 TxD– Transmit data – 4 SG Signal ground 5 RxD– Receive data – 6 TxD+ Transmit data + 7 GPi General-purpose input 8 RxD+ Receive data + Table 3-5 shows the signal assignments for the external SCSI connector. Note that pin 1 of the external SCSI connector is the /SCSI.DISK.MODE signal.
C H A P T E R 3 I/O Features ADB Port 3 The Apple Desktop Bus (ADB) port on the Macintosh PowerBook 5300 computer is functionally the same as on other Macintosh computers. The ADB connector is a 4-pin mini-DIN connector. Figure 3-7 shows the arrangement of the pins on the ADB connector.
C H A P T E R 3 I/O Features Infrared Module 3 The computer has an infrared (IR) module connected internally to serial port B. The IR module can communicate with Newton PDAs and other communications devices. When the computer is placed within a few feet of another machine with an IR interface, it can send and receive serial data using one of several standard communications protocols.
C H A P T E R 3 I/O Features Sound Inputs 3 The sound system accepts inputs from several sources: ■ built-in microphone ■ external sound input jack ■ sound from the expansion bay ■ 1-bit sound from the PCMCIA slot The sound signal from the built-in microphone goes through a dedicated preamplifier that raises its nominal 30-mV level to the 1-V level of the codec circuits in the Singer IC.
C H A P T E R 3 I/O Features The sound output jack provides enough current to drive a pair of low-impedance headphones. The sound output jack has the following electrical characteristics: ■ output impedance: 33 Ω ■ minimum recommended load impedance: 32 Ω ■ maximum level: 1 V rms ■ maximum current: 32 mA peak The computer turns off the sound signals to the internal speaker when an external device is connected to the sound output jack and during power cycling.
C H A P T E R Figure 4-0 Listing 4-0 Table 4-0 4 Expansion Modules Thi d t t d ith F M k 404 4
C H A P T E R 4 Expansion Modules This chapter describes each of the following expansion features of the Macintosh PowerBook 5300 computer: ■ expansion bay ■ RAM expansion ■ video card (for an external monitor) ■ PCMCIA slot Expansion Bay 4 The expansion bay is an opening in the Macintosh PowerBook 5300 computer that accepts a plug-in disk drive such as a floppy disk. The expansion bay can also accept a power device such as an AC adapter or a second battery.
C H A P T E R 4 Expansion Modules Figure 4-2 Expansion bay dimensions 18.00 [0.709] 106.00 [4.173] 145.75 [5.738] Note: Dimensions are in millimeters [inches] Expansion Bay Connector 4 The expansion bay connector is a 90-pin shielded connector. The pins are divided into two groups by a gap. Pins 1 and 46 are at the end of the connector nearest the gap; pins 45 and 90 are at the end farthest from the gap. The connector on the main logic board is AMP part number C-93-1817-53.
C H A P T E R 4 Expansion Modules Signals on the Expansion Bay Connector 4 Table 4-1 shows the signal assignments on the expansion bay connector. Signal names that begin with a slash (/) are active low.
C H A P T E R 4 Expansion Modules Table 4-1 Signal assignments on the expansion bay connector (continued) Pin number Signal name Pin number Signal name 53 Reserved 72 IDE_D(4) 54 DEV_ID(0) 73 IDE_D(6) 55 DEV_ID(2) 74 GND 56 Reserved 75 IDE_D(9) 57 Reserved 76 IDE_D(11) 58 GND 77 IDE_D(12) 59 PHASE(1) 78 IDE_D(14) 60 PHASE(2) 79 GND 61 GND 80 /DIOW 62 MB_+5V 81 /CS1FX 63 /FL_ENABLE 82 IDE_ADDR(0) 64 /MB_IDE_RST 83 IDE_ADDR(2) 65 Reserved 84 GND 66
C H A P T E R 4 Expansion Modules Signal Definitions 4 The signals on the expansion bay connector are of three types: expansion bay control signals, floppy disk signals, and IDE signals. The next three tables describe the three types of signals: Table 4-2 describes the control signals, Table 4-3 describes the floppy disk signals, and Table 4-4 describes the IDE signals.
C H A P T E R 4 Expansion Modules Table 4-4 IDE signals on the expansion bay connector (continued) Signal name Signal description /DIOW IDE I/O data write strobe. IDE_ADDR(0–2) IDE device address; used by the computer to select one of the registers in the IDE drive. For more information, see the descriptions of the /CS1FX and /CS3FX signals. IDE_D(0–15) IDE data bus, buffered from IOD(16–31) of the controller IC. IDE_D(0–15) are used to transfer 16-bit data to and from the drive buffer.
C H A P T E R 4 Expansion Modules Power on the Expansion Bay 4 Table 4-6 describes the power lines on the expansion bay connector. The MB_+5V line is controlled by the MB_PWR_EN signal from the Power Manager IC. The current drawn from MB_+5V must not exceed 1.0 A. Table 4-6 Power for the expansion bay Signal name Signal description GND Ground. MB_+5V 5 V power; maximum total current is 1.0 A.
C H A P T E R 4 Expansion Modules Guidelines for Developers 4 Each expansion bay device must be designed to prevent damage to itself and to the computer when the user inserts or removes an expansion bay device with the computer running. The expansion bay connector is designed so that when the device is inserted the ground and power pins make contact before the signal lines.
C H A P T E R 4 Expansion Modules Electrical Design Guidelines for the RAM Expansion Card 4 This section provides the electrical information you need to design a RAM expansion card for the Macintosh PowerBook 5300 computer. The mechanical specifications are given in a subsequent section, beginning on page 47. Connector Pin Assignments 4 Table 4-8 lists the names of the signals on the RAM expansion connector.
C H A P T E R 4 Expansion Modules Table 4-8 Pin Signal assignments on the RAM expansion connector (continued) Signal name Pin Signal name 45 DataL(18) 46 DataH(18) 47 DataL(19) 48 DataH(19) 49 DataL(12) 50 DataH(12) 51 +3V_MAIN 52 +3V_MAIN 53 DataL(13) 54 DataH(13) 55 DataL(14) 56 DataH(14) 57 DataL(15) 58 DataH(15) 59 +5V_MAIN 60 +5V_MAIN 61 DataL(8) 62 DataH(8) 63 GND 64 /RAM_OE 65 DataL(9) 66 DataH(9) 67 DataL(10) 68 DataH(10) 69 DataL(11) 70 Data
C H A P T E R 4 Expansion Modules Table 4-8 Signal assignments on the RAM expansion connector (continued) Pin Signal name Pin Signal name 107 RA(9) 108 /RASL(0) 109 /RASL(1) 110 /RASL(3) 111 /CASL(1) 112 +12V 113 /CASL(0) 114 /RASH(0) 115 /CASL(2) 116 /RASH(3) 117 +5V_MAIN 118 +3V_MAIN 119 GND 120 GND Signal Descriptions 4 Table 4-9 describes the signals on the RAM expansion connector. Signal names that begin with a slash (/) are active low.
C H A P T E R 4 Expansion Modules Table 4-9 Descriptions of signals on the RAM expansion connector (continued) Signal name Description GND Chassis and logic ground. RA(0–11) Multiplexed row and column address to the DRAM devices. (See the section “Address Multiplexing” on page 43 to determine which bits to use for a particular type of DRAM device.) RAM_OE Output enable signal to the DRAM devices.
C H A P T E R 4 Expansion Modules Table 4-10 also shows how the signals are multiplexed during the row and column address phases. For each type of DRAM device, the first and second rows show the actual address bits that drive each address pin during row addressing and column addressing, respectively. The third row shows how the device’s address pins are connected to the signals on the RA(0-11) bus. IMPORTANT Some types of DRAM devices don’t use all 12 bits in the row or column address.
C H A P T E R 4 Expansion Modules Table 4-10 Address multiplexing for some typical DRAM devices (continued) Individual signals on DRAM_ADDR bus Type of DRAM device [11] [10] [9] [8] [7] [6] [5] [4] [3] [2] [1] [0] Row address bits 21 22 20 18 17 16 15 14 13 12 11 10 Column address bits 19 23 21 19 9 8 7 6 5 4 3 2 Device address pins — — 9 8 7 6 5 4 3 2 1 0 512K by 8; 10 row bits, 9 column bits Note The address multiplexing scheme used in the Macinto
C H A P T E R 4 Expansion Modules Note The DRAM refresh operation depends on the state of the computer. When the computer is operating normally, the PBX IC provides refresh signals consisting of 2048 CAS before RAS cycles every 128 ms. When the computer goes into sleep mode, the PBX IC switches the DRAM devices to their self-refresh feature to save power. See also “PBX Memory Controller IC” on page 12.
C H A P T E R 4 Expansion Modules Mechanical Design of the RAM Expansion Card 4 All the components of the RAM expansion card, including the connector, are on the same side of the card, as shown in Figure 4-3. Figure 4-3 RAM expansion card Connector Low-profile memory ICs (typical configuration) IMPORTANT The component side is the bottom side when the card is installed. The top surface of the board must have no components or component leads.
C H A P T E R 4 Expansion Modules Figure 4-5 shows the maximum component height and the restricted areas on the bottom (component side) of the card. Only the connector can exceed the height limit shown. Figure 4-5 Restricted areas on the component side of the card 77.00 [3.031] 2X 6.00 [.236] 6.00 [.236] No components or traces Component height restricted to 1.42 [.056] maximum 2X 81.83 [3.
C H A P T E R 4 Expansion Modules Video Card 4 The Macintosh PowerBook 5300 computer accepts an optional video card that provides support for an external video monitor. This section describes the video card that Apple provides and includes a design guide for developers who wish to design such a card. The Apple Video Card 4 Apple provides an optional video card for the Macintosh PowerBook 5300 computer. Figure 4-6 shows its general appearance.
C H A P T E R 4 Expansion Modules Table 4-11 lists the video monitors supported by the video card. Table 4-11 Video monitors and modes Monitor type Width (pixels) Height (pixels) Maximum pixel depth (bits) Frame rate (Hz) 12-inch RGB 512 384 8 60.15 640 480 8 66.67 Portrait 640 870 4 75.0 16-inch RGB 832 624 8 66.67 17-inch multiscan 640 480 8 66.67 17-inch multiscan 832 624 8 75.0 VGA or SVGA 640 480 8 59.95 SVGA 800 600 8 55.
C H A P T E R 4 Expansion Modules External Video Connector 4 The video card for the Macintosh PowerBook 5300 computer has the same type VID-14 video output connector as the PowerBook 520 and 540 computers. An optional adapter cable allows the user to attach a standard Apple video cable. Table 4-12 lists the signal pin assignments for both the VID-14 connector on the card and the DB-15 connector on the adapter cable.
C H A P T E R 4 Expansion Modules Figure 4-7 Video connectors 2 4 6 8 10 12 14 1 3 5 7 9 11 13 VID-14 connector socket 8 7 15 6 14 5 13 4 12 3 11 2 10 1 9 DB-15 connector socket Monitor Sense Codes 4 To identify the type of monitor connected, the video card uses the Apple monitor sense codes on the signals SENSE0-2 in Table 4-12. Table 4-13 shows the sense codes and the extended sense codes for each of the monitors the card can support. Refer to the Macintosh Technical Note M.
C H A P T E R 4 Expansion Modules Video Card Design Guide 4 This section gives electrical and mechanical specifications for developers who wish to design a video card for the Macintosh PowerBook 5300 computer. Video Card Connector 4 The video card is connected to the computer’s main logic board by an 80-pin connector. The connector on the card is a surface-mount connector with 0.8-mm pitch, part number KX14-80K5E9 manufactured by JAE Electronics.
C H A P T E R 4 Expansion Modules Table 4-14 Signals on the video card connector (continued) Pin number Signal name Pin number Signal name 39 IO_DATA(23) 40 IO_DATA(18) 41 /AS 42 IO_RW 43 /IO_RESET 44 /DSACK(0) 45 +5V 46 +5V 47 SIZ(1) 48 /DSACK(0) 49 SIZ(0) 50 IO_ADDR(0) 51 IO_ADDR(2) 52 IO_ADDR(1) 53 IO_ADDR(5) 54 IO_ADDR(3) 55 IO_ADDR(17) 56 IO_ADDR(4) 57 IO_ADDR(19) 58 IO_ADDR(7) 59 IO_ADDR(15) 60 IO_ADDR(6) 61 IO_ADDR(21) 62 IO_ADDR(10) 63 IO_ADD
C H A P T E R 4 Expansion Modules Table 4-15 Descriptions of the signals on the video card connector Signal name Description /AS Address strobe (68030 bus) BUF_IOCLK 25 MHz I/O clock /DSACK(1:0) Bus data acknowledge (68030 bus) /EXT_VID_CS /CS for locations $FDXX XXXX IO_ADDR(23:0) Address bus (68030 bus) IO_DATA(31:0) Data bus (68030 bus) IO_RESET Device reset; active low IO_RW Read/write (68030 bus) /KEY_CS /CS for locations $FEXX XXXX; reserved SIZ(1:0) Size of video RAM VID_CL
C H A P T E R 4 Expansion Modules Figure 4-9 is a bottom view of the video card and shows the position of the 80-pin connector (callout 3). Figure 4-10 and Figure 4-11 show the component restrictions on the bottom and top of the card. Figure 4-9 Video card and 80-pin connector PIN 1 3 6.29 [.248] PIN 2 22.23 [.875] Note: Dimensions are in millimeters [inches] Figure 4-10 Video card bottom view with component restrictions 39.58 [1.558] 1.71 [.067] See Figure 4-12 1.69 [.067] 3.74 [.147] 29.
C H A P T E R 4 Expansion Modules Figure 4-11 Video card top view with component restrictions Component height restricted to 4.00 [.157] maximum Component height restricted to 6.50 [.256] maximum 85.18 [3.354] 9.90 [.390] 16.30 [.642] No component allowed 10.40 [.409] Note: Dimensions are in millimeters [inches] Figure 4-12 is a top view of the video card showing the position of the foam block that helps hold the card in the proper position. Figure 4-12 Video card top view Foam block 16.
C H A P T E R 4 Expansion Modules Figure 4-13 is a detail drawing showing the dimensions of the three mounting holes for the EMI shield Figure 4-13 0.80 [.031] Detail of EMI shield mounting holes 1.53 [.060] 0.40 [.016] 3.05 [.120] Note: Dimensions are in millimeters [inches] The thickness of the video card’s PC board is 1.30 mm [0.051 inches]. PCMCIA Slot 4 The Macintosh PowerBook 5300 computer has a PCMCIA slot that can accept two type II PC cards or one type III PC card.
C H A P T E R 4 Expansion Modules and ejecting cards when they’re dragged to the trash. The Finder extension also helps a client provide custom features such as icons, card names, card types, and help messages. Summary Specifications 4 The PCMCIA slot in the Macintosh PowerBook 5300 computer contains two standard PC card sockets. Each socket accepts either a Type I or Type II card. The PCMCIA slot also accepts one Type III card, which occupies both sockets.
C H A P T E R 4 Expansion Modules Signal Definitions 4 Certain signals on the PC card sockets are defined as follows: ■ BVD1, BVD2: Battery voltage signals (status and interrupt) ■ WP: Write protect (status and interrupt) ■ RDY/BSY: Ready/Busy signal (status and interrupt) ■ WAIT: Used to delay access (maximum asserted time is 10 µS) ■ IRQ: Interrupt request, level mode only (pulse mode is not supported) ■ SPKR: Speaker (digital audio output) ■ STSCHG/RI: Status change and ring indicator (
C H A P T E R Figure 5-0 Listing 5-0 Table 5-0 5 Software Features Thi d t t d ith F M k 404 5
C H A P T E R 5 Software Features This chapter describes the new features of the software for the Macintosh PowerBook 5300 computer. It describes both the built-in ROM and the system software that resides on the hard disk. ROM Software 5 The ROM software in the Macintosh PowerBook 5300 computer is based on the ROM used in previous PowerBook computers, with enhancements to support the new features.
C H A P T E R 5 Software Features Memory Controller Software 5 The memory control routines have been rewritten to operate with the PBX memory controller IC, which has a control register configuration different from that of the memory controller used in earlier PowerBook models.
C H A P T E R 5 Software Features ATA Storage Devices 5 Support for ATA storage devices (the internal IDE drive, PCMCIA drives, and ATAPI CD-ROM drives) is incorporated in the ROM software. IDE Disk Mode 5 The ROM software also includes modifications to support disk mode. In previous PowerBook models, the internal hard disk was a SCSI drive and the setup for disk access from another computer was called SCSI disk mode.
C H A P T E R 5 Software Features Trackpad Support 5 The trackpad hardware, the Power Manager IC, and the system software work together to translate the movements of a finger across the surface of the trackpad into cursor movements. The control registers for the trackpad hardware are part of the Power Manager IC. The Power Manager’s software takes the raw data from the trackpad hardware and converts it to the same format as ADB mouse data before sending it on to the system software.
C H A P T E R 5 Software Features Note For those changes that affect the software, information about new or modified APIs is given elsewhere. Please see the cross references in the individual sections. ◆ Control Strip 5 The desktop on the Macintosh PowerBook 5300 computer has the status and control element called the control strip that was introduced in the PowerBook 280 and the PowerBook 500 models. It is a strip of graphics with small button controls and indicators in the form of various icons.
C H A P T E R 5 Software Features System-Level Software 5 Several system components have been modified to use the 64-bit API to correctly calculate true volume sizes and read and write data to and from large disks.
C H A P T E R 5 Software Features Limitations 5 The software modifications that support large partition sizes do not solve all the problems associated with the use of large volumes. In particular, the modifications do not address the following: ■ HFS file sizes are still limited to 2 GB or less. ■ Large allocation block sizes cause inefficient storage. On a 2 GB volume, the minimum file size is 32 KB; on a 2 terabyte volume, the minimum file size is a whopping 32 MB.
C H A P T E R 5 Software Features The DR Emulator provides a high degree of compatibility for 680x0 code. One area where compatibility will be less than that of the current interpretive emulator is for self-modifying code that does not call the cache flushing routines. Such code also has compatibility problems on Macintosh Quadra models with the cache enabled.
C H A P T E R 5 Software Features Note The new BlockMove extensions do not use the string instructions, which are fast on the PowerPC 601 but slow on other PowerPC implementations. ◆ Some of the new BlockMove extensions can be called only from native code; see Table 5-1. Except for BlockZero and BlockZeroUncached, the new BlockMove extensions use the same parameters as BlockMove. Calls to BlockZero and BlockZeroUncached have only two parameters, a pointer and a length; refer to the header file (Memory.
C H A P T E R 5 Software Features IMPORTANT Driver software cannot call the BlockMove routines directly. Instead, drivers must use the BlockCopy routine, which is part of the Driver Services Library. The BlockCopy routine is an abstraction that allows you to postpone binding the specific type of BlockMove operation until implementation time. ▲ The Driver Services Library is a collection of useful routines that Apple Computer provides for developers working with the new Power Macintosh models.
C H A P T E R 5 Software Features POWER Emulation 5 Earlier Power Macintosh computers included emulation for certain PowerPC 601 instructions that would otherwise cause an exception. The emulation code dealt with memory reference instructions to handle alignment and data storage exceptions. It also handled illegal instruction exceptions caused by some PowerPC instructions that were not implemented in the PowerPC 601.
C H A P T E R 5 Software Features IMPORTANT The emulation software in the Macintosh PowerBook 5300 computer cannot make the separate caches in the PowerPC 603 behave like the combined cache in the PowerPC 601. Applications that generate executable code in memory must be modified to use the Code Fragment Manager or maintain proper cache synchronization by other means.
C H A P T E R 5 Software Features Display Manager 5 Until now, system software has used the NuBus-specific Slot Manager to get and set information about display cards and drivers. New system software removes this explicit software dependency on the architecture of the expansion bus. The Display Manager provides a uniform API for display devices regardless of the implementation details of the devices.
C H A P T E R Figure 6-0 Listing 6-0 Table 6-0 6 Large Volume Support Thi d t t d ith F M k 404 6
C H A P T E R 6 Large Volume Support This chapter describes the large volume file system for the Macintosh PowerBook 5300 computer. The large volume file system is a version of the hierarchical file system (HFS) that has been modified to support volume sizes larger than the current 4 GB limit. It incorporates only the changes required to achieve that goal.
C H A P T E R 6 Large Volume Support The maximum number of files will continue to be less than 65,000. This limit is directly related to the fixed number of allocation blocks. File Size Limits 6 The HFS has a maximum file size of 2 GB. The large volume file system does not remove that limit because doing so would require a more extensive change to the current API and would incur more compatibility problems.
C H A P T E R 6 Large Volume Support struct XVolumeParam ParamBlockHeader unsigned long short unsigned long unsigned long unsigned short unsigned short unsigned short unsigned short unsigned short unsigned long unsigned long unsigned short unsigned long unsigned short unsigned short short short short unsigned long unsigned short unsigned long unsigned long unsigned long long uint64 uint64 }; { ioXVersion; ioVolIndex; ioVCrDate; ioVLsMod; ioVAtrb; ioVNmFls; ioVBitMap; ioAllocPtr; ioVNmAlBlks; ioVAlBlkSiz
C H A P T E R 6 Large Volume Support ioVNxtCNID ioVFrBlk ioVSigWord ioVDrvInfo ioVDRefNum ioVFSID ioVBkUp ioVSeqNum ioVWrCnt ioVFilCnt ioVDirCnt ioVFndrInfo The next unused catalog node ID. The number of unused allocation blocks. A signature word identifying the type of volume; it’s $D2D7 for MFS volumes and $4244 for volumes that support HFS calls. The drive number of the drive containing the volume. For online volumes, the reference number of the I/O driver for the drive identified by ioVDrvInfo.
C H A P T E R 6 Large Volume Support char ioPermssn; // Ptr ioMisc; // Ptr ioBuffer; // unsigned long ioReqCount; // unsigned long ioActCount; // short ioPosMode; // int64 ioWPosOffset;// read/write permission miscellaneous data buffer requested number of bytes actual number of bytes positioning mode (wide mode set) wide positioning offset }; Field descriptions ioRefNum ioVersNum ioPermssn ioMisc ioBuffer ioReqCount ioActCount ioPosMode The file reference number of an open file. A version number.
C H A P T E R 6 Large Volume Support New Extended Function 6 This section describes the extended PBXGetVolInfo function that provides volume size information for volumes greater than 4 GB. Before using the new extended call, you should check for availability by calling the Gestalt function. Make your call to Gestalt with the gestaltFSAttr selector to check for new File Manager features.
C H A P T E R 6 Large Volume Support ← ioVAtrb unsigned short Volume attributes. ← ioVNmFls unsigned short Number of files in the root directory. ← ioVBitMap unsigned short First block of the volume bitmap. ← ioVAllocPtr unsigned short Block where the next new file starts. ← ioVNmAlBlks unsigned short Number of allocation blocks. ← ioVAlBlkSiz unsigned long Size of allocation blocks. ← ioVClpSiz unsigned long Default clump size.
C H A P T E R 6 Large Volume Support ASSEMBLY-LANGUAGE INFORMATION The trap macro and routine selector for PBXGetVolInfo are: Trap macro Selector _HFSDispatch $0012 RESULT CODES noErr nsvErr paramErr 0 –35 –50 The API Modifications Successful completion, no error occurred No such volume No default volume 83
C H A P T E R Figure 7-0 Listing 7-0 Table 7-0 7 Power Manager Interface Thi d t t d ith F M k 404 7
C H A P T E R 7 Power Manager Interface This chapter describes the new application programming interface (API) to the Power Manager control software in the Macintosh PowerBook 5300 computer. About the Power Manager Interface 7 Developers have written control panel software for previous Macintosh PowerBook models to give the user more control over the power management settings than is provided in the PowerBook control panel.
C H A P T E R 7 Power Manager Interface Checking for Routines 7 Before calling any of the Power Manager interface routines, it’s always a good idea to call the Gestalt Manager to see if they’re present on the computer. The Gestalt Manager is described in Inside Macintosh: Overview. A new bit has been added to the gestaltPowerMgrAttr selector: #define gestaltPMgrDispatchExists 4 If that bit is set to 1, then the routines are present.
C H A P T E R 7 Power Manager Interface Table 7-1 Interface routines and their selector values Selector value Routine name 88 Decimal Hexadecimal PMSelectorCount 0 $00 PMFeatures 1 $01 GetSleepTimeout 2 $02 SetSleepTimeout 3 $03 GetHardDiskTimeout 4 $04 SetHardDiskTimeout 5 $05 HardDiskPowered 6 $06 SpinDownHardDisk 7 $07 IsSpindownDisabled 8 $08 SetSpindownDisable 9 $09 HardDiskQInstall 10 $0A HardDiskQRemove 11 $0B GetScaledBatteryInfo 12 $0C AutoSleepContro
C H A P T E R 7 Power Manager Interface Assembly-language note All the routines share a single trap, _PowerMgrDispatch ($A09E). The trap is register based; parameters are passed in register D0 and sometimes also in A0. A routine selector value passed in the low word of register D0 determines which routine is executed. ◆ PMSelectorCount 7 You can use the PMSelectorCount routine to determine which routines are implemented.
C H A P T E R 7 Power Manager Interface Field descriptions Bit name Bit number Description hasWakeupTimer 0 The wakeup timer is supported. hasSharedModemPort 1 The hardware forces exclusive access to either SCC port A or the internal modem. (If this bit is not set, then typically port A and the internal modem may be used simultaneously by means of the Communications Toolbox.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for GetSleepTimeout is 2 ($02) in the low word of register D0. The sleep timeout value is returned in the low word of register D0. SetSleepTimeout 7 You can use the SetSleepTimeout routine to set how long the computer will wait before going to sleep.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for GetHardDiskTimeout is 4 ($04) in the low word of register D0. The hard disk timeout value is returned in the low word of register D0. SetHardDiskTimeout 7 You can use the SetHardDiskTimeout routine to set how long the computer will wait before turning off power to the internal hard disk.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for HardDiskPowered is 6 ($06) in the low word of register D0. The Boolean result is returned in the low word of register D0. SpinDownHardDisk 7 You can use the SpinDownHardDisk routine to force the hard disk to spin down.
C H A P T E R 7 Power Manager Interface SetSpindownDisable 7 You can use the SetSpindownDisable routine to disable hard disk spindown. void SetSpindownDisable(Boolean setDisable); DESCRIPTION The SetSpindownDisable routine enables or disables hard disk spindown, depending on the value of setDisable. If the value of setDisable is true, hard disk spindown will be disabled; if the value is false, spindown will be enabled.
C H A P T E R 7 Power Manager Interface When power to the internal hard disk is about to be turned off, the software calls the routine pointed to by the hdProc field so that it can do any special processing. The software passes the routine a pointer to its queue element so that, for example, the routine can reference its variables.
C H A P T E R 7 Power Manager Interface DESCRIPTION The GetScaledBatteryInfo routine provides a generic means of returning information about the battery or batteries in the system. Instead of returning a voltage value, the routine returns the battery level as a fraction of the total possible voltage. Note New battery technologies such as NiCad (nickel cadmium) and nickel metal hydride (NiMH) have replaced the sealed lead acid batteries of the original Macintosh Portable.
C H A P T E R 7 Power Manager Interface Field descriptions Bit name Bit number Description batteryInstalled 7 A battery is installed. batteryCharging 6 The battery is charging. chargerConnected 5 The charger is connected. The value of warningLevel is the battery level at which the first low battery warning message will appear. The routine returns a value of 0 in some cases when it’s not appropriate to return the warning level. The value of batteryLevel is the current level of the battery.
C H A P T E R 7 Power Manager Interface IMPORTANT Calling AutoSleepControl with enableSleep set to false multiple times increments the auto sleep disable level so that it requires the same number of calls to AutoSleepControl with enableSleep set to true to reenable the auto sleep feature. If more than one piece of software makes this call, auto sleep may not be reenabled when you think it should be. ▲ ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E).
C H A P T E R 7 Power Manager Interface Bit name Bit number extModemSelected 4 Description The external modem is selected (if this bit is set, then the modem port will be connected to port A of the SCC; if the modem port is not shared by the internal modem and the SCC, then this bit can be ignored). Bits 15–31 contain the modem type, which will take on one of the following values: –1 Modem is installed but type not recognized. 0 No modem is installed. 1 Modem is a serial modem.
C H A P T E R 7 Power Manager Interface Note In some PowerBook computers, there is a hardware switch to connect either port A of the SCC or the internal modem to the modem port. The two are physically separated, but software emulates the serial port interface for those applications that don’t use the Communications Toolbox. You can check the hasSharedModemPort bit returned by PMFeatures to determine which way the computer is set up.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for CurrentProcessorSpeed is 17 ($11) in the low word of register D0. The processor speed value is returned in the low word of register D0. FullProcessorSpeed 7 You can use the FullProcessorSpeed routine to find out whether the computer will run at full speed the next time it restarts.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for SetProcessorSpeed is 19 ($13) in the low word of register D0. The Boolean value to set is passed in the high word of register D0. The Boolean result is returned in register D0. GetSCSIDiskModeAddress 7 You can use the GetSCSIDiskModeAddress routine to find out the SCSI ID the computer uses in SCSI disk mode.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for SetSCSIDiskModeAddress is 21 ($15) in the low word of register D0. The SCSI ID to set is passed in the high word of register D0. GetWakeupTimer 7 You can use the GetWakeupTimer routine to find out when the computer will wake up from sleep mode.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for SetWakeupTimer is 23 ($17) in the low word of register D0. The pointer to WakeupTime is passed in register A0. IsProcessorCyclingEnabled 7 You can use the IsProcessorCyclingEnabled routine to find out whether processor cycling is enabled.
C H A P T E R 7 Power Manager Interface ASSEMBLY-LANGUAGE INFORMATION The trap is _PowerMgrDispatch ($A09E). The selector value for EnableProcessorCycling is 25 ($19) in the low word of register D0. The Boolean value to set is passed in the high word of register D0. BatteryCount 7 You can use the BatteryCount routine to find out how many batteries the computer supports. short BatteryCount(); DESCRIPTION The BatteryCount routine returns the number of batteries supported internally by the computer.
C H A P T E R 7 Power Manager Interface GetBatteryTimes 7 You can use the GetBatteryTimes routine to find out about how much battery time remains. void GetBatteryTimes (short whichBattery, BatteryTimeRec *theTimes); DESCRIPTION The GetBatteryTimes routine returns information about the time remaining on the computer’s battery or batteries.
C H A P T E R 7 Power Manager Interface Header File for Power Manager Dispatch 7 Here is a sample header file for access to the Power Manager. /************************************************************************************ file: PowerMgrDispatch.h contains: header file for access to the Power Manager Copyright 1992-1993 by Apple Computer, Inc. All rights reserved.
C H A P T E R 7 Power Manager Interface /* bits in bitfield returned by GetIntModemInfo and set by SetIntModemState */ #define hasInternalModem 0 /* 1=internal modem installed */ #define intModemRingDetect 1 /* 1=internal modem has detected a ring */ #define intModemOffHook 2 /* 1=internal modem is off hook */ #define intModemRingWakeEnb3 /* 1=wake up on ring is enabled */ #define extModemSelected 4 /* 1=external modem selected */ #define modemSetBit 15 /* 1=set bit, 0=clear bit (SetIntMode
C H A P T E R 7 Power Manager Interface typedef pascal void (*HDSpindownProc)(HDQueueElement *theElement); struct HDQueueElement { Ptr hdQLink; /* pointer to next queue element */ short hdQType; /* queue element type (must be HDQType) */ short hdFlags; /* miscellaneous flags */ HDSpindownProc hdProc; /* pointer to routine to call */ long /* user-defined (variable storage, etc.
C H A P T E R 7 Power Manager Interface #pragma parameter __D0 PMSelectorCount(__D0) short PMSelectorCount() = {0x7000, 0xA09E}; #pragma parameter __D0 PMFeatures unsigned long PMFeatures() = {0x7001, 0xA09E}; #pragma parameter __D0 GetSleepTimeout unsigned char GetSleepTimeout() = {0x7002, 0xA09E}; #pragma parameter __D0 SetSleepTimeout(__D0) void SetSleepTimeout(unsigned char timeout) = {0x4840, 0x303C, 0x0003, 0xA09E}; #pragma parameter __D0 GetHardDiskTimeout unsigned char GetHardDiskTimeout() =
C H A P T E R 7 Power Manager Interface #pragma parameter __D0 SpinDownHardDisk void SpinDownHardDisk() = {0x7007, 0xA09E}; #pragma parameter __D0 IsSpindownDisabled Boolean IsSpindownDisabled() = {0x7008, 0xA09E}; #pragma parameter __D0 SetSpindownDisable(__D0) void SetSpindownDisable(Boolean setDisable) = {0x4840, 0x303C, 0x0009, 0xA09E}; #pragma parameter __D0 HardDiskQInstall(__A0) OSErr HardDiskQInstall(HDQueueElement *theElement) = {0x700A, 0xA09E}; #pragma parameter __D0 HardDiskQRemove(__A0)
C H A P T E R 7 Power Manager Interface #pragma parameter __D0 GetIntModemInfo(__D0) unsigned long GetIntModemInfo() = {0x700E, 0xA09E}; #pragma parameter __D0 SetIntModemState(__D0) void SetIntModemState(short theState) = {0x4840, 0x303C, 0x000F, 0xA09E}; #pragma parameter __D0 MaximumProcessorSpeed short MaximumProcessorSpeed() = {0x7010, 0xA09E}; #pragma parameter __D0 CurrentProcessorSpeed short CurrentProcessorSpeed() = {0x7011, 0xA09E}; #pragma parameter __D0 FullProcessorSpeed Boolean FullProc
C H A P T E R 7 Power Manager Interface #pragma parameter __D0 SetSCSIDiskModeAddress(__D0) void SetSCSIDiskModeAddress(short scsiAddress) = {0x4840, 0x303C, 0x0015, 0xA09E}; #pragma parameter __D0 GetWakeupTimer(__A0) void GetWakeupTimer(WakeupTime *theTime) = {0x7016, 0xA09E}; #pragma parameter __D0 SetWakeupTimer(__A0) void SetWakeupTimer(WakeupTime *theTime) = {0x7017, 0xA09E}; #pragma parameter __D0 IsProcessorCyclingEnabled Boolean IsProcessorCyclingEnabled() = {0x7018, 0xA09E}; #pragma paramet
C H A P T E R 7 Power Manager Interface #pragma parameter __D0 GetBatteryTimes(__D0,__A0) void GetBatteryTimes(BatteryTimeRec *theTimes) = {0x4840, 0x303C, 0x001C, 0xA09E}; #ifdef __cplusplus } #endif #endif 114 About the Power Manager Interface
C H A P T E R Figure 8-0 Listing 8-0 Table 8-0 8 Software for ATA Devices Thi d t t d ith F M k 404 8
C H A P T E R 8 Software for ATA Devices This chapter describes the system software that controls ATA devices in the Macintosh PowerBook 5300 computer. To use the information in this chapter, you should already be familiar with writing programs for the Macintosh computer that call device drivers to manipulate devices directly. You should also be familiar with the ATA/IDE specification, ANSI proposal X3T10/0948D, Revision 2K or later (ATA-2).
C H A P T E R 8 Software for ATA Devices At the system level, the ATA disk driver and the ATA Manager work in the same way that the SCSI Manager and associated SCSI device drivers work. The ATA disk driver provides drive partition, data management, and error-handling services for the operating system as well as support for determining device capacity and controlling device-specific features. The ATA Manager provides data transport services between the ATA hard disk drive and the system.
C H A P T E R 8 Software for ATA Devices the caller until completion. The driver queues asynchronous calls and returns control to the caller; it then executes the requested task in the background during interrupt time. Drives on PC Cards 8 It might seem that the system should treat drives on PC cards like floppy disks because they are removable. On closer examination, the floppy-disk model is not appropriate for such drives.
C H A P T E R 8 Software for ATA Devices The driver maintains independent spindown timers for each PC card drive, allowing it to provide maximum power conservation with one or more drives is inactive. The spindown time, which can be set from the PowerBook control panel, is the same for all drives. Control panels and control strip modules currently provide manual control of spindown for the internal drive by means of calls to the Power Manager. That approach doesn’t work for the PC card drives.
C H A P T E R 8 Software for ATA Devices ATA Disk Driver Reference 8 This section describes the routines provided by the ATA disk driver. The information in this section assumes that you are already familiar with how to use device driver routines on the Macintosh computer. If you are not familiar with Macintosh device drivers, refer to the chapter “Device Manager” in Inside Macintosh: Devices for additional information.
C H A P T E R 8 Software for ATA Devices Table 8-1 Control functions (continued) Value of csCode Definition 23 Drive information 44 Set startup partition 45 Set partition mounting 46 Set partition write protect 48 Clear partition mounting 49 Clear partition write protection 50 Register partition 51 Add a new drive to the drive queue 60 Mount volume 65 Driver-specific need-time code (system task time) 70 Power-mode status management control RESULT CODES noErr controlErr nsDrvErr
C H A P T E R 8 Software for ATA Devices Table 8-2 Status functions Value of csCode Definition 8 Return drive status information 43 Return driver Gestalt information 44 Return partition boot status 45 Return partition mount status 46 Return partition write protect status 51 Return partition information 70 Power mode status information RESULT CODES noErr statusErr nsDrvErr Successful completion, no error occurred Unimplemented status call; could not complete requested operation No such
C H A P T E R 8 Software for ATA Devices RESULT CODES noErr nsDrvErr Successful completion, no error occurred The specified logical drive number does not exist format 8 Because ATA hard drives are low-level formatted at the factory, this function does not perform any operation. The driver returns noErr if the logical drive number is valid. Parameter block → → → ← A value of 6. The logical drive number. None defined. See result codes.
C H A P T E R 8 Software for ATA Devices get drive icon 8 The get drive icon function returns a pointer to the device icon and the device name string to be displayed on the desktop when the media is initialized. If no physical icon is available the function returns the media icon. The icon is an 'ICN#' resource and varies with the system. The device name string is in Pascal format. Parameter block → → → ← ← csCode ioVRefNum csParam[] csParam[0–1] ioResult A value of 21. The logical drive number.
C H A P T E R 8 Software for ATA Devices get drive information 8 The get drive information function returns information about the specified drive as defined on page 470 of Inside Macintosh, Volume V. Note This information is not in Inside Macintosh: Devices. ◆ Because ATA devices are not designated, all drives are designated as unspecified. Also, all drives are specified as SCSI because the only other option is IWM, which applies only to certain floppy disk drives.
C H A P T E R 8 Software for ATA Devices RESULT CODES noErr controlErr nsDrvErr Successful completion, no error occurred Unimplemented control call; could not complete requested operation The specified logical drive number does not exist set partition mounting 8 The set partition mounting function enables the specified partition to be mounted. The partition is specified either by its logical drive or by its block address on the media.
C H A P T E R 8 Software for ATA Devices RESULT CODES noErr controlErr nsDrvErr Successful completion, no error occurred Unimplemented control call; could not complete requested operation The specified logical drive number does not exist clear partition mounting 8 The clear partition mounting function prevents the specified partition from being mounted. The partition is specified either by its logical drive or by its block address on the media.
C H A P T E R 8 Software for ATA Devices RESULT CODES noErr controlErr nsDrvErr Successful completion, no error occurred Unimplemented control call; could not complete requested operation The specified logical drive number does not exist register partition 8 The register partition function supports PC Exchange. It requests the driver to redefine the starting block offset and capacity of an existing partition.
C H A P T E R 8 Software for ATA Devices Parameter block → → → ← ← A value of 51. The logical drive number. Pointer to existing partition. Pointer to new partition. See result codes. csCode ioVRefNum csParam[] csParam[] ioResult RESULT CODES noErr nsDrvErr Successful completion, no error occurred The specified logical drive number does not exist mount volume 8 The mount volume function instructs the driver to post a disk inserted event for the specified partition.
C H A P T E R 8 Software for ATA Devices ■ Idle: The state with moderate power savings. The device can return to the active state within 15 seconds. ■ Sleep: The state with minimum power consumption. The device can return to the active state within 30 seconds. Parameter block → → → csCode ioVRefNum csParam[0] ← ioResult A value of 70. The logical drive number.
C H A P T E R 8 Software for ATA Devices RESULT CODES noErr nsDrvErr Successful completion, no error occurred The specified logical drive number does not exist driver gestalt 8 The driver gestalt function provides the application with information about the ATA hard disk driver and the attached device. Several calls are supported under this function. A Gestalt selector is used to specify a particular call.
C H A P T E R 8 Software for ATA Devices ← driverGestaltResponse ← ioResult Return value based on the driver gestalt selector. The possible return values are: 'sync' true (1), indicating that the driver is synchronous. 'devt' 'disk' indicating a hard disk driver. 'intf' 'ide ' for an IDE (ATA) drive, or 'pcmc' for a PC card drive. 'boot' PRAM value (long). 'vers' Current version number of the driver. 'lpwr' true (1) 'dAPI' true (1) 'purg' Indicates driver can be closed or purged.
C H A P T E R 8 Software for ATA Devices get partition mount status 8 The get partition mount status function returns 1 if the specified partition has mounting enabled, 0 if not enabled or if the partition does not have a partition map entry on the media. The partition is specified either by its associate logical drive or the partition’s block address on the media. Parameter block → → csCode ioVRefNum → csParam[] ← ioResult A value of 45.
C H A P T E R 8 Software for ATA Devices get partition information 8 The get partition information function supports PC Exchange. It requests the driver to return information about the partition specified by ioVRefNum. The csParam field contains a pointer to the device information element for the return information.
C H A P T E R 8 Software for ATA Devices RESULT CODES noErr nsDrvErr statusErr Successful completion, no error occurred The specified logical drive number does not exist The power management information couldn’t be returned due to a manager error ATA Manager Reference 8 This section defines the data structures and functions that are specific to the ATA Manager. The ATA Manager has a single entry point through the trap $AAF1.
C H A P T E R 8 Software for ATA Devices The ATA parameter block header structure is defined as follows: struct ataPBHdr // ATA Manager parameter block header structure { Ptr SInt16 UInt8 UInt8 Ptr ProcPtr OSErr UInt8 UInt8 UInt16 SInt16 UInt32 UInt32 Ptr Ptr UInt16 SInt16 Sint32 ataLink; ataQType; ataPBVers; hdrReserved; hdrReserved2; ataCompletion; ataResult; MgrFCode; ataIOSpeed; ataFlags; hdrReserved3; deviceID; TimeOut; ataPtr1; ataPtr2; ataState; intSemaphores; hdrReserved4; // // // // // // /
C H A P T E R 8 Software for ATA Devices when the request has finished without error, or when the request has terminated due to an error. This field is valid for any manager request. The completion routine is called as follows: pascal void (*RoutinePtr) (ataIOPB *) ataResult The completion routine is called with the associated manager parameter block in the stack. Completion status. This field is returned by the ATA Manager after the request has been completed.
C H A P T E R 8 Software for ATA Devices This pointer field is available for application use. It is not modified by the ATA Manager. ataPtr2 This pointer field is available for application use. It is not modified by the ATA Manager. ataState This field is used by the ATA Manager to keep track of the current bus state. This field must contain 0 when calling the manager. intSemaphores This field is used internally by the ATA Manager. It should be set to 0 before calling the ATA Manager.
C H A P T E R 8 Software for ATA Devices Table 8-3 Control bits in the ataFlags field (continued) Name Bit Definition ProtocolType 4–5 These two bits specify the type of command. The following command types are defined: $0 = standard ATA $1 = PCMCIA/ATA $2 = ATAPI These bits are used to indicate special protocol handling. For ATA command values of $A0 or $A1, this field must contain the ATAPI setting. For all other ATA commands, this field must contain the standard ATA setting. — 6–7 Reserved.
C H A P T E R 8 Software for ATA Devices Table 8-3 Control bits in the ataFlags field (continued) Name Bit Definition QLockOnError 10 When set to 0, this bit indicates that an error during the transaction should not freeze the I/O queue for the device. When an error occurs on an I/O request with this bit set to 0, the next queued request is processed without interruption.
C H A P T E R 8 Software for ATA Devices Functions 8 This section describes the ATA Manager functions that are used to manage and perform data transfers. Each function is requested through a parameter block specific to that service. A request for an ATA function is specified by a function code within the parameter block. The entry point for all the functions is the same. The function names and ATA Manager function codes are shown in Table 8-4.
C H A P T E R 8 Software for ATA Devices It is up to the application that called the ATA_Abort function to clean up the aborted request. Clean up includes parameter block deallocation and O/S reporting. The manager function code for the ATA_Abort function is $10.
C H A P T E R 8 Software for ATA Devices UInt16 UInt16 UInt32 UInt8 UInt8 UInt16 UInt32 UInt32 UInt32 UInt32 UInt32 SInt8 SInt8 SInt8 SInt8 SInt8 SInt8 SInt8 UInt8 UInt8 UInt16 UInt32 ataIOpbSize; ataMaxIOpbSize; ataFeatureFlags; ataVersionNum; ataHBAInquiry; ataReserved2; ataHBAPrivPtr; ataHBAPrivSize; ataAsyncFlags; ataReserved3[4]; ataReserved4; ataReserved5[16]; ataHBAVendor[16]; ataContrlFamily[16]; ataContrlType[16]; ataXPTversion[4]; ataReserved6[4]; ataHBAversion[4]; ataHBAslotType; ataHBAslotNu
C H A P T E R 8 Software for ATA Devices ataHBAPrivSize This field contains the byte size of the HBA’s private data area. This field is currently not supported; it contains a value of 0. ataAsyncFlags These flags indicate which types of asynchronous events the HBA is capable of generating. This field is currently not supported; it contains a value of 0. ataHBAVendor This field contains the vendor ID of the HBA. This is an ASCII text field. ataContrlFamily Reserved.
C H A P T E R 8 Software for ATA Devices Note To insure proper operation, all PCMCIA/ATA and Notify-all device drivers must register using version two, which provides event handling capability.
C H A P T E R 8 Software for ATA Devices This field is reserved. To ensure future compatibility, all reserved fields should be set to 0. ataEHandlerPtr A pointer to driver's event handler routine. This routine will be called whenever an event happens, and the mask bit for the particular event is set in the ataEventMask field is set.
C H A P T E R 8 Software for ATA Devices RESULT CODES Successful completion, no error occurred Specified device is not present Parameter error detected noErr nsDrvErr paramErr ATA_DrvrDeregister 8 You can use the ATA_DrvrDeRegister function to deregister the selected drive. After successful completion of this function, the driver reference number for the drive is set to 0, which indicates that there is no driver in control of this device.
C H A P T E R 8 Software for ATA Devices UInt32 ataEventMask; // → Masks of various events // for event handler // Reserved for future expansion SInt16 Reserved[14]; }; typedef struct ataDrvrRegister ataDrvrRegister; In deregistration of a Notify-all driver, the ataEHandlerPtr field is used to match the entry (because the deviceID field is invalid for registration and deregistration of the Notify-all driver).
C H A P T E R 8 Software for ATA Devices The data structure of the function is as follows: struct ataEject // configuration parameter block { ataPBHdr // Header information UInt16 Reserved[24]; // Reserved }; typedef struct ataEject ataEject; Field descriptions ataPBHdr Reserved[24] See the ataPBHdr parameter block definition on page 136. Field reserved for future use. To ensure future compatibility, all reserved fields should be set to 0.
C H A P T E R 8 Software for ATA Devices devicePB RegBlock; // → Device register images UInt8* packetCDBPtr; // ATAPI packet command block pointer UInt16 ataReserved3[6];// Reserved }; typedef struct ATA_ExecIO ATA_ExecIO; Field descriptions ataPBHdr ataStatusReg ataErrorReg ataReserved BlindTxSize ioBuffer See the parameter block definition on page 136. This field contains the last device status register image. See the ATA specification for status register bit definitions.
C H A P T E R 8 Software for ATA Devices This field contains the ATA device register image structure. Values contained in this structure are written out to the device during the command delivery state. The caller must provide the image prior to calling the ATA Manager.
C H A P T E R 8 Software for ATA Devices AT_WrFltErr AT_SeekErr AT_UncDataErr AT_CorDataErr AT_BadBlkErr AT_DMarkErr AT_IDNFErr ATABusy ATAMgrNotInitialized ATAPBInvalid ATAQLocked ATAReqInProg ATATransTimeOut ATAUnknownState Write fault bit set in status register Seek complete bit not set upon completion Uncorrected data bit set in error register Data corrected bit set in status register Bad block bit set in error register Data mark not found bit set in error register ID not found bit set in error regi
C H A P T E R 8 Software for ATA Devices // Version 2(ataPBVers = 2) structataDrvrRegister // Parameter block structure // for ataPBVers = 2 { ataPBHdr SInt16 drvrRefNum; UInt16 drvrFlags; UInt16 deviceNextID; SInt16 ProcPtr SInt32 Reserved; ataEHandlerPtr drvrContext; UInt32 ataEventMask; SInt16 Reserved[14]; // // // // // // // // // // // // Header information ← Driver reference number → Reserved; set to 0 ← used to specify the next drive ID Reserved -> should be zero ← An event handler rout
C H A P T E R 8 Software for ATA Devices The data structure for the function is as follows: struct { ataPBHdr SInt32 UInt8 UInt8 UInt16 ataGetDevConfiguration// Parameter block // Header information // ↔ socket configuration setting // Reserved for future expansion // Reserved for word alignment // ↔ Mask indicating which // PCMCIA-unique fields // are valid, when set.
C H A P T E R 8 Software for ATA Devices 0: The function waits for the assertion of DRQ bit in the status register before sending the ATAPI command packet. This is the default setting. Bits 7–31: Reserved (set to 0) ataIOSpeedMode This field is reserved for future expansion. pcValid This field indicates which of the PCMCIA unique fields contain valid values. Table 8-6 on page 156 lists the fields corresponding to each bit. RWMultipleCount This field is reserved for future expansion.
C H A P T E R 8 Software for ATA Devices pcCopy pcConfigIndex Table 8-6 This field indicates the current Card Socket/Copy register setting of the PCMCIA device. It is valid only if bit 6 of the pcValid field is set. This field indicates the current Card Option register setting of the PCMCIA device. It is valid only if bit 7 of the pcValid field is set.
C H A P T E R 8 Software for ATA Devices SInt8 SInt8 SInt16 *ataLocationIconPtr; // → Pointer to icon data buffer *ataLocationStringPtr; // → Pointer to location string // data buffer Reserved[18]; // Reserved }; typedef struct DrvLocationIcon DrvLocationIcon; Field descriptions See the ataPBHdr parameter block definition on page 136.
C H A P T E R 8 Software for ATA Devices SInt8 ataErrorReg; SInt16 UInt32 ataReserved; BlindTxSize; UInt8 *DataBuf; UInt32 ataRequestCount; UInt32 ataActualTxCnt; UInt32 ataReserved2; devicePB RegBlock; UInt16 Reserved3[8]; // // // // // // // // // // // // // // ← Last ATA error image; valid if error bit set Reserved ← this field is set to 512 upon returning Buffer for the identify data (512 bytes) ← indicates remaining byte count ← actual transfer count Reserved ← taskfile image sent for t
C H A P T E R 8 Software for ATA Devices ATA_MgrInquiry 8 You can use the ATA_MgrInquiry function to get information, such as the version number, about the ATA Manager. This function may be called prior to the manager initialization, however the system configuration information may be invalid. The manager function code for the ATA_MgrInquiry function is $90.
C H A P T E R 8 Software for ATA Devices IOClkResolution Reserved[17] This field contains the I/O clock resolution in nanoseconds. The current implementation doesn’t support the field (returns 0). This field is reserved. To ensure future compatibility, all reserved fields should be set to 0.
C H A P T E R 8 Software for ATA Devices ATA_NOP 8 The ATA_NOP function performs no operation across the interface and does not change the state of either the manager or the device. This function returns noErr if the drive number is valid. The manager function code for the ATA_NOP function is $00.
C H A P T E R 8 Software for ATA Devices Field descriptions ataPBHdr See the definition of the ataPBHdr on page 136. There are no additional function-specific variations on ataPBHdr for this function. RESULT CODES noErr nsDrvErr ATAMgrNotInitialized Successful completion, no error occurred Specified device is not present ATA Manager not initialized ATA_RegAccess 8 You can use the ATA_RegAccess function to gain access to a particular device register of a selected device.
C H A P T E R 8 Software for ATA Devices UInt16 wordRegValue; // ↔ Word register value read // or to be written } registerValue; // The following fields are valid only if RegSelect = $FFFF UInt16 regMask; // → Mask indicating which // combination of registers // to access.
C H A P T E R 8 Software for ATA Devices Table 8-7 ATA register selectors Selector name Selector Register description DataReg 0 Data register (16-bit access only) ErrorReg 1 Error register (R) or features register (W) SecCntReg 2 Sector count register SecNumReg 3 Sector number register CylLoReg 4 Cylinder low register CylHiReg 5 Cylinder high register SDHReg 6 SDH register StatusReg CmdReg 7 Status register (R) or command register (W) AltStatus DevCntr $0E Alternate status
C H A P T E R 8 Software for ATA Devices 4. Sector Count register 5. Sector Number register 6. Cylinder Low register 7. Cylinder High register 8. Status register (R) or Command register (W) RESULT CODES noErr nsDrvErr Successful completion, no error occurred Specified device is not present ATA_ResetBus 8 You can use the ATA_ResetBus function to reset the specified ATA bus. This function performs a soft reset operation to the selected ATA bus.
C H A P T E R 8 Software for ATA Devices Field descriptions ataPBHdr Status Reserved[23] See the definition of the ataPBHdr parameter block on page 136. This field contains the last device status register image following the bus reset. See the ATA/IDE specification for definitions of the status register bits. This field is reserved. To ensure future compatibility, all reserved fields should be set to 0.
C H A P T E R 8 Software for ATA Devices UInt8 UInt8 pcPin; pcCopy; UInt8 UInt16 pcConfigIndex; Reserved[10]; // // // // // ↔ Card Pin register setting ↔ Card Socket/Copy register setting ↔ Card Option register setting Reserved }; typedef struct ataSetDevConfiguration ataSetDevConfiguration; Field descriptions See the ataPBHdr parameter block definition on page 136. This field controls various configuration settings.
C H A P T E R 8 Software for ATA Devices pcCopy pcConfigIndex This field indicates the new Card Socket/Copy Register setting of the PCMCIA device. It is valid only if the bit 6 of the pcValid field is set. This field indicates the new Card Option Register setting of the PCMCIA device. It is valid only if the bit 7 of the pcValid field is set.
C H A P T E R 8 Software for ATA Devices Table 8-9 Event code Event codes send by the ATA Manager (continued) Event description The client should let the O/S know about the presence of the device, if not done so already, verify the device type, and upload any device characteristics. $02 Offline event; signifies that the device has gone offline. This event may happen as a result of several actions: ■ A device has been manually removed from the socket.
C H A P T E R 8 Software for ATA Devices Once the driver loading and initialization sequence has been performed for a particular device, the process is not repeated until one of the following situations occurs: ■ system restart ■ device ejection followed by an insertion ■ shutdown and re-initialization of the manager; but only if the existingGlobalPtr field of the parameter block is invalid. ■ a Notify-all driver registration occurs.
C H A P T E R 8 Software for ATA Devices Table 8-11 Input parameter bits for the new API Bits Value Definition 31-24 Reserved In this byte, bits 29–31 are currently defined. All other bits should be set to 0.
C H A P T E R 8 Software for ATA Devices The typical sequence of the media driver during the Open() call is as follows: 1. Allocate driver globals 2. Initialize the globals 3. Install any system tasks, such as VBL, time manager, shutdown procedure, and the like. Initialize the device and its parameters 4. Register the device with the ATA Manager. The driver is expected to fail the Open() operation if an error is returned from the driver registration call for a given device.
C H A P T E R 8 Software for ATA Devices ROM Driver Notification 8 If no driver indicates that it controls the device, the ATA Manager calls the ATA HD driver in the system ROM. The ROM driver is called only for an HD device. For the Macintosh 630 models, as in the case of the media driver, the called address is the first byte of the driver. For all other Macintosh models, the called address is offset by 8 bytes.
C H A P T E R 8 Software for ATA Devices The driver must either return a statusErr indicating that the call is not supported or return one of the three values defined in the purgePermission field of the response structure described above. If an error or an illegal value is returned in response to the call, then the manager treats as if the response of 0 is received. The three possible purge permissions are listed in Table 8-12. All other response values are reserved and should not be used.
C H A P T E R 8 Software for ATA Devices Setting the I/O Speed 8 The ATA controllers used in Macintosh systems have their I/O cycle time adjustable to optimize the data transfers. There are two mechanisms for setting the I/O cycle time: the ataIOSpeed field of the parameter block header (this field is only valid when a data transfer is involved) and the ataIOSpeedMode field of the ATA Set Socket Configuration function.
C H A P T E R 8 Software for ATA Devices Table 8-13 Error code (new) Error code (old) $DB45 (–9403) ATA driver error codes (continued) Error name Error description $F905 (–1787) AT_DMarkErr Data mark not found reported by device. $DB46 (–9402) $F906 (–1786) AT_BadBlkErr Bad block detected by device. $DB47 (–9401) $F907 (–1785) AT_CorDataErr Notification that data was corrected (good data). $DB48 (–9400) $F906 (–1784) AT_UncDataErr Unable to correct data (possibly bad data).
C H A P T E R 8 Software for ATA Devices Table 8-13 Error code (new) Error code (old) $DB77 (–9353) ATA driver error codes (continued) Error name Error description $F8EF (–1809) ATAQLocked I/O queue for the port is locked due to a previous I/O error. It must be unlocked prior to continuing. $DB78 (–9352) $F8EE (–1810) ATAReqAborted The I/O queue entry was aborted due to an abort command. $DB79 (–9351) $F8ED (–1811) ATAUnableToAbort The I/O queue entry could not be aborted.
C H A P T E R Figure 9-0 Listing 9-0 Table 9-0 9 PC Card Services Thi d t t d ith F M k 404 9
C H A P T E R 9 PC Card Services This chapter describes the Card Services part of the PC Card Manager. The PC Card Manager is a new part of Mac OS that lets software use PC cards. The PC Card Manager helps client software recognize, configure, and view PC cards that are inserted into PC card sockets on PowerBook computers.
C H A P T E R 9 PC Card Services UInt16 UInt16 socket; attributes; // → logical socket number // → bitmap of attributes }; // 'attributes' field values enum { csClientsForAllSockets= 0x0000, csClientsThisSocketOnly= 0x0001 }; DESCRIPTION The CSGetFirstClient function returns a clientHandle value to the first client in Card Services’ global client queue.
C H A P T E R 9 PC Card Services DESCRIPTION The CSGetNextClient function returns the next clientHandle in Card Services’ global client queue. If the caller specifies csClientsThisSocketOnly and passes in a valid socket number, Card Services returns the next client whose event mask for the given socket is not NULL.
C H A P T E R 9 PC Card Services UInt8 *vendorString;// ← pointer to vendor string // (zero-terminated) } ClientInfo; struct { UInt16 UInt16 SInt16 UInt8 // // // // socket; // reserved; // length; // // *text; // upper byte of attributes is csCardNameSubfunction, csCardTypeSubfunction, csHelpStringSubfunction → logical socket number → zero ↔ in: max length of string, out: actual length <- pointer to string (zero-terminated) } AlternateTextString; struct // upper byte of attributes is // csCardIcon
C H A P T E R 9 PC Card Services csInfoSubfunctionMask csClientInfoSubfunction csCardNameSubfunction csCardTypeSubfunction csHelpStringSubfunction csCardIconSubfunction csActionProcSubfunction = = = = = = = 0xFF00, 0x0000, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400 }; DESCRIPTION The CSGetClientInfo function is used to obtain information about a client from the Card Service’s global client queue.
C H A P T E R 9 PC Card Services RESULT CODES SUCCESS BAD_HANDLE No error Invalid clientHandle value Configuration 9 The functions described in this section help you configure cards and sockets. CSGetConfigurationInfo 9 You can use the CSGetConfigurationInfo function to get the information needed to initialize a CSModifyConfiguration parameter block.
C H A P T E R 9 PC Card Services UInt8 UInt8 cardValues; padding[1]; // ← valid card register values }; // 'attributes' field values enum { csExclusivelyUsed = 0x0001, csEnableIREQs = 0x0002, csVccChangeValid = 0x0004, csVpp1ChangeValid = 0x0008, csVpp2ChangeValid = 0x0010, csValidClient = 0x0020, // request that power be applied to socket during sleep csSleepPower = 0x0040, csLockSocket = 0x0080, csTurnOnInUse = 0x0100 }; // 'intType' field values enum { csMemoryInterface csMemory_And_IO_Interface };
C H A P T E R 9 PC Card Services DESCRIPTION The CSGetConfigurationInfo function is generally called after a client has parsed a tuple stream, identified an inserted card as its card, and is ready to initialize a CSModifyConfiguration parameter block. RESULT CODES SUCCESS BAD_HANDLE No error Invalid clientHandle value CSRequestConfiguration 9 You can use the CSRequestConfiguration function to establish yourself as the configuring client for a card and socket and to lock the configuration.
C H A P T E R 9 PC Card Services For attributes, intType, present, and cardValues field values see “CSGetConfigurationInfo” beginning on page 185. DESCRIPTION The CSRequestConfiguration function is used by a client to establish a locked configuration on a socket and its card. A client calls CSRequestConfiguration after it has parsed an inserted and ready card and has recognized the card as being usable.
C H A P T E R 9 PC Card Services CSModifyConfiguration 9 You can use the CSModifyConfiguration function to alter the configuration of a socket or card.
C H A P T E R 9 PC Card Services RESULT CODES SUCCESS BAD_HANDLE BAD_SOCKET CONFIGURATION_LOCKED NO_CARD OUT_OF_RESOURCE BAD_BASE No error Invalid clientHandle value Invalid socket number Another client has already locked a configuration No card Card Services lacks enough resources to complete this request Invalid base entered CSReleaseConfiguration 9 You can use the CSReleaseConfiguration function to release a previously locked configuration.
C H A P T E R 9 PC Card Services CSAccessConfigurationRegister 9 You can use the CSAccessConfigurationRegister function to modify a single configuration register. This function is not normally used by clients.
C H A P T E R 9 PC Card Services RESULT CODES SUCCESS BAD_SOCKET No error Invalid socket number Masks 9 The functions described in this section get and set client event and socket masks. CSGetClientEventMask 9 You can use the CSGetClientEventMask function to obtain your current event mask.
C H A P T E R 9 PC Card Services csBatteryDeadEvent csBatteryLowEvent csReadyChangeEvent csCardDetectChangeEvent csPMChangeEvent csResetEvent csSSUpdateEvent csFunctionInterrupt csAllEvents = = = = = = = = = 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0xFFFF }; DESCRIPTION The CSGetClientEventMask function is used by a client to obtain its current event mask. If the GetSetClientEventMaskPB.
C H A P T E R 9 PC Card Services DESCRIPTION The CSSetClientEventMask function is used by a client to establish its event mask. If the GetSetClientEventMaskPB.attributes field is reset, CSSetClientEventMask sets the client’s global event mask. If the GetSetClientEventMaskPB.attributes field has csEventMaskThisSocketOnly set, then the event mask for the given socket number is set.
C H A P T E R 9 PC Card Services RESULT CODES SUCCESS BAD_HANDLE No error The clientHandle field of GetClientInfoPB is invalid CSReleaseSocketMask 9 You can use the CSReleaseSocketMask function to clear the event mask for a PC card that you are no longer using.
C H A P T E R 9 PC Card Services Tuples 9 You can use the functions described in this section to obtain PC card information from the corresponding tuples. CSGetFirstTuple 9 You can use the CSGetFirstTuple function to obtain access to the first tuple associated with a particular socket.
C H A P T E R 9 PC Card Services // 'attributes' field values enum { csReturnLinkTuples= 0x0001 }; RESULT CODES SUCCESS BAD_SOCKET NO_CARD IN_USE READ_FAILURE BAD_CIS OUT_OF_RESOURCE NO_MORE_ITEMS No error Invalid socket number No card in specified socket Card is configured and being used by another client Card cannot be read Card Services has encountered a bad CIS structure Card Services is not able to obtain resources to complete function There are no more tuples to process CSGetNextTuple 9 You c
C H A P T E R 9 PC Card Services } UInt8 tupleCode; UInt8 tupleLink; TuplePB; // ← tuple code found // ← link value for tuple found struct { UInt16 tupleDataMax; // → maximum size of tuple data area UInt16 tupleDataLen; // ← number of bytes in tuple body TupleBody tupleData; // ← tuple data } TupleDataPB; } u; }; For attributes field values, see “CSGetFirstTuple” on page 196.
C H A P T E R 9 PC Card Services UInt16 flags; UInt32 linkOffset; UInt32 cisOffset; // ↔ internal use // ↔ internal use // ↔ internal use union { struct { UInt8 tupleCode; // ← tuple code found UInt8 tupleLink; // ← link value for tuple found } TuplePB; struct { UInt16 tupleDataMax; // → maximum size of tuple data area UInt16 tupleDataLen; // ← number of bytes in tuple body TupleBody tupleData; // ← tuple data } TupleDataPB; } u; }; // 'attributes' field values enum { csReturnLinkTuples= 0x0001 }; RES
C H A P T E R 9 PC Card Services Card and Socket Status 9 The CSGetStatus function gets card and socket status information. CSGetStatus 9 You can use the CSGetStatus function to get status information for the specified socket.
C H A P T E R 9 PC Card Services enum { csWriteProtectChanged csCardLockChanged csEjectRequestPending csInsertRequestPending csBatteryDeadChanged csBatteryLowChanged csReadyChanged csCardDetectChanged }; = = = = = = = = 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080 RESULT CODES SUCCESS BAD_SOCKET No error Invalid socket number Access Window Management 9 The functions described in this section help you manage access windows.
C H A P T E R 9 PC Card Services // 'attributes' field values enum { csMemoryWindow = 0x0001, csIOWindow = 0x0002, csAttributeWindow = 0x0004,// not normally used by Card Services // clients csWindowTypeMask = 0x0007, csEnableWindow = 0x0008, csAccessSpeedValid= 0x0010, csLittleEndian = 0x0020,// configure socket for // little-endianness cs16BitDataPath = 0x0040, csWindowPaged = 0x0080, csWindowShared = 0x0100, csWindowFirstShared = 0x0200, csWindowProgrammable = 0x0400 }; // 'accessSpeed' field values e
C H A P T E R 9 PC Card Services csExtAccSpeedMant5pt5= csExtAccSpeedMant6pt0= csExtAccSpeedMant7pt0= csExtAccSpeedMant8pt0= 0x0C, 0x0D, 0x0E, 0x0F, csExtAccSpeedExp1ns = csExtAccSpeedExp10ns = csExtAccSpeedExp100ns= csExtAccSpeedExp1us = csExtAccSpeedExp10us = csExtAccSpeedExp100us= csExtAccSpeedExp1ms = csExtAccSpeedExp10ms = 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; DIVERGENCE FROM PCMCIA STANDARD Apple has added another attribute (csIOTypeWindow) that lets a client request that its new
C H A P T E R 9 PC Card Services The parameter block associated with this function is as follows: typedef struct ReqModRelWindowPB ReqModRelWindowPB; struct ReqModRelWindowPB { UInt32 clientHandle; // → clientHandle returned by RegisterClient UInt32 windowHandle; // ↔ window descriptor UInt16 socket; // → logical socket number UInt16 attributes; // → window attributes (bitmap) UInt32 base; // ↔ system base address UInt32 size; // ↔ memory window size UInt8 accessSpeed; // → window access speed (bitmap) /
C H A P T E R 9 PC Card Services The parameter block associated with this function is as follows: typedef struct ReqModRelWindowPB ReqModRelWindowPB; struct ReqModRelWindowPB { UInt32 clientHandle; // → clientHandle returned by RegisterClient UInt32 windowHandle; // → window descriptor UInt16 socket; // → logical socket number UInt16 attributes; // not used UInt32 size; // not used UInt8 accessSpeed; // not used UInt8 padding[1]; // not used }; For attributes and accessSpeed field values, see “CSRequestW
C H A P T E R 9 PC Card Services The parameter block associated with this function is as follows: typedef struct GetCardServicesInfoPB GetCardServicesInfoPB; struct GetCardServicesInfoPB { UInt8 signature[2]; // ← two ASCII chars 'CS' UInt16 count; // ← total number of sockets installed UInt16 revision; // ← BCD UInt16 csLevel; // ← BCD UInt16 reserved; // → zero UInt16 vStrLen; // ↔ in: client's buffer size out: vendor string length UInt8 *vendorString;// ↔ in: pointer to buffer to hold CS vendor // str
C H A P T E R 9 PC Card Services // // // // csMemoryClient = csIOClient = csShareableCardInsertEvents= csExclusiveCardInsertEvents= 0x0001, 0x0004, 0x0008, 0x0010 DESCRIPTION Observe these cautions when using CSRegisterClient: ■ It must not be called at interrupt time. ■ You must specify the type of client for event notification order. ■ You must set the event mask for types of events client is interested in.
C H A P T E R 9 PC Card Services Ptr UInt16 clientData; version; // → pointer to client's data // → Card Services version // client expects }; For attributes field values, see “CSRegisterClient” on page 206. RESULT CODES SUCCESS BAD_ATTRIBUTE BAD_HANDLE No error Invalid window attributes Invalid clientHandle value Miscellaneous Functions 9 The functions described in this section help you with various Card Services management tasks.
C H A P T E R 9 PC Card Services DIVERGENCE FROM PCMCIA STANDARD Card Services does not issue CARD_RESET in place of CARD_READY. If a client is issuing a reset to a card, then it should know whether the card will generate a CARD_READY or not. If the card transitions from BSY to RDY, then the client will also know that it shouldn’t access the card until it receives the CARD_READY event.
C H A P T E R 9 PC Card Services CSVendorSpecific 9 You can use the CSVendorSpecific function to perform certain elements that are Mac OS specific.
C H A P T E R 9 PC Card Services EjectCard Parameter Block 9 You can use vendor-specific call #1 to eject a card.
C H A P T E R 9 PC Card Services UInt8 UInt16 UInt16 UInt16 UInt8 UInt8 subType; // reserved; // cardNameLen; // vendorNameLen;// *cardName; // *vendorName; // ← ↔ → → → → detailed card type (defined at top of file) reserved (should be set to 0) maximum length of card name to be returned max.
C H A P T E R 9 PC Card Services EnableSocketEvents Parameter Block 9 You can use vendor-specific call #3 to enable events on every socket in the system.
C H A P T E R 9 PC Card Services The parameter block associated with this function is as follows: typedef struct VendorSpecificPB VendorSpecificPB; struct VendorSpecificPB { UInt32 clientHandle;// → clientHandle returned by RegisterClient UInt16 vsCode; // → vsCode = 6 UInt16 socket; // → socket number UInt32 dataLen; // → length of GetAdapterInfoPB plus space for // voltages UInt8 *vsDataPtr; // → GetAdapterInfoPB * (supplied by client) }; typedef struct GetAdapterInfoPB GetAdapterInfoPB; struct GetAdap
C H A P T E R 9 PC Card Services RESULT CODES No error Invalid socket number SUCCESS BAD_SOCKET CSRequestExclusive and CSReleaseExclusive 9 The functions CSRequestExclusive and CSReleaseExclusive are not not supported by the Macintosh PowerBook Card Services software. PC Card Manager Constants 9 This section lists all the constants used by the PC Card Manager.
C H A P T E R 9 PC Card Services BAD_EDC = 0x04, // EDC generator specified is invalid RESERVED_5 = 0x05, // «reserved for historical purposes» BAD_IRQ = 0x06, // specified IRQ level is invalid BAD_OFFSET = 0x07, // PC card memory array offset is invalid BAD_PAGE = 0x08, // specified page is invalid READ_FAILURE = 0x09, // unable to complete read request BAD_SIZE = 0x0A, // specified size is invalid BAD_SOCKET = 0x0B, // specified physical socket number is invalid RESERVED_C = 0x0C, // «reserved for hist
C H A P T E R 9 PC Card Services CARD_RESET = 0x06, INSERTION_REQUEST = 0x07, INSERTION_COMPLETE= 0x08, EJECTION_REQUEST = 0x09, EJECTION_FAILED = 0x0A, PM_RESUME = 0x0B, PM_SUSPEND = 0x0C, EXCLUSIVE_REQUEST = 0x0D, EXCLUSIVE_COMPLETE= 0x0E, RESET_PHYSICAL RESET_REQUEST RESET_COMPLETE = 0x0F, = 0x10, = 0x11, BATTERY_DEAD = 0x12, BATTERY_LOW = 0x13, WRITE_PROTECT WRITE_ENABLED ERASE_COMPLETE = 0x14, = 0x15, = 0x16, CLIENT_INFO = 0x17, SS_UPDATED = 0x18, FUNCTION_INTERRUPT= 0x19, ACCESS_ER
Glossary 680x0 code Instructions that can run on a PowerPC microprocessor only by means of an emulator. See also native code. digital-to-analog converter (DAC) A device that produces an analog electrical signal in response to digital data. ADB See Apple Desktop Bus. direct memory access (DMA) A process for transferring data rapidly into or out of RAM without passing it through a processor or buffer.
G L O S S A RY native code Instructions that run directly on a PowerPC microprocessor. See also 680x0 code. nonvolatile RAM RAM that retains its contents even when the computer is turned off; also known as parameter RAM. NuBus A bus architecture in Apple computers that supports plug-in expansion cards. NuBus adapter card A card for the Power Macintosh 6100/60 that gives the computer NuBus capability. It plugs into the PDS connector and accepts short NuBus cards.
Index Numerals 68HC05 microprocessor 14 A AC adapter 4 access to internal components 24 access windows 201 active matrix display 25 ADB (Apple Desktop Bus) port 27 ADB connector 27 appearance 3 Ariel CLUT-DAC IC 16 ATA_Abort function 141 ATA_BusInquiry function 142 ATA disk driver 117, 120–135 clear partition mounting function 127 clear partition write protect function 127 control functions 122–130 control routine 120 Device Manager routines 120–122 driver gestalt function 131 driverGestaltParam parameter
I N D E X BlockMove routine 70 BlockMoveUncached routine 70 BlockZero routine 70 BlockZeroUncached routine 70 C cache coherency 7, 72 Card Services software 180–217 access window functions CSModifyWindow 203 CSReleaseWindow 204 CSRequestWindow 201 client information functions CSGetClientInfo 182 CSGetFirstClient 180 CSGetNextClient 181 client registration functions CSDeregisterClient 207 CSGetCardServicesInfo 205 CSRegisterClient 206 clients 180 configuration functions CSAccessConfigurationRegister 191 CS
I N D E X custom ICs (continued) Pratt 10 Singer 14, 28 TREX 15 Whitney 13 D dcbz instruction 70 Device Manager 79 display controller IC 14 Display Manager 74 displays active matrix 24, 25 backlighting 24 dual mode 50 DualScan 25 external video monitors 49, 50 adapter cable 51 flat panel types 24 FSTN 25 mirror mode 6, 50 NuBus card emulation 24 number of colors 6, 24 passive matrix 24 supertwist 24, 25 TFT 25 driver gestalt function 131 driverGestaltParam parameter block 131 Driver Services Library 71 Dr
I N D E X HardDiskPowered routine 92 HardDiskQInstall routine 94 HardDiskQRemove routine 95 HDI-30 connector 25 HFS volume format 76 I, J IDE disk interface 18 IDE hard disk 18 connector 20 pin assignments on 20 data bus 22 dimensions 18 signals 21 identifying the computers 62 IDE specification 116 infrared module 28 input/output subsystem 10 interpretive emulator 68 I/O ports SCSI 25 serial 25 video 50, 51 IsProcessorCyclingEnabled routine 104 IsSpindownDisabled routine 93 K keyboards 23 function keys 6
I N D E X Power Manager interface routines (continued) GetSCSIDiskModeAddress 102 GetSleepTimeout 90 GetWakeupTimer 103 HardDiskPowered 92 HardDiskQInstall 94 HardDiskQRemove 95 IsProcessorCyclingEnabled 104 IsSpindownDisabled 93 MaximumProcessorSpeed 100 PMFeatures 89 PMSelectorCount 89 SetHardDiskTimeout 92 SetIntModemState 99 SetProcessorSpeed 101 SetSCSIDiskModeAddress 102 SetSleepTimeout 91 SetSpindownDisable 94 SetWakeupTimer 103 SpinDownHardDisk 93 Power Manager software 63, 86 checking for routines
I N D E X T, U W TFT display 25 trackball 22 trackpad 22 software support for 65 TREX custom IC 15 tuple information 196 tuples 119 Whitney custom IC 13 V VCB allocation block size 76 verify function 122 video adapter cable 51 video card 16, 49–58 video connector 51 video controller IC 16 video modes dual 50 mirror 6, 50 video monitors 49, 50 adapter cable for 51 sense codes 52 VGA and SVGA 52 video output IC 16 video port 50 226 X, Y, Z XIOParam data structure 79 XVolumeParam parameter block 77
T H E A P P L E P U B L I S H I N G S Y S T E M This Apple manual was written, edited, and composed on a desktop publishing system using Apple Macintosh computers and FrameMaker software. Proof pages and final pages were created on an Apple LaserWriter Pro printer. Line art was created using Adobe Illustrator and Adobe Photoshop . PostScript , the page-description language for the LaserWriter, was developed by Adobe Systems Incorporated. Text type is Palatino and display type is Helvetica.