Developer Note DOS Compatibility Card For the Power Macintosh 6100 Computer 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 vii About This Note ix Contents of This Note ix Supplementary Documents ix Obtaining Information From APDA Conventions and Abbreviations x Typographical Conventions x Standard Abbreviations xi Chapter 1 Introduction 1 Appearance and Features 2 How the DOS Compatibility Card Works Outline of Operation 4 I/O Capabilities 6 Floppy Disk 6 Hard Disk 6 Serial Ports 6 Parallel Printer Port 7 Keyboard and Mouse 7 Sound 7 Video Monitor 8 Game Controller 9 Chapter 2 x H
Clock Generation 20 ISA Bus Control 20 84035 Data Path Controller 20 Clocks 21 System Reset 21 Interrupt Control 21 Video System 22 Connecting a Monitor 22 Monitors Supported 22 Monitor Sense Lines 23 Video Timing 24 Video System ICs 26 82C450 VGA Controller 26 MU9C9760 SynDAC 26 I/O System 26 Pretzel Logic I/O Controller IC 26 DMA Channels 27 Serial Port Support 27 Printer Port Support 28 Keyboard and Mouse Emulation 28 Message Mailbox 28 Power-on Reset 28 Autoconfiguration 29 Declaration ROM 29 PDS Adapte
Control and Status Calls 39 rsPCStatus 40 rsBootPC 41 rsResetPC 41 rsEnableVideo 41 rsDisableVideo 42 rsMountDisks 42 rsDontMountDisks 42 rsActivateKB 43 rsDeactivateKB 43 rsBeginMouseTracking 43 rsEndMouseTracking 44 rsEndPrintJob 44 Detecting Errors 44 rsSetNotificationProc 44 rsLastError 45 Passing Messages 45 Message Conventions 45 Macintosh Interface 46 PC Interface 46 Registering Messages 46 On the Mac OS 46 On the PC 47 Sending a Message 47 On the Mac OS 47 On the PC 48 Installing a Message Handler 4
Figures and Tables Chapter 1 Introduction 1 Figure 1-1 Figure 1-2 Figure 1-3 Figure 1-4 Figure 1-5 The DOS Compatibility Card assembly 2 The DOS Compatibility Card installed 4 Simplified block diagram of the DOS Compatibility Card Monitor adapter cable 8 Monitor adapter cable and game controller installed 9 Table 1-1 Comparison of the DOS Compatibility Card and a midrange PC 3 Corresponding serial-port signals 6 Table 1-2 Chapter 2 Chapter 3 Hardware Design 11 Figure 2-1 Figure 2-2 Detailed bl
P R E F A C E About This Note This developer note describes the DOS Compatibility Card, an 80486 processor designed to operate in the PDS slot of a Power Macintosh 6100 computer. This developer note describes the features of the DOS Compatibility Card and the way it communicates with the host computer. This developer note is intended to help hardware and software developers design products that are compatible with the Macintosh product described in the note.
P R E F A C E Developers may also need copies of the appropriate Apple reference books. You should have the relevant books of the Inside Macintosh series, particularly Inside Macintosh: PowerPC System Software and Inside Macintosh: Processes. Obtaining Information From APDA 0 The Apple publications listed above are available from APDA.
P R E F A C E Note A note like this contains information that is interesting but not essential for an understanding of the text. ◆ IMPORTANT A note like this contains important information that you should read before proceeding. ▲ Standard Abbreviations 0 When unusual abbreviations appear in this book, the corresponding terms are also spelled out. Standard units of measure and other widely used abbreviations are not spelled out.
P R E F A C E xii DOS disk operating system DRAM dynamic RAM EGA Enhanced GRaphics Adapter EISA Extended Industry Standard Architecture FIFO first in, first out GND ground IC integrated circuit I/O input and output ISA Industry Standard Architecture Mac OS Macintosh Operating System MDA Monochrome Display Adapter n.c.
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 DOS Compatibility Card is a plug-in assembly designed to provide IBM-compatible PC functionality on a Power Macintosh 6100 computer. The DOS Compatibility Card includes an 80486 microprocessor and interface devices that allow it to use the I/O capabilities of the host computer. When installed in a Macintosh computer, the DOS Compatibility Card provides a cost-effective system with performance equivalent to a stand-alone PC.
C H A P T E R 1 Introduction ■ Direct memory access. A DMA channel supports I/O transfers when memory is installed on the card; when using shared memory, DMA is provided through the Macintosh system. ■ Video support. A VGA video system on the card supports Macintosh monitors from 13-inch through 20-inch size and all available VGA monitors. ■ Sound card.
C H A P T E R 1 Introduction Table 1-1 Comparison of the DOS Compatibility Card and a midrange PC (continued) Feature DOS Compatibility Card Midrange PC Floppy disk 3.5-inch 3.5-inch and 5.25-inch AT expansion None 3 slots External SCSI Yes No Notice that the DOS Compatibility Card has greater sound and networking capabilities than a midrange PC. In addition, the card provides external SCSI expansion through the host computer (for hard drives and removable-media devices only).
C H A P T E R 1 Introduction Figure 1-3 Simplified block diagram of the DOS Compatibility Card Video DRAM CPU AT bus DRAM SIMM Memory and bus controllers VGA controller Keyboard controller PPC 601 PDS adapter PDS Video DRAM CPU Pretzel Logic IC 80486DX2 Video and memory controller DOS Compatibility Card Power Macintosh 6100 Curio I/O interface I/O controller Keyboard Floppy disk SCSI hard disk Serial ports Ethernet port The diagram shows some of the hardware devices on the processor c
C H A P T E R 1 Introduction I/O Capabilities 1 The DOS Compatibility Card uses I/O devices built into or connected to the Macintosh host computer. This section describes the I/O capabilities; for more information on their operation, see “I/O System” in Chapter 2. Floppy Disk 1 The DOS Compatibility Card has access to the Macintosh host computer’s 3.5-inch internal floppy drive. The drive can read and write DOS-formatted floppy disks.
C H A P T E R 1 Introduction Note The serial ports on some Macintosh models have 9-pin sockets. Those sockets accept either 9-pin or 8-pin connectors. ◆ The Macintosh serial ports are RS-422 ports and do not support all the RS-232 signals. In particular, the Carrier Detect (CD), Data Set Ready (DSR), Request To Send (RTS), and Ring Indicator (RI) signals are not available. Not all RS-232 devices will work using the RS-422 protocol.
C H A P T E R 1 Introduction Video Monitor 1 A DOS Compatibility Card installed in a Power Macintosh 6100 computer can either have its own monitor or share the same monitor used for the Macintosh host computer. When using separate monitors for the card and the Macintosh host computer, both screens can be updating at the same time. (Only one at a time can be receiving user input from the keyboard and mouse.
C H A P T E R 1 Introduction Game Controller 1 The DB-15 connector adjacent to the DB-26 connector on the monitor adapter cable is used to connect a PC/AT compatible game controller (joystick). Figure 1-5 shows the back of a Power Macintosh 6100 computer with the game controller installed. The game controller can be used only with programs running on the PC side.
C H A P T E R Figure 2-0 Listing 2-0 Table 2-0 2 Hardware Design Thi d t t d ith F M k 404 2
C H A P T E R 2 Hardware Design The DOS Compatibility Card assembly contains three printed circuits cards: the processor card, the PDS adapter card, and the sound expansion card. The processor card contains the processor and memory system, the video display system, and the I/O system. The PDS adapter card contains the PDS bus demultiplexer and controller. The sound expansion card contains the sound generation ICs.
C H A P T E R 2 Hardware Design Figure 2-1 CPU 80486DX2 D(31:0) Detailed block diagram Sound expansion connector XA(15:0) A(31:2) 8242 84035 Keyboard controller Data path controller DB-26 connector 558 84031 XD(7:0) Game timer Memory controller Video DRAM 72-pin RAM SIMM 82C450 VGA controller 68040 PDS connector CLUT PPC 601 PDS connector 68040 PDS Pretzel Logic I/O interface controller AJA ROM Declaration Bus demultiplexer 13
C H A P T E R 2 Hardware Design Processor and Memory System 2 The processor and memory system includes the 80486DX2 microprocessor and the control devices for the onboard memory: the 84031 memory controller and the 84035 data path controller. 80486DX2 Microprocessor 2 The DOS Compatibility Card has a 80486DX2 microprocessor running at 66 MHz (33 MHz processor bus clock). The 80486DX2 supports 32-bit data paths and 32-bit addresses; that allows up to 4 GB of physically addressable memory.
C H A P T E R 2 Hardware Design Cache Snooping 2 The 80486 cache supports bus snooping to track activity on the bus that alters the memory represented in the internal cache. However, no alternate master exists on the PC system bus in the DOS Compatibility Card, so the snoop control lines are deactivated. The memory space reserved for the PC (whether local or shared memory) cannot be cached or modified by the Mac OS, so it presents no coherency issues.
C H A P T E R 2 Hardware Design Table 2-1 describes the different transfer sizes supported by the PowerPC 601 and the 80486. The table also identifies the 68040 transfers, which are a subset of the PowerPC 601 transfers.
C H A P T E R 2 Hardware Design When the 80486 performs a misaligned write, the interface IC (Pretzel Logic) first checks to see if the transfer is an aligned transfer on the Macintosh host computer. If it is, the write is allowed to proceed. If the write is misaligned with respect to the host computer (for example, a 3-byte transfer, or a 2-byte transfer that does not fall on a word boundary), the interface IC forces the 80486 to break the transfer into multiple singlebyte operations.
C H A P T E R 2 Hardware Design into the cause of the interrupt can be determined by use of the secondary interrupt status registers for COM1 and COM2 ports, keyboard and mouse port, and DMA channel. The interrupt and status registers in the Pretzel Logic IC are accessible from the Macintosh environment only. From the PC environment, the registers for the COM1 and COM2 ports and for the printer port match their standard definitions.
C H A P T E R 2 Hardware Design When performing DMA cycles to the PC, the Pretzel Logic IC becomes a PowerPC 601 bus master. When configured for shared memory operation, the Pretzel Logic IC provides a way to limit bus monopolizing by the PDS slot. Internal to the Pretzel Logic IC is a count register that can be configured to allow the IC to park on the PowerPC 601 bus if the pending number of posted writes is equal to or less than the specified count.
C H A P T E R 2 Hardware Design The DOS Compatibility Card does not require a DRAM SIMM with parity. The presence of a DRAM SIMM on the card is sensed by the Pretzel Logic IC at startup and stored in a register in the IC. Upon reading this register bit, the startup software determines the size of the memory and programs the 84031’s configuration registers with starting and ending addresses for each bank.
C H A P T E R 2 Hardware Design In addition, the 84035 contains the PC/AT-compatible DMA channels and the system arbitration logic for DMA masters and local bus masters. Those functions are needed by the sound expansion card. Clocks 2 The 84035 data path controller IC receives a 14.31818 MHz clock signal and divides it by 12 to form the 1.19 MHz clock used by the 8254 timers. In addition, the 84035 receives a 32.768 kHz clock signal for the internal real-time clock.
C H A P T E R 2 Hardware Design Video System 2 The DOS Compatibility Card includes a complete video system to support PC video. The video system consists of a DRAM-based frame buffer and a VGA controller with an integrated color lookup table (CLUT), triple digital-to-analog converter (DAC), and clock generator. Connecting a Monitor 2 Video output from the DOS Compatibility Card can be displayed either on a dedicated monitor or on a monitor shared with the host Macintosh computer.
C H A P T E R 2 Hardware Design supports the 14-inch and 17-inch RGB Apple monitors as well as the standard VGA monitors. Table 2-4 summarizes the monitor sizes and display modes supported by the DOS Compatibility Card.
C H A P T E R 2 Hardware Design Video Timing 2 Table 2-5 and Figure 2-2 define the video monitors and timings supported by the Macintosh host computer that are also supported by DOS Compatibility Card. For the Macintosh monitors that are fixed frequency (the 14-inch and 16-inch monitors), the VGA controller on the card needs to be configured for this horizontal and vertical retrace rate.
C H A P T E R 2 Hardware Design Figure 2-2 Video timing parameters Horizontal timing White Video Black H sync space H image space HBLANK H line length /HSYNC H back porch H sync pulse H front porch Vertical timing White Video Black V sync space V image space VBLANK V line length /VSYNC V back porch V sync pulse V front porch To accommodate the various VGA and SVGA modes on the Macintosh monitors, the video controller must have its timing parameters changed by the BIOS.
C H A P T E R 2 Hardware Design Video System ICs 2 Two ICs provide the video support for the PC: ■ 82C450 VGA controller ■ MU9C9760 SynDAC 82C450 VGA Controller 2 The 82C450 is an integrated VGA video controller that is backward compatible with EGA, CGA, and MDA video modes.
C H A P T E R 2 Hardware Design ■ A 64-bit message mailbox with a 32-bit command port ■ Power-on reset logic ■ Autoconfiguration logic The Pretzel Logic IC functions as a slave device on the PC system bus. On the Macintosh system bus, the Pretzel Logic IC functions both as a slave and as an alternate bus master.
C H A P T E R 2 Hardware Design Printer Port Support 2 The Pretzel Logic IC implements all the registers of the standard Centronics parallel port found on a PC. When the PC accesses these registers, interrupts are generated in the Macintosh host computer that cause the driver software in the Mac OS to send data to a print spooler file. The spooler file is then sent to whatever printer is selected by the user in the Macintosh environment.
C H A P T E R 2 Hardware Design Autoconfiguration 2 The Pretzel Logic IC performs autoconfiguration each time the PC is reset.
C H A P T E R 2 Hardware Design Bus Demultiplexing 2 The adapter card contains eight 74F245 buffer ICs. They perform the demultiplexing of the 64-bit PowerPC 601 bus to the 32-bit bus that is connected to the Pretzel Logic IC. The buffer ICs are controlled by the AJA IC. Burst Transfers 2 The Macintosh host computer and the DOS Compatibility Card do not perform burst transfers in the same way.
C H A P T E R 2 Hardware Design ■ a 16-bit stereo codec ■ a Sound Blaster–compatible mixer with AGC ■ a control interface for the FM synthesizer IC The CT2501 sound system IC allows analog mixing of audio from the PC and from the FM synthesizer IC. The audio signal from the sound card is the mixed with the CD audio from the Macintosh host computer by circuitry on the DOS Compatibility Card.
C H A P T E R Figure 3-0 Listing 3-0 Table 3-0 3 The PC Interface Driver Thi d t t d ith F M k 404 3
C H A P T E R 3 The PC Interface Driver The PC Interface driver provides communication and control between the Macintosh Operating System (Mac OS) and the DOS Compatibility Card. Programs running on the Mac OS can use the driver to configure and control the card. Programs in both environments can use the driver to exchange messages; see the section “Passing Messages” beginning on page 45.
C H A P T E R 3 The PC Interface Driver rsSetMemoryConfig 3 You can use the rsSetMemoryConfig control call to make memory on the Macintosh computer available for the PC. The calling program first allocates the memory and sets it locked and contiguous. The control call sets the base address and length of the memory. This call is needed only when no RAM SIMM is installed for the PC.
C H A P T E R 3 The PC Interface Driver The type field specifies what type the drive is configured as (rsFloppyDrive, rsFileDrive, rsPartitionDrive, or rsNULLDrive). If the value of type is rsNULLDrive, the corresponding drive does not exist to the PC and no other fields need to be filled in. If the value of type is rsFloppyDrive, the corresponding drive on the PC is connected to one of the Macintosh computer’s floppy drives.
C H A P T E R 3 The PC Interface Driver The RSNetDriveConfig data structure contains the current configuration for folder sharing for each PC drive letter. If the PC has its LASTDRIVE parameter set to less than Z or if other block device drivers are loaded on the PC, not all drive letters will be available. The data structures for drives that are not available have their status parameters set to 1 by the PC Interface driver.
C H A P T E R 3 The PC Interface Driver RSComConfig[0] contains the configuration for COM1 and RSComConfig[1] contains the configuration for COM2. The type field specifies what type of connection to make (either rsNULLComPort, rsModemComPort, rsPrinterComPort, rsSpoolComPort, rsComToolBoxComPort, or rsIgnore). The value of the vRefNum parameter is the volume reference number, dirID is the directory ID, and fileNamePtr is the pointer to the name of the spool file.
C H A P T E R 3 The PC Interface Driver When a print job has been completed, the driver notifies the application by means of the rsSetNotificationProc procedure (defined on page 44). The driver also notifies the application if it has trouble saving the spool data. rsSetDeactivateKey 3 You can use the rsSetDeactivateKey control call to set the deactivate key along with its modifiers and a user-defined task.
C H A P T E R 3 The PC Interface Driver rsPCStatus 3 You can use the rsPCStatus status call to get information about the state of the PC hardware. This call returns the current state of the PC. Parameter block → ioCompletion long ← ioResult word → ioRefNum word → csCode word Equals rsPCStatus ← csParam+4 long The status word Pointer to the completion routine Table 3-1 shows the meanings of the bits in the status word.
C H A P T E R 3 The PC Interface Driver rsBootPC 3 You can use the rsBootPC control call to start up the PC. This call resets the PC’s processor and boots the PC’s system BIOS. If the PC is already running, this call resets it. Parameter block → ioCompletion long ← ioResult word → ioRefNum word → csCode word Pointer to the completion routine Equals rsBootPC The calling program must set up the PC’s configuration before booting the PC.
C H A P T E R 3 The PC Interface Driver rsDisableVideo 3 You can use the rsDisableVideo control call to disable the VGA display output when the Macintosh video output is connected to the video adapter cable. If the Macintosh video is not connected, this call does nothing.
C H A P T E R 3 The PC Interface Driver rsActivateKB 3 You can use the rsActivateKB control call to direct the data from the computer’s keyboard to the PC side. All keys except the Command key are trapped; key codes are translated and transmitted to the PC.
C H A P T E R 3 The PC Interface Driver rsEndMouseTracking 3 You can use the rsEndMouseTracking control calls to cause the mouse movements and button presses to be directed to the Mac OS. This call also causes the driver to show the Macintosh cursor.
C H A P T E R 3 The PC Interface Driver Upon return, the parameters are set as follows: ← csParam+0 long Pointer to the previous notification procedure ← csParam+4 long Previous A1Param value The caller passes a pointer to the user-defined procedure and a parameter to be passed to that procedure in A1. The control call returns the previous values. Calling rsSetNotificationProc with a NULL pointer disables the notification procedure. When the user-defined procedure is called, the D0.
C H A P T E R 3 The PC Interface Driver recognized by the programs on the Mac OS and the PC that are sending and receiving messages. The programs on both the PC and the Mac OS must request command numbers from the PC Interface driver before sending messages. Macintosh Interface 3 Programs on the Mac OS communicate with the PC Interface driver through driver calls.
C H A P T E R 3 The PC Interface Driver On the PC 3 To register your messages from a PC program, load the 32-bit selector into register EBX and the message count in register CX; then call INT 5Fh with AH = 4. The PC Interface driver returns the base command number in register BX. Register AH contains an error code if the messages could not be allocated. Sending a Message 3 To send a message, you must pass a message parameter block (MsgPBlk) to the PC Interface driver.
C H A P T E R 3 The PC Interface Driver Parameter block → ioCompletion long ← ioResult word → ioRefNum word → csCode word Equals rsSendMessage → csParam+0 long Pointer to MsgPBlk Pointer to the completion routine Your completion routine is called at Deferred time and can use registers D0–D2 and A0–A1. You must save all other registers. Upon return, A0 contains a pointer to the MsgPBlk structure. On the PC 3 The MsgPBlk data structure on the PC has the following format.
C H A P T E R 3 The PC Interface Driver Installing a Message Handler 3 Before you can receive messages, you must install a message handler. The PC Interface driver calls the message handler when the driver receives a message with a command value greater than or equal to recCmdBase and less than recCmdBase + recCmdCount in the MsgRecElem data structure. The driver passes the message’s 16-bit command and the two 32-bit parameters to your message handler.
C H A P T E R 3 The PC Interface Driver Parameter block → ioCompletion long ← ioResult word → ioRefNum word → csCode word Equals rsInstallMsgHandler → csParam+0 long Pointer to MsgRecElem Pointer to the completion routine When your message handler procedure is called, D0.w contains the message command, D1.l contains the msgParam1 value, D2.l contains the msgParam2 value, and A1 contains a pointer to the MsgRecElem record.
C H A P T E R 3 The PC Interface Driver Removing a Message Handler 3 Message handlers can be called until they are removed. Before your program terminates, you must remove the handler so that the PC Interface driver will not call it after you are gone. On the Mac OS 3 To remove a message handler on the Mac OS, your program makes an appropriate control call to the PC Interface driver and passes it a pointer to the handler.
Index Numerals connectors joystick 9 monitor 8 serial port 6 CT2501 sound system IC 30 16C450 serial port IC 27 80486DX2 microprocessor 14 8242 keyboard controller IC 28 82C450 VGA controller IC 26 84031memory controller IC 17, 18, 19–20 84035 data path controller IC 17, 20–21 reset logic in 21 D, E data misalignment 15, 17 DMA 3, 18, 27 DMA channels for I/O transfers 27 for memory access 27 DMA data register 18 DRAM access time of 19 control of 19 A abbreviations xi–xii AJA bus controller IC 29 APDA x
I N D E X J P, Q joystick 9 joystick connector 9 parallel port 7 PC, comparison of DOS Compatibility Card with 4 PC Interface driver 34, 51 close routine 34 configuring the PC 34 control and status calls 39 rsActivateKB routine 43 rsBeginMouseTracking routine 43 rsBootPC routine 41 rsDeactivateKB routine 43 rsDisableVideo routine 42 rsDontMountDisks routine 42 rsEnableVideo routine 41 rsEndMouseTracking routine 44 rsEndPrintJob routine 44 rsLastError routine 45 rsMountDisks routine 42 rsPCStatus routine
I N D E X RS-232 signals 7, 27 RS-232 signals not supported 27 RS-422 signals 7, 27 rsActivateKB routine 43 rsBeginMouseTracking routine 43 rsBootPC routine 41 RSComConfig data structure 37, 38 rsDeactivateKB routine 43 rsDisableVideo routine 42 rsDontMountDisks routine 42 rsEnableVideo routine 41 rsEndMouseTracking routine 44 rsEndPrintJob routine 44 RSFixedDriveConfig data structure 35 RSGetNetDriveConfig routine 36 rsLastError routine 45 rsMountDisks routine 42 RSNetDriveConfig data structure 36, 37 RSP
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.