PAGE ; Disk Input / Output port assignments. FDPORT EQU 0C0H ;Base port address for Controller FDCS EQU FDPORT ;Status register FDCD EQU FDPORT+1 ;Data register DMA EQU FDPORT+2 ;Dma address (when write) INTS EQU FDPORT+2 ;Status Register (when read) SER EQU FDPORT+3 ;Serial port ; Controller function definitions F.SPEC EQU 03 ;Specify F.DSTS EQU 04 ;Drive status F.WRT EQU 05 ;Write data F.RDAT EQU 06 ;Read data F.RECA EQU 07 ;recalibrate F.RSTS EQU 08 ;Read status F.DRID EQU 10 ;Read ID F.SEEK EQU 15 ;Seek ; Disk drive constants STEPR: EQU 8 ;Shugart 800 SRT: EQU 16-STEPR ;Controller value HUT: EQU 240/16 ;Head unload = 240 ms HLT: EQU 35 ;Head load = 35 ms ND: EQU 0B ;Set DMA mode SPACE 4,10 ; 7 6 5 4 3 2 1 0 ; +----+----+----+----+----+----+----+----+ ; ST0 | IC | SE | EC | NR | HD | US | ; +----+----+----+----+----+----+----+----+ ; ST1 | EN | | DE | OR | | ND | NW | MA | ; +----+----+----+----+----+----+----+----+ ; ST2 | | CM | DD | WC | SH | SN | BC | MD | ; +----+----+----+----+----+----+----+----+ ; ST3 | FT | WP | RY | T0 | TS | HD | US | ; +----+----+----+----+----+----+----+----+ ; ; IC - Interrupt code. ; 00 - Normal termination by TC signal. ; 01 - Abnormal termination. ; 10 - Invalid command. ; 11 - Abnormal termination (READY dropped). ; ; SE - Seek end, indicates end of seek. ; ; EC - Equipment Check. ; ; NR - Not ready. ; ; HD - State of the head select. ; ; US - State of the unit select. ; ; ; EN - End of Cylinder, Read EOT sector. ; ; DE - CRC error in ID or data fields. ; ; OR - Over run. ; ; ND - No Data. ; ; NW - Not writable (write protect detected) ; ; MA - Missing address mark. ; ; ; CM - Control Mark (deleted data address mark). ; ; DD - CRC error in data field. ; ; WC - Wrong cylinder. ; ; SH - Scan equal hit. ; ; SN - Scan not satisfied. ; ; BC - Bad cylinder. ; ; MD - Missing data mark. ; ; ; FT - Fault. ; ; WP - Write protect signal. ; ; RY - Ready. ; ; T0 - Track zero. ; ; TS - Two sided disk is inserted. page IF HARD IF DISK2 ;**************************************************************** ;* * ;* CompuPro Disk2 equates. * ;* * ;**************************************************************** hdport equ 0c8h ;Base port address hdctl equ hdport ;Control/Status port hddata equ hdport+1 ;Data port ; ; out hdctl 7 6 5 4 3 2 1 0 ; | | | | | | | | ; attn <----------+ | | | | | | | ; run <---------------+ | | | | | | ; opcode <----------------+---+---+ | | | ; fault clear <-----------------------+ | | ; Unit select <---------------------------+---+ ; ; in hdctl 7 6 5 4 3 2 1 0 ; | | | | | | | | ; opdone* <-------+ | | | | | | | ; timeout <-----------+ | | | | | | ; not equal <-------------+ | | | | | ; over run <------------------+ | | | | ; ready* <------------------------+ | | | ; seek complete* <--------------------+ | | ; write fault* <--------------------------+ | ; track 0* <----------------------------------+ ; DISK2 Commands h.red equ 0c8h ;Read data command h.wrt equ 0d0h ;Write data command h.tim equ 6 ;Time out h.dvs equ 80h ;Drive strobe h.hed equ 90h ;Head register h.cyl equ 88h ;Cylinder register h.sec equ 98h ;Sector register h.sin equ 0a0h ;Step in h.sou equ 80h ;Step out ; Selector channel equates selchan equ 0f0h ;Selector channel port pri equ 10 ;Disk priority selbyt equ 0fh-pri+20h ;Selector channel command byte ENDIF IF DISK3 ;*************************************************** ; * ; COMPUPRO DISK3 EQUATES * ; * ;*************************************************** D3PORT EQU 90H ;DISK3 Attention port ; ATTN EQU 0 ;Call DISK3s by outing this to D3PORT RESET EQU 0000_0001b ;Reset only board 1 DEFIOPB EQU 50H ;Default IOPB block is at 0:50h DEFSEG EQU 0 ; ; DISK3 commands used in this BIOS D3NOOP EQU 0 ;DISK3 does nothing D3VER EQU 1 ;Get version number of DISK3 EPROM D3GLBL EQU 2 ;Set global parameters D3SPEC EQU 3 ;Specify drive types to D3 D3MAP EQU 4 ;Set relocate map to DISK3 board D3HOME EQU 5 ;Home drive D3TSRW EQU 8 ;Read/Write a sector D3REL EQU 9 ;Relocate bad sector command D3RD EQU 1 ;D3TSRW wants a 1 for a read D3WRT EQU 0 ; and a 0 for a write ; Offsets into IOPB CMND EQU 0 ;Command to execute STAT EQU 1 ;Status and error codes here DRV EQU 2 ;# of current drive ARG0 EQU CMND+2 RWF EQU ARG0+1 ;1 for read, 0 for write SEC EQU ARG0+2 ;16 bits for sector # TRK EQU ARG0+4 ;16 bits for track # NUMSECS EQU ARG0+6 ;16 bits for # of consecutive sectors to read D3DMA EQU 10 ;Address to get/put data LINK EQU 13 ;Pointer to next IOPB ; ; IOPB +0 -- command ; +1 -- status ; +2 -- drive # ; +3 -- ARG1 - r/w flag ; +4 -- ARG2 - sector number - low byte ; +5 -- high byte ; +6 -- ARG4 - Track number - low byte ; +7 -- - high byte ; +8 -- ARG6 - Number of sectors to transfer - low byte ; +9 -- high byte ; +10 -- DMA address - lsb ; +11 -- ; +12 -- msb ; +13 -- LINK address - lsb ; +14 -- ; +15 -- msb ; ; ERROR codes - returned in IOPB+STAT ; ; 0 -- BUSY ; ; 1 -- Argument range error ; ; 2 -- Drive not ready ; ; 3 -- Time out -- header not found ; ; 4 -- Data CRC error ; ; 5 -- Write Fault ; ; 6 -- Overrun ; ; 7 -- Header noncompare ; ; 8 -- Relocate map full ; BUSY EQU 0 COMPL EQU 0FFH ENDIF ENDIF ;*************************************************** ; * ; COMPUPRO M-DRIVE/H EQUATES * ; * ;*************************************************** ; HDBASE EQU 0C6H ;Base of M-DRIVE/H board HDATA EQU HDBASE ; DATA port HADDÒ EQÕ HDBASE+1 ; Address counter port PAGE ; Sector Translation Tables. XTABLE: DW XLTS ;Single 128 DW XLTD1 ;Double 256 DW XLTD2 ;Double 512 DW XLTD3 ;Double 1024 XLTS: DB 0,6,12,18,24,4,10,16,22,2,8,14,20 DB 1,7,13,19,25,5,11,17,23,3,9,15,21 XLTD1: DB 0, 1,18,19,36,37, 2, 3,20,21,38,39 DB 4, 5,22,23,40,41, 6, 7,24,25,42,43 DB 8, 9,26,27,44,45,10,11,28,29,46,47 DB 12,13,30,31,48,49,14,15,32,33,50,51 DB 16,17,34,35 XLTD2: DB 0, 1, 2, 3,16,17,18,19 DB 32,33,34,35,48,49,50,51 DB 4, 5, 6, 7,20,21,22,23 DB 36,37,38,39,52,53,54,55 DB 8, 9,10,11,24,25,26,27 DB 40,41,42,43,56,57,58,59 DB 12,13,14,15,28,29,30,31 DB 44,45,46,47 XLTD3: DB 0, 1, 2, 3, 4, 5, 6, 7 DB 24,25,26,27,28,29,30,31 DB 48,49,50,51,52,53,54,55 DB 8, 9,10,11,12,13,14,15 DB 32,33,34,35,36,37,38,39 DB 56,57,58,59,60,61,62,63 DB 16,17,18,19,20,21,22,23 DB 40,41,42,43,44,45,46,47 PAGE ; Initialze for DSKMSK ; DRV1: SET 0 DRV2: SET 0 DRV3: SET 0 DRV4: SET 0 DRV5: SET 0 DRV6: SET 0 DRV7: SET 0 DRV8: SET 0 DRV9: SET 0 DRV10: SET 0 DRV11: SET 0 DRV12: SET 0 DRV13: SET 0 DRV14: SET 0 DRV15: SET 0 DRV16: SET 0 ; Control Blocks for disk drives DPBASE: if @ldr <> 0 if order = 0 DPHGEN 1,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive A: ENDIF if order = 1 IF GBC20 DPHGEN 1,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive A: ENDIF IF GBC10 DPHGEN 1,DSK8M1,0,DIRBUF,DPBM81+1 ;Drive A: ENDIF endif else if order = 0 DPHGEN 1,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive A: DPHGEN 2,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive B: If not hard DPHGEN 3,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive C: DPHGEN 4,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive D: ENDIF IF GBC20 DPHGEN 3,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive C: DPHGEN 4,DSK8F2,0,DIRBUF,DPBF82+1 ;Drive D: DPHGEN 5,DSK8F3,0,DIRBUF,DPBF83+1 ;Drive E: if x2gbc20 DPHGEN 6,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive F: DPHGEN 7,DSK8F2,0,DIRBUF,DPBF82+1 ;Drive G: DPHGEN 8,DSK8F3,0,DIRBUF,DPBF83+1 ;Drive H: endif ENDIF IF GBC10 DPHGEN 3,DSK8M1,0,DIRBUF,DPBM81+1 ;Drive C: DPHGEN 4,DSK8M2,0,DIRBUF,DPBM82+1 ;Drive D: ENDIF IF GBF40 DPHGEN 3,DSKFF1,0,DIRBUF,DPBFF1+1 ;Drive C: DPHGEN 4,DSKFF2,0,DIRBUF,DPBFF2+1 ;Drive D: DPHGEN 5,DSKFF3,0,DIRBUF,DPBFF3+1 ;Drive E: DPHGEN 6,DSKFF4,0,DIRBUF,DPBFF4+1 ;Drive F: DPHGEN 7,DSKFF5,0,DIRBUF,DPBFF5+1 ;Drive G: endif if x2gbf40 DPHGEN 8,DSKFF1,0,DIRBUF,DPBFF1+1 ;Drive H: DPHGEN 9,DSKFF2,0,DIRBUF,DPBFF2+1 ;Drive I: DPHGEN 10,DSKFF3,0,DIRBUF,DPBFF3+1 ;Drive J: DPHGEN 11,DSKFF4,0,DIRBUF,DPBFF4+1 ;Drive K: DPHGEN 12,DSKFF5,0,DIRBUF,DPBFF5+1 ;Drive L: endif .d3 IF DISK3 IF ST506 DPHGEN 3,DSK506,0,DIRBUF,DPB506+1 ;Drive C: ENDIF IF Q540 DPHGEN 3,DSKQ51,0,DIRBUF,DPBQ51+1 ;Drive C: DPHGEN 4,DSKQ52,0,DIRBUF,DPBQ52+1 ;Drive D: DPHGEN 5,DSKQ53,0,DIRBUF,DPBQ53+1 ;Drive E: DPHGEN 6,DSKQ54,0,DIRBUF,DPBQ54+1 ;Drive F: DPHGEN 7,DSKQ55,0,DIRBUF,DPBQ55+1 ;Drive G: IF XQ540 DPHGEN 8,DSKQ51,0,DIRBUF,DPBQ51+1 ;Drive H: DPHGEN 9,DSKQ52,0,DIRBUF,DPBQ52+1 ;Drive I: DPHGEN 10,DSKQ53,0,DIRBUF,DPBQ53+1 ;Drive J: DPHGEN 11,DSKQ54,0,DIRBUF,DPBQ54+1 ;Drive K: DPHGEN 12,DSKQ55,0,DIRBUF,DPBQ55+1 ;Drive L: ENDIF ;XQ540 ENDIF ;Q540 .d3 ENDIF ENDIF if order = 1 IF GBC20 DPHGEN 1,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive A: DPHGEN 2,DSK8F2,0,DIRBUF,DPBF82+1 ;Drive B: DPHGEN 3,DSK8F3,0,DIRBUF,DPBF83+1 ;Drive C: if x2gbc20 ; These are for a second 20 meg fujistu DPHGEN 4,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive D: DPHGEN 5,DSK8F2,0,DIRBUF,DPBF82+1 ;Drive E: DPHGEN 6,DSK8F3,0,DIRBUF,DPBF83+1 ;Drive F: DPHGEN 7,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive G: (2GBC20) DPHGEN 8,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive H: (2GBC20) else DPHGEN 4,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive D: (GBC20) DPHGEN 5,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive E: (GBC20) endif ENDIF IF GBC10 DPHGEN 1,DSK8M1,0,DIRBUF,DPBM81+1 ;Drive A: DPHGEN 2,DSK8M2,0,DIRBUF,DPBM82+1 ;Drive B: DPHGEN 3,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive C: (GBC10) DPHGEN 4,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive D: (GBC10) ENDIF IF GBF40 DPHGEN 1,DSKFF1,0,DIRBUF,DPBFF1+1 ;Drive A: DPHGEN 2,DSKFF2,0,DIRBUF,DPBFF2+1 ;Drive B: DPHGEN 3,DSKFF3,0,DIRBUF,DPBFF3+1 ;Drive C: DPHGEN 4,DSKFF4,0,DIRBUF,DPBFF4+1 ;Drive D: DPHGEN 5,DSKFF5,0,DIRBUF,DPBFF5+1 ;Drive E: if x2gbf40 ;if 2 40 meg drives DPHGEN 6,DSKFF1,0,DIRBUF,DPBFF1+1 ;Drive F: DPHGEN 7,DSKFF2,0,DIRBUF,DPBFF2+1 ;Drive G: DPHGEN 8,DSKFF3,0,DIRBUF,DPBFF3+1 ;Drive H: DPHGEN 9,DSKFF4,0,DIRBUF,DPBFF4+1 ;Drive I: DPHGEN 10,DSKFF5,0,DIRBUF,DPBFF5+1 ;Drive J: DPHGEN 11,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive K: (GBF40) DPHGEN 12,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive L: (GBF40) else DPHGEN 6,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive F: (GBF40) DPHGEN 7,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive G: (GBF40) endif endif .d3 IF DISK3 IF ST506 DPHGEN 1,DSK506,0,DIRBUF,DPB506+1 ;Drive A: DPHGEN 2,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive B: DPHGEN 3,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive C: ENDIF IF Q540 DPHGEN 1,DSKQ51,0,DIRBUF,DPBQ51+1 ;Drive A: DPHGEN 2,DSKQ52,0,DIRBUF,DPBQ52+1 ;Drive B: DPHGEN 3,DSKQ53,0,DIRBUF,DPBQ53+1 ;Drive C: DPHGEN 4,DSKQ54,0,DIRBUF,DPBQ54+1 ;Drive D: DPHGEN 5,DSKQ55,0,DIRBUF,DPBQ55+1 ;Drive E: IF XQ540 ;If second q540 DPHGEN 6,DSKQ51,0,DIRBUF,DPBQ51+1 ;Drive F: DPHGEN 7,DSKQ52,0,DIRBUF,DPBQ52+1 ;Drive G: DPHGEN 8,DSKQ53,0,DIRBUF,DPBQ53+1 ;Drive H: DPHGEN 9,DSKQ54,0,DIRBUF,DPBQ54+1 ;Drive I: DPHGEN 10,DSKQ55,0,DIRBUF,DPBQ55+1 ;Drive J: DPHGEN 11,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive K: DPHGEN 12,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive L: DPHGEN 14,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive N: ELSE ;XQ540 DPHGEN 6,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive F: DPHGEN 7,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive G: DPHGEN 8,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive H: ENDIF ;XQ540 ENDIF ;Q540 .d3 ENDIF ENDIF ;Order ENDIF ;Order IF HDRIVE DPHGEN 13,HMDTYP,0,DIRBUF,DPBHMD+1 ;Drive M: (M-DRIVE/H) ENDIF space 4,10 ; Disk type definition blocks for each particular mode. DPBS1: ;Single density, single sided. DPBGEN DSKS1,26,3,7,0,S1DSM,64,1100000000000000b,2 DPBS2: ;Single density, double sided. DPBGEN DSKS2,26,4,15,1,S2DSM,128,1100000000000000b,2*2 DPBD1: ;Double density, single sided. ;NOTE: EXM should be 1, however changing now would lose ; compatiblity with older CompuPro systems. se la vi. DPBGEN DSKD1,2*26,4,15,0,D1DSM,128,1100000000000000b,2 DPBD2: ;Double density, double sided. DPBGEN DSKD2,2*26,4,15,0,D2DSM,256,1111000000000000b,2*2 DPBD3: ;Double density, single sided. DPBGEN DSKD3,4*15,4,15,0,D3DSM,128,1100000000000000b,2 DPBD4: ;Double density, double sided. DPBGEN DSKD4,4*15,4,15,0,D4DSM,256,1111000000000000b,2*2 DPBD5: ;Double density, single sided. DPBGEN DSKD5,8*8,4,15,0,D5DSM,128,1100000000000000b,2 DPBD6: ;Double density, double sided. DPBGEN DSKD6,8*8,4,15,0,D6DSM,256,1111000000000000b,2*2 IF GBC20 DPBF81: ;Fujitsu 20 megabyte first 8 megabytes DPBGEN DSK8F1,8*11,5,31,1,F81DSM,1024,1111111111111111b,1*8 DPBF82: ;Fujitsu 20 megabyte second 8 megabytes DPBGEN DSK8F2,8*11,5,31,1,F82DSM,1024,1111111111111111b,94*8 DPBF83: ;Fujitsu 20 megabyte first 8 megabytes DPBGEN DSK8F3,8*11,5,31,1,F83DSM,1024,1111111111111111b,187*8 ENDIF IF GBF40 DPBFF1: ;Fujitsu 40 megabyte first 8 megabytes DPBGEN DSKFF1,8*22,5,31,1,FF1DSM,1024,1111111111111111b,1*8 DPBFF2: ;Fujitsu 40 megabyte second 8 megabytes DPBGEN DSKFF2,8*22,5,31,1,FF2DSM,1024,1111111111111111b,50*8 DPBFF3: ;Fujitsu 40 megabyte third 8 megabytes DPBGEN DSKFF3,8*22,5,31,1,FF3DSM,1024,1111111111111111b,99*8 DPBFF4: ;Fujitsu 40 megabyte fourth 8 megabytes DPBGEN DSKFF4,8*22,5,31,1,FF4DSM,1024,1111111111111111b,147*8 DPBFF5: ;Fujitsu 40 megabyte fifth 8 megabytes DPBGEN DSKFF5,8*22,5,31,1,FF5DSM,1024,1111111111111111b,195*8 ENDIF IF GBC10 DPBM81: ;Fujitsu 10 megabyte first 5 megabytes DPBGEN DSK8M1,8*11,5,31,1,M81DSM,1024,1111111111111111b,1*4 DPBM82: ;Fujitsu 10 megabyte second 5 megabytes DPBGEN DSK8M2,8*11,5,31,1,M82DSM,1024,1111111111111111b,123*4 ENDIF .d3 IF DISK3 IF ST506 DPB506: DPBGEN DSK506,8*9,5,31,1,ST5DSM,1024,1111111111111111b,2 ENDIF IF Q540 DPBQ51: DPBGEN DSKQ51,8*9,5,31,1,Q51DSM,1024,1111111111111111b,2 DPBQ52: DPBGEN DSKQ52,8*9,5,31,1,Q52dSM,1024,1111111111111111b,2+(8*72) DPBQ53: DPBGEN DSKQ53,8*9,5,31,1,Q53DSM,1024,1111111111111111b,2+(8*212) DPBQ54: DPBGEN DSKQ54,8*9,5,31,1,Q54DSM,1024,1111111111111111b,2+(8*352) DPBQ55: DPBGEN DSKQ55,8*9,4,15,0,Q55DSM,256,1111000000000000b,2+(8*492) ENDIF .d3 ENDIF IF HDRIVE DPBHMD: DPBGEN HMDTYP,8,4,15,1,HMDDSM,128,1100_0000_0000_0000B,4 ENDIF ; Disk selection masks DSKMSK: DB DRV1 ;Drive A: DB DRV2 ;Drive B: DB DRV3 ;Drive C: DB DRV4 ;Drive D: DB DRV5 ;Drive E: DB DRV6 ;Drive F: DB DRV7 ;Drive G: DB DRV8 ;Drive H: DB DRV9 ;Drive I: DB DRV10 ;Drive J: DB DRV11 ;Drive K: DB DRV12 ;Drive L: DB DRV13 ;Drive M: DB DRV14 ;Drive N: DB DRV15 ;Drive O: DB DRV16 ;Drive P: