;Title MD-HD (Rev 22, Rel 1.9) 16_Jul_84 Copyright 1984 Morrow Designs Inc. ;Subttl -Global System Equates (10_Aug_84) ;----------------------------------------- ; ; Copyright 1983, 1984 ; Morrow Designs, Inc. ; San Leandro, Ca. ; John Zalabak ; ; ; This module is included in all of the MD11 source files. It ; contains all of the definitions which a) need to be globally accessed, ; (e.g. the ASCII character equates) and/or b) definitions which need to ; be globally managed (e.g. address definitions). ; Address definitions deserve further comment. ALL address usage ; is declared in this module. This is done to make memory management ; easier. It is NOT done to facilitate the sharing of data between ; modules. This practice should be avoided within this piece of software. ; Parameters are passed by using the General Operations Data ; Area. Provisions have been made in the cbios to overlay the user ; application interface portion of the general operations data area. ; ; Index of Definition Module ;--------------------------- ; ; Identification Information ; ASCII character equates ; ; Module Starting Addresses ; General Address Definitions ; Disk Module Address Definitions ; ; I/O Registers - Serial Ports ; I/O Registers - Counter Timer Chip ; I/O Registers - Disk Read ; I/O Registers - Disk Write ; ; Lo-Level Disk Error Codes ; Bios Level Disk Error Codes ; ; General Operations Data Area Definitions ; offsets within the Applications Interface Area ; MTAB Table Format (there must be 1 MTAB for each logical drive) ; page 64 ; ; Identification Information (20_Jul_84) ;--------------------------------------- ; RomRev equ 19h ;Rom Revision Number BadID equ 4B6Fh ;Bad Map ID Word (in the boot sector) BadRev equ 10h ;Bad Map Revision Number (in the bad map header) ;---------------------------------------------------------------------- ; Boolean Definitions (23_Mar_84) ;-------------------------------- ; true equ -1 false equ not true ; ASCII character equates ;------------------------ ; cr equ 0Dh ;carriage return lf equ 0Ah ;line feed bell equ 07h ;bell asc0 equ '0' ;ascii 0 asca equ 'A' ;ascii A asci equ 'I' ;ascii I ascr equ 'R' ;ascii R ; Module Starting Addresses (16_Jul_84) ;-------------------------------------- ; 1) The UnUsed Space has been accumulated between O_Dsk2 and O_Test. ; O_Main equ 0h ;Main line (hd*main.mac) O_IO equ 220h ;Rom Level I/O (hd*io.mac) O_Bios equ 340h ;Rom Level Bios Support (hd*bios.mac) O_Dsk1 equ 4F0h ;Hi-Level Disk Drivers (hd*dsk1.mac) O_Dsk2 equ 0ED0h ;Lo-Level Disk Drivers (hl*dsk2.mac) O_Test equ 19A0h ;Test and Diagnostics (hd*test.mac) O_HiRm equ 1E00h ;Code for hard disk drivers (hd*hirm.mac) ; General Address Definitions (14_Nov_83) ;---------------------------------------- ; rom equ 0 ;Start of the ROM Memtop equ 0FFFFh ;Top Most Address of memory CSboot equ 0FE00h ;Cold Start Boot loader execution location combuf equ 0FE00h ;Start of the Common Buffer for disk operations ramdat equ 0FC00h ;Start of the default IX, IY and MTABs stack equ 0FC00h ;Stack dskbuf equ 2800h ;Start of the Disk Buffer prebuf equ dskbuf - 20h ;Main Entry Point to the read/write routines postbuf equ dskbuf + 400h ;End of the disk buffer genbuf equ dskbuf + 440h ;Start of the Scratch buffer fmtbuf equ dskbuf + 480h ;Start of the Format Buffer altbuf equ dskbuf + 500h ;Start of memory image of the bad map ; page ; Disk Module Address Definitions ;-------------------------------- ; ;Pre-Buffer Definitions (14_Nov_83) hdID1 equ prebuf+2 ;Hard Disk ID 1 (Sector Header Sync and ID) hngloc equ prebuf+3 ;Location of the PCHL (hang location) header equ prebuf+4 ;Header Image address hdID2 equ prebuf+0Ch ;Hard Disk ID 2 (Data Header Sync and ID) hdID3 equ prebuf+1Eh ;Hard Disk ID 3 (Data Header Sync and ID) ;General Buffer Definitions (13_Dec_83) cpydrv equ genbuf ;Copy of Drive Strobe Register (drvstb) cpymod equ genbuf+1 ;Copy of Mode Register (mode) premsk equ genbuf+2 ;Save loc for write precompensation mask lcmsk equ genbuf+3 ;Save loc for low current mask revs equ genbuf+4 ;Number of revolutions before index error error equ genbuf+5 ;Temp Error register for floppy disk operations RomErr equ genbuf+6 ;Rom Level Error Code rtycnt equ genbuf+7 ;Current Retry count blocks equ genbuf+8 ;Number 32 byte blocks for current sector size filchr equ genbuf+9 ;Fill byte (4E or FF) savpc equ genbuf+10 ;Save Location for the value of write pre-comp savlc equ genbuf+11 ;Save Location for the value of low current savehl equ genbuf+12 ;Save Location for the HL register pair cyltbl equ genbuf+14 ;Table of drive's Current Cylinder positions badtrk equ genbuf+22 ;Bad Map Track Number (lo byte) ; " " " " (hi byte) badhd equ genbuf+24 ;Bad Map Head badsec equ genbuf+25 ;Bad Map Sector badoff equ genbuf+26 ;Offset to start of bad map (lo byte) ; " " " " " " (hi byte) badmap equ genbuf+28 ;Pointer to start of bad map buffer (lo byte) ; " " " " " " " (hi byte) piobuf equ genbuf+30 ;Swap buffer for phyical param. & I/O address ;Format Buffer Definitions (14_Nov_83) gaptbl equ fmtbuf ;Define the start of the format table gap1 equ fmtbuf ;Post index gap gap3 equ fmtbuf+1 ;Inter-Sector gap gap5 equ fmtbuf+2 ;Pre-ID-Index mark gap HDstbl equ fmtbuf+3 ;Hard Disk Sector Skew Table FDstbl equ fmtbuf+12 ;Floppy Disk Sector Skew Table ;Disk Interrupt Vector Locations IRQbase equ memtop and 0FF00h ;Page address of interrupt vector table FDIvct equ IRQbase or 0F0h ;Floppy Disk Index Vector FDMvct equ IRQbase or 0F2h ;Floppy Disk Match Vector HDIvct equ IRQbase or 0F4h ;Hard Disk Index Vector HDMvct equ IRQbase or 0F6h ;Hard Disk Match Vector ; page ; I/O Registers - Serial Ports ;----------------------------- ; s1data equ 60h ;serial port 1 data (dart1 = console port) s1stat equ 61h ;serial port 1 status s2data equ 62h ;serial port 2 data (dart2 = printer port) s2stat equ 63h ;serial port 2 status s3data equ 70h ;serial port 3 data (sio) s3stat equ 71h ;serial port 3 status (sio) $TxRdy equ 00000100b ;Uart Transmitter Ready Bit $RcvRdy equ 00000001b ;Uart Reciever Ready Bit ; I/O Registers - Counter Timer Chip ;----------------------------------- ; 1) The labels baud0, baud1 and baud2 correspond to the schematic labels ; for the signals carrying the baud rate clocks to the dart/sio. baud0 ; is the clock for serial port 1. ; baudset equ 53h ;ctc channel select/mode port baud0 equ 52h ;baud rate control for serial port 1 (consol) baud1 equ 51h ;baud rate control for serial port 2 baud2 equ 50h ;baud rate control for serial port 3 ; I/O Registers - Disk Read (8_Jun_84) ;------------------------------------- ; DrvSts equ 0C0h ;Drive Status @Index equ 7 ; Index Status - Index Not Processed $INDEX equ 10000000b ; Index active $TRK0 equ 01000000b ; Track Zero active $JBAUD equ 00100000b ; Console Baud Rate Jumper (1=19200,0=9600) $CRCSET equ 00010000b ; In Sync Flag (CRC set) $WPROT equ 00001000b ; Write Protect asserted $FAULT equ 00000100b ; Disk Fault $SEEKC equ 00000010b ; Seek Complete $READY equ 00000001b ; Drive Ready CStat equ 0C1h ;Centronics status port $DIAGM equ 00001000b ; Select diagnostics mode $CFAULT equ 00000100b ; Printer Fault $MTR equ 00000010b ; Motor on (drive active) $CNTRDY equ 00000001b ; Centronics Ready line ClrInt equ 0C2h ;Clear interrupts RdShfH equ 0C7h ;Read shift register data ; page ; I/O Registers - Disk Write ;--------------------------- ; DrvStb equ 040h ;Drive Strobe (local copy => cpydrv) $STEP equ 10000000b ; Step one track $DIR equ 01000000b ; Direction of step (0=out[home], 1=in) $LC equ 00100000b ; Low Current $HD2 equ 00010000b ; Head Select 2 $HD1 equ 00001000b ; Head Select 1 $HD0 equ 00000100b ; Head Select 0 $DS1 equ 00000010b ; Drive Select 1 $DS0 equ 00000001b ; Drive Select 0 BnkStb equ 41h ;Bank Strobe $CNTIRQ equ 10000000b ; Centronics interrupt enable $XFER equ 01000000b ; Inter-bank transfer (1=true) $MTRON equ 00100000b ; Motor On $AUTOE equ 00010000b ; Hard Disk Read/Write $CNTSTB equ 00001000b ; Printer Strobe $CNTRST equ 00000100b ; Printer Restore $BANK1 equ 00000000b ; Select Bank 1 (dummy def for coding clarity) $BANK2 equ 00000010b ; Select Bank 2 (1=true) $_RMENB equ 00000001b ; Enable Rom (0=true) cdata equ 42h ;Centronics data port wrtshf equ 047h ;Write shift register data mode equ 04Bh ;Write mode register (local copy => cpymod) $OP1 equ 10000000b ; Hard Disk Operation 1 $OP2 equ 01000000b ; Hard Disk Operation 0 $N1 equ 00100000b ; Hard Disk Sector Size 1 $N0 equ 00010000b ; Hard Disk Sector Size0 1 $MFM equ 00001000b ; MFM/FM (Double/Single Density) $ALT equ 00000100b ; Alternate Mark Select for Compare $STD equ 00000010b ; Standard/Mini Floppy Select $PRECMP equ 00000001b ; Pre-compensation Assert ctlstb equ 04Fh ;Control Strobe $READ equ 10000000b ; Read Data $CMPR equ 01000000b ; Compare Data $WRITE equ 01000000b ; Write (synonym for Compare) $_CRC equ 00100000b ; Enable CRC Generation $MARK equ 00010000b ; Search For Mark Byte ; Spare $INTE equ 00000100b ; Enable Interrupts $SR equ 00000010b ; Source Shift Register $CRC equ 00000001b ; " CRC Generator $RAM equ 00000000b ; " RAM ; page ;---------------------------------------------------------------------- ; Lo_Level Disk Operation Error Codes (18_Jan_84) ;------------------------------------------------ ; 1) This is the table of the rom level error codes. These codes exist ; only in the disk module. ; 2) Notice that the two most signifigant bits are used to indicate ; errors that should NOT be retried and re:mappable errors. ; ;Special Error Flags $NOTRY equ 10000000b ;Do not attempt a retry of this operation $REMAP equ 01000000b ;Error can cause a re:mapping of current sector ;Rom Level Error Codes Eum equ 1 ;Unreadable Media Ehd equ 2 ;Header Error Eha equ 3 or $REMAP ;Mismatch: Header ID address mark Ehc equ 4 or $REMAP ;Mismatch: Header CRC Eda equ 5 or $REMAP ;Mismatch: Data address mark Edc equ 6 or $REMAP ;Mismatch: Data CRC Esk equ 7 ;Mismatch: Track Number (seek error) Ehn equ 8 or $NOTRY ;Mismatch: Head Number Esn equ 9 or $REMAP ;Mismatch: Sector Number Ess equ 10 or $NOTRY ;Mismatch: Sector Size Enh equ 11 ;Drive failed to find track 0 Emc equ 12 or $NOTRY ;Maximum Cylinder Number Exceeded Enr equ 13 ;Drive not ready Eto equ 14 or $NOTRY ;Motor Time-Out Failure Ewp equ 15 or $NOTRY ;Write Protected Ewf equ 16 or $NOTRY ;Write Fault Ebf equ 17 or $NOTRY ;Bad Map is Full Ebi equ 18 or $NOTRY ;Bad Map ID does not match Ebr equ 19 or $NOTRY ;Bad Map Revision Number Doesn't Match Ebn equ 20 or $NOTRY ;Bad Map not opened Enf equ 21 ;Data not found (time-out looking for data) Euk equ 22 or $NOTRY ;Unknown Error Code ; Bios Level Disk Operation Error Codes (18_Dec_83) ;-------------------------------------------------- ; 1) This is a table of the error codes that are passed to the bios. ; ; MD-11 MD-3 ERwp equ 1 ;Write Protected write protect 1 ERsk equ 2 ;Seek Error seek error 2 ERdac equ 3 ;Data Address CRC data crc 3 ERidc equ 4 ;ID Address CRC id crc 4 ERnf equ 5 ;Not Found not found 5 ERnr equ 6 ;Not Ready drive not ready 6 ERmf equ 7 ;Media Failure sync 7 ERef equ 8 ;Equipment Failure equipment check 8 ; invalid command 9 ERuk equ 10 ;Unknown Error Code unknown error 10 ERbm equ 11 ;Unable to ReMap ----- ; page ; Offsets within the General Operations Data Area (18_Jan_84) ;------------------------------------------------------------ ; SekDsk equ 0 ;BDOS disk number SekTrk equ 1 ;BDOS track number ; SekSec equ 3 ;BDOS sector number ; SekHst equ 5 ;Sector number on the disk ; UnaCnt equ 7 ;unallocated rec count UnaDsk equ 8 ;unallocated disk UnaTrk equ 9 ;unallocated track ; UnaSec equ 11 ;unallocated sector ; UnaMax equ 13 ;sectors per allocation block SecTrk equ 14 ;Logical Sectors per track ; PhySPT equ 16 ;Physical Sectors per track WrType equ 17 ;write type wrall equ 0 ; write allocatted wrdir equ 1 ; write directroy wrual equ 2 ; write unallocatted Cflag equ 18 ;Cflag: Bit @xl_in equ 0 ; 0 Translate input function keys @xl_out equ 1 ; 1 Translate output controls and escapes @FstSlw equ 2 ; 2 Function keys Fast/Slow Flag @siosyn equ 3 ; 3 Hardware handshake for SIO @hwsync equ 4 ; 4 Hardware handshake for list device @cenlst equ 5 ; 5 Centronics is list device @imsact equ 6 ; 6 In memory submit flag (1=sub active) @imswet equ 7 ; 7 IMS buffer full (1=buffer has chars) DFlag equ 19 ;Dflag: Bit @hstacô equ 0 ; 0 hosô activå flaç (1=sector in buffer) @hstwrô equ 1 ; 1 hosô writteî flaç (1=buffer writteî) @rsflag equ 2 ; 2 read sector flag (1=need a read) @readop equ 3 ; 3 read operation flag (1=read 0=write) @fmoton equ 4 ; 4 floppy disk motor has been turned on (1=true) @curbad equ 5 ; 5 Bios copy of Mtab's @HasBad bit @maper equ 6 ; 6 Error can cause remapping of the sector @maprd equ 7 ; 7 Bad Map has been read TrSeã equ 20 ;offset to logicaì sectoò withiî physicaì sectoò VmsgP equ 21 ;pointer to virt drive mesg. ; VdrvP equ 23 ;pointer to virt drive in mesg. ; CDsk equ 25 ;current drive VDsk equ 26 ;current virtual drive DmaAdr equ 27 ;BDOS dma address ; CnOut equ 29 ;pointer to current console output routine ; CnIn equ 31 ;pointer to current console input routine ; CnSts equ 33 ;Pointer to the current console input status routine ; CpyBnk equ 35 ;Copy of the Current value of the bnkstb (port 41h) GOleng equ 36 ;Define the length of the general operations area ; Offsets within the Application Interface Area (18_Jan_84) ;---------------------------------------------------------- ; AIoff equ 36 ;Define offset from start of IY to start of AI HstDsk equ 0 + AIoff ;host disk (forms pointer to MTAB) HstTrk equ 1 + AIoff ;host track ; HstSec equ 3 + AIoff ;host sector (physical sector) ; SecCnt equ 5 + AIoff ;sector count is number of sectors to transfer Retry equ 6 + AIoff ;retry count = retries for read/write operations HstBuf equ 7 + AIoff ;pointer to disk data buffer ; ErFlag equ 9 + AIoff ;Error Flag OpFlag equ 10 + AIoff ;Options Flag: (1=true) ; 0 Not Used @RomIO equ 1 ; 1 Rom is doing console io (Suppress IMS) @InMap equ 2 ; 2 Sector is in the bad map @BufOK equ 3 ; 3 Buffer Data is valid @Recal equ 4 ; 4 Recalibrate the drive @NoVer equ 5 ; 5 Supress Verification of track on seek @SerUR equ 6 ; 6 Suppress User response to errors @SerD equ 7 ; 7 Suppress Error Display PhyTrk equ 11 + AIoff ;Physical Track ; PhyHd equ 13 + AIoff ;Physical Head PhySec equ 14 + AIoff ;Physical Sector PhyDrv equ 15 + AIoff ;Physical Drive address IOadd equ 16 + AIoff ;execution address of disk i/o (rdio/wrio/fmtio) ;(high byte of execution address) AIleng equ 18 ;Define the length of the Application Interface ; page ;---------------------------------------------------------------------- ; MTAB Table Format (there must be 1 MTAB for each logical drive) ;---------------------------------------------------------------- ; MToff equ 18 + AIoff ;Define offset from start of IY to start of MTAB DskDef0 equ 0 ;Flag Register (Active=True=Asserting=1) @Vd equ 7 ; Virtual Drive (1) @Frgn equ 6 ; Foreign Drive (1) @SecZro equ 5 ; Sector numbers start at zero (1) @DblMed equ 2 ; Double(1)/Single Sided Media $HdMsk equ 00011100b ; Head Mask ; ; $PhyAdr equ 00000011b ; Physical Drive Mask @HrdDsk equ 1 ; Hard Disk Flag DskDef1 equ 1 ;Flag Register (Active=True=Asserting=1) @DrvCal equ 7 ; Drive Calibrated(1) @DrvRdy equ 6 ; Drive Has Ready Line(1) @DrvDen equ 5 ; Double(1)/Single Density Media @DrvSiz equ 4 ; Standard_8"(1)/Mini_5.25" Select @HasBad equ 3 ; Drive Has a Bad Map @FstSek equ 2 ; Drive has Fast Seek capabilities $SizMsk equ 00000011b ; Sector Mask ; 00 - 128 Bytes/sector ; 01 - 256 Bytes/sector ; 10 - 512 Bytes/sector ; 11 - 1024 Bytes/sector DskDef2 equ 2 ;Spare Disk Definition Byte PrkOff equ 3 ;Park offset (number of tracks past maxcyl) MaxCyl equ 4 ;Maximum Number of Cylinders (lo) ; StpRat equ 6 ;Step Rate StpSet equ 7 ;Step Settling Time StpRcl equ 8 ;Recalibration Step Rate HldDly equ 9 ;Head Load delay time MotDly equ 10 ;Motor On delay time StrPre equ 11 ;Starting Track of Write Pre-Compensation (lo) ; StrLoc equ 13 ;Starting Track of Lo-Current (lo) ; FmtTyp equ 15 ;Format Type