Developer Note PowerBook 150 Developer Press © Apple Computer, Inc.
Apple Computer, Inc. © 1994 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 v About This Developer Note vii Contents of This Note vii Supplementary Documents vii Conventions and Abbreviations viii Typographical Conventions viii Standard Abbreviations viii Chapter 1 PowerBook 150 System Overview Features 1-2 Compatibility Issues 1-3 IDE Internal Drive Support 1-3 SCSI Devices 1-3 Modem Slot 1-4 DRAM Expansion Slot 1-4 Identifying the PowerBook 150 Computer Video Display 1-4 PowerBook 150 System Architecture 1-5 Internal Hardware 1-6 Main Lo
Standard Control Calls 3-7 IDE Hard Disk Device Driver Status Call 3-11 ATA Manager Reference 3-14 The ATA Parameter Block 3-14 Functions 3-18 ATA I/O Execution 3-19 ATA Manager Inquiry 3-22 ATA Manager Initialization 3-23 ATA Bus Inquiry 3-23 ATA I/O Queue Release 3-25 IDE NOP 3-25 ATA Manager Command Termination 3-25 Device Registers Access 3-26 ATA Drive Identification 3-27 IDE Bus Reset 3-28 ATA Manager Shutdown 3-29 Driver Reference Number Registration 3-29 Driver Reference Number Deregistration 3-30 D
Figures and Tables Chapter 1 PowerBook 150 System Overview Figure 1-1 Figure 1-2 Figure 1-3 Chapter 2 Chapter 3 1-1 Figure 1-4 PowerBook 150 block diagram 1-5 Component view (top) of the PowerBook 150 logic board 1-6 Component view (bottom) of the PowerBook 150 logic board 1-7 PowerBook 150 memory adapter kit connector pinout 1-8 Table 1-1 DRAM memory adapter kit connector signal assignments IDE Hard Drive Interface 1-9 2-1 Figure 2-1 44-pin IDE drive connector pinout Table 2-1 IDE connector
P R E F A C E About This Developer Note This document describes the Macintosh JeDI computer, emphasizing those features that are new or different from other Macintosh PowerBook computers. It is written primarily for experienced Macintosh hardware and software developers who want to create products that are compatible with these new computers.
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 1-800-282-2732 (United States) 1-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 Standard abbreviations used in this developer note include: $n hexadecimal value n AC alternating current ADB Apple Desktop Bus ASC Apple Sound Chip ASIC application-specific integrated circuit DAC digital-to-analog converter FSTN film supertwist nematic (a type of LCD) IC integrated circuit IDE integrated device electronics LCD liquid crystal display RAM random-access memory RAMDAC random-access memory, digital-to-analog converter ROM read-only memory RGB red-green
C H A P T E R Figure 1-0 Listing 1-0 Table 1-0 1 PowerBook 150 System Overview 1
C H A P T E R 1 PowerBook 150 System Overview The PowerBook 150 computer retains the physical appearance of the PowerBook 145B computer except that it houses a logic board built upon the PowerBook 200 series system architecture. This new logic board not only increases the processing performance of the PowerBook 150, but also allows for greater flexibility of RAM expansion.
C H A P T E R 1 PowerBook 150 System Overview ■ Battery: a rechargeable NiCad battery is included. A 2.4 volt battery provides backup power for the real-time clock and parameter RAM when the main battery is removed. ■ Power supply: an external wall-mounted recharger/power adapter is included. ■ Weight: 5.5 pounds. ■ Size: 11.25 inches wide, 9.3 inches deep, and 2.25 inches high.
C H A P T E R 1 PowerBook 150 System Overview Modem Slot 1 The PowerBook 150 modem slot accepts the any serial modem compatible with the PowerBook 145B. For detailed information about designing serial modems for PowerBook computers refer to Designing Cards and Drivers for the Macintosh Family, third edition. The PowerBook 150 does not support the PowerBook Express Modem.
C H A P T E R 1 PowerBook 150 System Overview PowerBook 150 System Architecture 1 The PowerBook 150 computer is designed to be the lowest cost all-in-one PowerBook computer solution available from Apple Computer, Inc. To achieve this goal, the PowerBook 150 system architecture incorporates computer technologies from the all-in-one design of the PowerBook 145B and the expandable digital hardware design of the PowerBook Duo 230.
C H A P T E R 1 PowerBook 150 System Overview Internal Hardware 1 The PowerBook 150 internal hardware is made up of a main logic board and supporting subsystems for optional DRAM expansion, an optional modem, system interconnect, and system power inverter. Main Logic Board 1 The main logic board of the PowerBook 150 computer is based on the Duo 230 system. The main logic includes the power system, CPU, memory subsystem, video subsystem, data I/O subsystems, and supporting logic.
C H A P T E R 1 PowerBook 150 System Overview Figure 1-3 Component view (bottom) of the PowerBook 150 logic board MSC memory I/O control IDE controller DRAM Power Manager ROM GSC VRAM Combo Reset Power up Serial SCSI connector AC DRAM Expansion 1 An optional DRAM expansion card, which is the same as the DRAM expansion card for the Duo family of PowerBooks, can be plugged into the top of main logic board through a PowerBook 150 Memory Adapter Kit (see Figure 1-2 for the location of the DRAMex
C H A P T E R 1 PowerBook 150 System Overview Figure 1-4 PowerBook 150 memory adapter kit connector pinout +5 volts +5 volts J0101 ACONN80D J0102 ACONN70A DDATA31 1 2 DDATA31 1 2 DDATA30 3 4 DDATA30 3 4 DDATA29 5 6 DDATA29 5 6 DDATA27 DDATA28 7 8 DDATA28 7 8 DDATA26 /FCASD3 9 10 /FCASD3 9 10 DDATA25 /FRASDC 11 12 DDATA27 /FRASDC 11 12 DDATA24 FRA08 13 14 DDATA26 FRA08 13 14 DATA19 FRA07 15 16 DDATA25 FRA07 15 16 DATA18 17 18 DDATA24 17 18
C H A P T E R 1 PowerBook 150 System Overview In the following table, the 80-pin connector (to the main logic board) is referred to as J0101 and the 70-pin connector (to the DRAM SIMM) is referred to as the J0102.
C H A P T E R 1 PowerBook 150 System Overview Table 1-1 DRAM memory adapter kit connector signal assignments (continued) J0101 Pin J0102 Pin Signal name Description 29 29 /FCASD[2] Filtered column address strobe for DDATA[23-16] 31 31 FRA[6] Filtered multiplexed address bit 6 33 33 FRA[5] Filtered multiplexed address bit 5 44 34 DATA[11] Data bit 11 35 35 FRA[4] Filtered multiplexed address bit 4 46 36 DATA[10] Data bit 10 48 38 DATA[9] Data bit 9 54 40 FRA[10] Filter
C H A P T E R 1 PowerBook 150 System Overview Table 1-1 DRAM memory adapter kit connector signal assignments (continued) J0101 Pin J0102 Pin Signal name Description 77 67 FRA[0] Filtered multiplexed address bit 0 78 68 /FWED Filtered write enable 79 69 FRA[9] Filtered multiplexed address bit 9 80 70 DATA[0] Data bit 0 System Interconnect 1 A connector on the top of the main logic board connects the main logic with the interconnect board.
C H A P T E R Figure 2-0 Listing 2-0 Table 2-0 2 IDE Hard Drive Interface 2
C H A P T E R 2 IDE Hard Drive Interface This chapter provides information about the IDE hard drive hardware interface to the PowerBook 150 computer. This interface, which is also used for IDE drives on IBM AT-compatible computers, is also referred to as the ATA IDE interface specification. The implementation of the ATA interface on the PowerBook 150 computer is a subset of the ATA interface specification, ANSI Proposal X3T9.2/90-143, Revision 3.1.
C H A P T E R 2 IDE Hard Drive Interface Table 2-1 provides the signal names and descriptions on the PowerBook 150 IDE connector. Table 2-1 Pin number IDE connector signals Signal name Signal description 1 /IDE_RESET Hardware reset to the drive. Active low signal. 2 GND Ground. 3 IDEDATA07 Data bit 7. IDEDATA00-07 signals are used to transfer data between all of the internal registers of the drive and the host. 4 IDEDATA08 Data bit 8.
C H A P T E R 2 IDE Hard Drive Interface Table 2-1 IDE connector signals (continued) Pin number Signal name Signal description 16 IDEDATA14 Data bit 14. IDEDATA00–15 signals are used to transfer 16-bit data to and from the drive buffer. 17 IDEDATA00 Data bit 0. IDEDATA00-07 signals are used to transfer data between all of the internal registers of the drive and the host. 18 IDEDATA15 Data bit 15. IDEDATA00–15 signals are used to transfer 16-bit data to and from the drive buffer.
C H A P T E R 2 IDE Hard Drive Interface Table 2-1 IDE connector signals (continued) Pin number Signal name Signal description 36 IDE_DA02 This signal is used to specify which IDE drive register is being accessed by the PowerBook 150 computer. For more information, see the descriptions of the IDE_HCS10 and IDE_HCS11 signals in this table. 37 IDE_HCS10 Register chip select signal. It is asserted high to access the additional control and status registers on the IDE drive.
C H A P T E R Figure 3-0 Listing 3-0 Table 3-0 3 Software for the ATA/IDE Hard Disk 3
C H A P T E R 3 Software for the ATA/IDE Hard Disk This chapter describes the IDE system software for controlling IDE hard disk drives installed in Macintosh computers. 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 X3T9.2/90-143, Revision 3.1.
C H A P T E R 3 Software for the ATA/IDE Hard Disk Figure 3-1 Relationship of the ATA Manager to the Macintosh system architecture Application System software File Manager Device Manager SCSI hard disk driver CD-ROM driver Other SCSI device drivers ATA/IDE hard disk driver SCSI Manager ATA Manager SCSI interface ATA interface Peripheral devices SCSI hard disk CD-ROM Other SCSI devices ATA/IDE hard disk At system startup time, the IDE device driver gets installed as one of the device dri
C H A P T E R 3 Software for the ATA/IDE Hard Disk ATA Manager 3 The Macintosh ATA Manager schedules I/O requests from the IDE hard disk device driver, the operating system, and applications. It is also responsible for managing the hardware interface to the IDE controller electronics. When making calls to the ATA Manager, you have to pass and retrieve parameter information through a parameter block. The size and contents of the parameter block depends on the call being made.
C H A P T E R 3 Software for the ATA/IDE Hard Disk ■ device information uploading ■ drive queue management and event posting After booting, the driver responds with noErr to subsequent calls to the open routine, and does not repeat the operations performed at boot time.
C H A P T E R 3 Software for the ATA/IDE Hard Disk Status 3 The status routine returns status information about the IDE hard disk device driver. The type of information returned is specified in the csCode field and the information itself is pointed to by the csParamPtr field.
C H A P T E R 3 Software for the ATA/IDE Hard Disk RESULT CODES noErr controlErr 0 -17 nsDrvErr -56 Successful completion, no error occurred Unimplemented control call; could not complete requested operation Specified drive does not exist IDE Hard Disk Device Driver Control Calls 3 The IDE hard disk device driver supports a standard set of control and status calls for accessing IDE hard disk drive devices.
C H A P T E R 3 Software for the ATA/IDE Hard Disk The Verify Function 3 The verify function requests a read verification of the data on the IDE hard disk drive media. INPUT PARAMETERS csCode A value of $05. ioVRefNum The logical drive number. csParam[] None defined. OUTPUT PARMETERS ioResult See the list of result codes.
C H A P T E R 3 Software for the ATA/IDE Hard Disk The Eject Media Function 3 The eject media function prepares and initiates an eject operation from the specified drive. This call returns noErr if the logical drive number is valid, however it performs no other operation on the JeDI. INPUT PARAMETERS csCode A value of $07. ioVRefNum The logical drive number. csParam[] None defined. OUTPUT PARAMETERS ioResult See the list of result codes.
C H A P T E R 3 Software for the ATA/IDE Hard Disk The Return Media Icon Function 3 The return media icon function returns a pointer to the media icon and the name string. The media icon is the same as the drive icon for IDE hard disk drives. INPUT PARAMETERS csCode A value of $22. ioVRefNum The logical drive number. csParam[] None defined. OUTPUT PARAMETERS csParam[0-1] The address of the media icon and name string. The information is in ICN# format. ioResult See the list of result codes.
C H A P T E R 3 Software for the ATA/IDE Hard Disk RESULT CODES 0 -56 noErr nsDrvErr Successful completion, no error occurred Specified drive does not exist The Need Time Code Function 3 The need time code function allows the driver time to perform periodic operations, such as checking for media insertion or ejection events related to removable cartridge drives.
C H A P T E R 3 Software for the ATA/IDE Hard Disk OUTPUT PARAMETERS csParam[] The csParam field contains status information about the internal IDE disk drive. ioResult See the list of result codes. RESULT CODES noErr nsDrvErr 0 -56 Successful completion, no error occurred Specified drive does not exist The Return Driver Gestalt Function 3 This function provides applications information about the IDE hard disk device driver and the attached device.
C H A P T E R 3 Software for the ATA/IDE Hard Disk OUTPUT PARAMETERS driverGestaltResponse The result returned; based on the driver gestalt selector. The possible return values are: true If the sync driver selector is specified, this Boolean value indicates that the driver is synchronous.
C H A P T E R 3 Software for the ATA/IDE Hard Disk RESULT CODES noErr controlErr 0 -17 nsDrvErr -56 Successful completion, no error occurred Unimplemented control call; could not complete requested operation Specified drive does not exist ATA Manager Reference 3 This section defines the data structures and functions that are specific to the ATA Manager. The “The ATA Parameter Block” section shows the data structure of the ATA parameter block.
C H A P T E R 3 Software for the ATA/IDE Hard Disk uchar Ptr ProcPtr short uchar uchar ushort short long ulong Ptr Ptr ushort short long hdrReserved; hdrReserved2; ataCompletion; ataResult; MgrFCode; ataIOSpeed; ataFlags; hdrRevered3; deviceID; TimeOut; ataPtr1; ataPtr2; ataState; hdrReserved4; hdrReserved5; /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* reserved */ reserved */ completion routine Ptr */ ← returned result */ → manager function code */ → I/O timing class */ → control options */ reserved *
C H A P T E R 3 Software for the ATA/IDE Hard Disk ataIOSpeed ataFlags in “Functions” beginning on page 3-18. An invalid code in this field results in an ATAFuncNotSupported error. This field specifies the I/O cycle timing requirement of the specified IDE hard drive. This field should contain word 51 of the identify drive data. Currently values 0 through 32 are supported, as defined in the ATA specification.
C H A P T E R 3 Software for the ATA/IDE Hard Disk The format of the scatter gather list is a series of the following structure definition: typedef struct { uchar* ioBuffer; /* pointer */ ulong ioReqCount; /* byte count */ } IOBlock; 10 QLockOnError 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 will be processed following this request.
C H A P T E R 3 Software for the ATA/IDE Hard Disk deviceID A short word that uniquely identifies an IDE device. The field consists of the following structure: typedef struct { ushort Reserved; /* reserved */ ushort deviceNum; /* device ID and bus ID */ } deviceIdentification; TimeOut ataPtr1 ataPtr2 ataState Bit 15 of deviceNum field indicates master (=0) /slave (=1) selection. Bits 14 through 0 contain the bus ID (for example, 0x0 = master unit of bus 0, 0x80 = slave unit of bus 0).
C H A P T E R 3 Software for the ATA/IDE Hard Disk Table 3-1 ATA Manager functions Function name Function code Description ATA_NOP $00 No operation ATA_ExecIO $01 ATA I/O execution ATA_BusInquiry $03 Bus inquiry ATA_QRelease $04 I/O queue release ATA_Abort $10 Command termination ATA_ResetBus $11 IDE bus reset ATA_RegAccess $12 ATA device register access ATA_Identify $13 Get the drive identify data ATA_DrvrRegister $85 Driver refNum registration ATA_FindRefNum $86 Driver
C H A P T E R 3 Software for the ATA/IDE Hard Disk ulong ulong devicePB uchar* ushort ataActualTxCnt; /* ← actual number of bytes transferred */ ataReserved2; /* reserved */ RegBlock; /* → device register images */ packetCDBPtr; /* ATAPI packet command block pointer */ ataReserved3[6];/* reserved */ } ATA_ExecIO; Field descriptions ataPBHdr ataStatusReg ataErrorReg BlindTxSize IOBlk See the definition of the ataPBHdr structure on page 3-14. This field contains the last device status register image.
C H A P T E R 3 Software for the ATA/IDE Hard Disk bytes still to be transferred). When the SGType bits of the ataFlags field are set, this field contains the number of scatter gather entries in the list pointed by the ioBuffer field. ataActualTxCnt This field contains the total number of bytes transferred for this request. Currently not supported. RegBlock This field contains the IDE device register image structure.
C H A P T E R 3 Software for the ATA/IDE Hard Disk ATA Manager Inquiry You can use the ATA_MgrInquiry function to get information about the ATA Manager such as the version number. 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 3 Software for the ATA/IDE Hard Disk RESULT CODES noErr 0 Successful completion, no error occurred ATA Manager Initialization 3 You must call the ATA_MgrInit function prior to issuing ATA_ExecIO, ATA_BusInquiry, ATA_QRelease, or ATA_Abort command. Otherwise, an ATAMgrNotInitialized error is returned. This call initializes internal variables and IDE hard disk drive hardware.
C H A P T E R 3 Software for the ATA/IDE Hard Disk char ataContrlFamily[16];/* char ataContrlType[16]; /* char ataXPTversion[4]; /* char ataResrved6[4]; /* char ataHBAversion[4]; /* uchar ataHBAslotType; /* uchar ataHBAslotNum; /* ushort ataReserved7; /* ulong ataReserved8; /* } ATA_BusInquiry; ← family of ATA Controller */ ← model num of controller */ ← version number of XPT */ reserved */ ← version number of HBA */ ← type of slot */ ← slot number of the HBA */ reserved */ reserved */ Field descriptio
C H A P T E R 3 Software for the ATA/IDE Hard Disk RESULT CODES noErr ATAMgrNotInitialized 0 -1802 Successful completion, no error occurred ATA Manager not initialized ATA I/O Queue Release 3 You can use the ATA_QRelease function to release the frozen I/O queue of the selected device. When an I/O error is detected by the ATA Manager and the QLockOnError bit of the parameter block is set for the request, the queue for the selected device will be frozen.
C H A P T E R 3 Software for the ATA/IDE Hard Disk It is up to the application that called the ATA_Abort function to clean up the aborted request, which 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 3 Software for the ATA/IDE Hard Disk Field descriptions ataPBHdr RegSelect See the ataPBHdr parameter block definition on page 3-14 This field specifies which device registers to access.
C H A P T E R 3 Software for the ATA/IDE Hard Disk The parameter block associated with this function is defined as follows: typedef struct { ataPBHdr ushort Reserved1[4]; uchar *DataBuf; ushort Reserved2[18]; } ATA_Identify; /* reserved */ /* ↔ buffer for the data */ /* reserved */ Field descriptions ataPBHdr DataBuf See the ataPBHdr parameter block definition on page 3-14. Pointer to the data buffer for the device identify data. The length of the buffer must be at least 512 bytes.
C H A P T E R 3 Software for the ATA/IDE Hard Disk RESULT CODES 0 -56 noErr nsDrvErr Successful completion, no error occurred Specified drive does not exist ATA Manager Shutdown 3 You can use the ATA_MgrShutDown function to shut down the ATA Manager. It is the complement to the ATA_Init function. This function deallocates all of the global space currently in use by the ATA Manager. After calling ATA_MgrShutDown, the ATA Manager must be reinitialized before any IDE I/O requests can take place.
C H A P T E R 3 Software for the ATA/IDE Hard Disk RESULT CODES noErr nsDrvErr 0 -56 Successful completion, no error occurred Specified drive does not exist Driver Reference Number Deregistration 3 You can use the ATA_DrvrDeregister function to deregister the driver reference number for the selected drive. After successful completion of this function, the value for the driver reference number is set to 0, which indicates that there is no driver in control of this device.
C H A P T E R 3 Software for the ATA/IDE Hard Disk Field descriptions ataPBHdr drvrRefNum deviceNextID See the ataPBHdr parameter block definition on page 3-14. Upon return, this field contains the reference number for the device specified in the deviceID field of the ataPBHdr data. Upon return, this field contains the deviceID of the next device on the list.
C H A P T E R 3 Software for the ATA/IDE Hard Disk Table 3-2 3-32 IDE hard disk drive error codes (continued) Error code Name Description -1785 AT_CorDataErr Data Corrected bit set in error register; was corrected (good data) - notification -1786 AT_BadBlkErr Bad Block bit set in error register -1787 AT_DMarkErr Data Mark Not Found bit set in error register -1788 AT_IDNFErr ID Not Found bit set in error register -1789 AT_DRQErr Timeout waiting for DRQ active -1790 ATABusyErr Select
Index A adapter card for DRAM expansion 1-7 ATA_Abort function 3-25 ATA_BusInquiry function 3-23 to 3-25 ATA_DrvrDeregister function 3-30 ATA_DrvrRegister function 3-29 ATA_ExecIO function 3-19 to 3-21 parameter block 3-20 ATA_FindRefNum function 3-30 ATA_Identify function 3-27 to 3-28 ATA_Init function 3-23 ATA_Inquiry function 3-22 to 3-23 ATA_MgrShutDown function 3-29 ATA_NOP function 3-25 ATA_QRelease function 3-25 ATA_RegAccess function 3-26 to 3-27 ATA_Reset function 3-28 ATA IDE hardware implementati
I N D E X N S–U need time code function 3-11 SCSI termination power 1-3 signal assignments, DRAM expansion card 1-9 status routine 3-6 system interconnect 1-11 O open routine 3-4 V–Z P, Q PowerBook 150 features 1-2 to 1-3 internal hardware 1-6 to 1-11 system architecture 1-5 to 1-11 power mode status information function 3-13 prime routine 3-5 R return drive characteristics function 3-10 return drive icon function 3-9 return driver gestalt function 3-12 to 3-13 return media icon function 3-10 IN-2