fh,0ffffh,0ffffh ; DIRBCB, DATBCB, TBLSEG. ; hard disk unit - 1. if nhard gt 1 dph9 dw 0000h,0000h ; translate table. dw 0000h,0000h ; scratch area. dw dpbh1 ; disk parameter block. dw 00000h,0ffffh ; checksum, allocation. dw 0ffffh,0ffffh,0ffffh ; DIRBCB, DATBCB, TBLSEG. endif ; hard disk unit - 2. if nhard gt 2 dph10 dw 0000h,0000h ; translate table. dw 0000h,0000h ; scratch area. dw dpbh2 ; disk parameter block. dw 00000h,0ffffh ; checksum, allocationdir3 ; directory mask. db 0ffh ; 16 bits for alloc. db 0ffh dw 8000h ; check size. dw offset3 ; offset. db 2 db 3 endif ; ********** End of Teletek HDC Hard Disk Driver **********  ; check size. dw offset2 ; offset. db 2 db 3 endif if nhard gt 3 dpbh3 dw heads * hrdspt ; physical sectors per cyl. db 0005 ; block shift. db 0031 ; block mask. db 0001 ; extent mask. dw hdsm3 ; disk size-1. dw hk 1 directory size minus one. offset0 equ 1 ; first track of logical drive 0. offset1 equ 257 ; first track of logical drive 1. endif if morrow ; if morrow controller. hrdspt equ 17 ; sectors per track. headdly equ 0 ; head settle delay. hdsm0 equ 2047 ; logical disk 0 size minus one. hdir0 equ 2047 ; logical disk 0 directory max. hdsm1 equ 1512 ; logical disk 1 size minus one. hdir1 equ 1512 ; logical disk 1 directory max. offset0 equ 1 ; first track of logical drive 0. offset1 eq equ 396 ; logical disk 1 size minus one. hdir1 equ 396 ; disk 1 directory size minus one. offset0 equ 1 ; first track of logical drive 0. offset1 equ 513 ; first track of logical drive 1. endif if morrow ; if morrow controller. hrdspt equ 17 ; sectors per track. headdly equ 0 ; head settle delay. hdsm0 equ 2047 ; logical disk 0 size minus one. hdir0 equ 2047 ; logical disk 0 directory max. hdsm1 equ 548 ; logical disk 1 size minus one. hdir1 equ 548 ; logical disk 1 directory max.. dw 0ffffh,0ffffh,0ffffh ; DIRBCB, DATBCB, TBLSEG. endif ; hard disk unit - 3. if nhard gt 3 dph11 dw 0000h,0000h ; translate table. dw 0000h,0000h ; scratch area. dw dpbh3 ; disk parameter block. dw 00000h,0ffffh ; checksum, allocation. dw 0ffffh,0ffffh,0ffffh ; DIRBCB, DATBCB, TBLSEG. endif ; Disk Parameter Blocks. dpbh0 dw heads * hrdspt ; physical sectors per cyl. db 0005 ; block shift. db 0031 ; block mask. db 0001 ; extent mask. dw hdsm0 ееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееu 242 ; first track of logical drive 1. endif cpmspc equ heads * hrdspt * 4 ; 128-byte sectors per cylinder. ; ********** END OF Miniscribe 4020 SPECIFIC CODE ********************* sm0 equ 2047 ; logical disk 0 size minus one. hdir0 equ 2047 ; logical disk 0 directory max. hdsm1 equ 1512 ; logical disk 1 size minus one. hdir1 equ 1512 ; logical disk 1 directory max. offset0 equ 1 ; first track of logical drive 0. offset1 eq; *********** BEGINNING OF QUANTUM 540 HARD DISK EQU's ***************** ; Equates for CP/M-80, CP/M-86, or Concurrent CP/M-86. ; Created 10-15-85 by Don Tarbell. ; Changes by Don Tarbell: ; 11-05-85: made Otari C-526 version from Quantum 540 version. ; 11-23-85: made CMI CM-6640 version from Otari C-526 version. ; 11-28-85: made Quantum 540 version from CMI CM-6640 version. ; Equates. cyl equ 512 ; number of cylinders. heads equ 8 ; number of heads. precomp equ 256 ; cylinder t ; logical disk 4 size minus one. hdir4 equ 431 ; logical disk 4 directory max. offset0 equ 1 ; first track of logical drive 0. offset1 equ 122 ; first track of logical drive 1. offset2 equ 243 ; first track of logical drive 2. offset3 equ 364 ; first track of logical drive 3. offset4 equ 485 ; first track of logical drive 4. endif cpmspc equ heads * hrdspt * 4 ; 128-byte sectors per cylinder. ; NOTE: hdsmx and hdirx values above are in 4096-byte block units. ; ********** END OF QUAN ; *********** BEGINNING OF MORROW HARD DISK CONTROLLER DRIVER ******* ; Morrow 5-inch Hard Disk DMA Controller Driver for Concurrent CP/M. ; FOR CONCURRENT CP/M-86 ONLY! ; This module is normally used as an INCLUDE file for ASM-86. ; EQU's specific to each drive are found in files beginning with W. ; Changes by Don Tarbell: ; 7-28-85: tightened up code some. ; 7-29-85: put in checks for errors after calls to mwseek, home. ; 8-13-85: separated drive equ's from controller driver. ; 8rror, ercode = status. ; mapper: if nlp eq 2 ; if 2 logical per physical drive. shr cl,1 ; E and F on drive 0. endif if nlp eq 4 ; if 4 logical per physical drive. shr cl,1 shr cl,1 endif if (nlp eq 3) or (nlp gt 4) mov ah,0 ; ax = logical drive number. mov al,cl mov bl,nlp ; bl = logical per physical. div bl ; al = physical drive. mov cl,al ; cl = physical drive. endif mov Byte Ptr hrddsk,cl ; set disk no. for map op. call mwptr ; bx = address of track o start write precompensatin. lowcurr equ 128 ; cylinder to start low current. stepdly equ 0 ; step delay. steprcl equ 30 ; recalibrate step delay. if teletek ; if teletek controller. nlp equ 4 ; number of logical per physical drives. hrdspt equ 16 ; sectors per track. headdly equ 1 ; settle delay (0-25.5 microsec.) hdsm0 equ 2047 ; logical disk 0 size minus one. hdir0 equ 2047 ; disk 0 directory size minus one. hdsm1 equ 2047 ; logical disk 1 size minus one. hdir1 equ 2047 ; diskTUM 540 SPECIFIC CODE *********************  0. offset1 equ 122 ; first track of logical drive 1. offset2 equ 243 ; first track of logical drive 2. offset3 equ 364 ; first track of logical drive 3. offset4 equ 485 ; first track of logical drive 4. endif cpmspc equ heads * hrdspt * 4 ; 128-byte sectors per cylinder. ; NOTE: hdsmx and hdirx values above are in 4096-byte block units. ; ********** END OF QUAN-18-85: added more disk parameter blocks. ; 8-22-85: put in set up for 4 logical/physical drives. ; 8-24-85: tightened code in mwptr routine. ; also disabled interrupts while initializing controller. ; 8-28-85: put in home and retry on seek error. ; 11-20-85: allow up to 12 logical drives per unit and odd number. ; Equates. sectsiz equ 3 ; code for 512 byte sectors. badsiz equ 64 ; # of bad sector entries. hrdspt equ 17 ; physical sectors per track. hrdbps equ 512 ; bytes per word. cmp word ptr [bx],0ffffh ; was it logged in already? jne mapex ; exit with no error if so. ; clear bad map table to all zeroes unless done already. cmp mwiflg,0 ; have we initialized bad map? jne mwrest ; hop around if so. mov cx,badsiz*9 ; cx = bad map size. mov di,offset badmap ; di = starting address. push cs ; es = cs. pop es mov al,0 ; put zeroes in it. cld ; forward direction. rep stosb ; clear out bad map. mov mwiflg,0ffh ; set initialization flag. 1 directory size minus one. hdsm2 equ 2047 ; logical disk 2 size minus one. hdir2 equ 2047 ; disk 2 directory size minus one. hdsm3 equ 2031 ; logical disk 3 size minus one. hdir3 equ 2031 ; disk 3 directory size minus one. offset0 equ 1 ; first track of logical drive 0. offset1 equ 129 ; first track of logical drive 1. offset2 equ 257 ; first track of logical drive 2. offset3 equ 385 ; first track of logical drive 3. endif if morrow ; if morrow controller. nlp equ 5 ; number of loееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееsector. hdskrt equ 3 ; hard disk retry count. ; Morrow Controller Commands. dmaread equ 0 ; read sector. dmawrit equ 1 ; write sector. dmarhed equ 2 ; find a sector. dmawhed equ 3 ; write headers (format track). dmalcon equ 4 ; load disk parameters. dmassta equ 5 ; sense disk drive status. dmanop equ 6 ; null controller operation. reset equ 54h ; reset controller. attn equ 55h ; send a controller attention. chan equ 50h ; default channel address. stepout equ 10h ; step direction mwrest: call mwhome ;do a restore. jc mwerr ; hop if error in home. mov cx,0 ; track zero. call mwseek ; seek to zero. jc mwerr ; hop if error in seek. mov al,dmaread ; setup for read. mov byte ptr dmaop,al mov dx,(offset chkbuf) ; get host buffer addr. call fndact ; figure physical addr. mov word ptr dmadma,dx ; physical addr a00-a15. mov byte ptr extdma,al ; physical addr a16-a19. mov al,0 mov byte ptr mwsectr,al ; sector 0 for badmap. mov al,2 ; head 2. mov bytgical per physical drives. hrdspt equ 17 ; sectors per track. headdly equ 0 ; head settle delay. hdsm0 equ 2047 ; logical disk 0 size minus one. hdir0 equ 2047 ; logical disk 0 directory max. hdsm1 equ 2047 ; logical disk 1 size minus one. hdir1 equ 2047 ; logical disk 1 directory max. hdsm2 equ 2047 ; logical disk 2 size minus one. hdir2 equ 2047 ; logical disk 2 directory max. hdsm3 equ 2047 ; logical disk 3 size minus one. hdir3 equ 2047 ; logical disk 3 directory max. hdsm4 equ 431 ееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееееout. stepin equ 0 ; step direction in. band1 equ 40h ; no precomp, high current. band2 equ 0c0h ; precomp, high current. band3 equ 80h ; precomp, low current. track0 equ 1 ; track zero status. wflt equ 2 ; write fault from drive. dready equ 4 ; drive ready. sekcmp equ 8 ; seek complete. ; MAPPER ; Log in Morrow Hard disk interface drive. ; Read bad sector map from track 0, head 2, first sector. ; entry: cl = logical hard disk drive number from 0-3. ; exit: cf (carry flag) set if e table. ldir: mov al,[bx] ; get a byte. mov [si],al ; put a byte. inc bx ; bump pointers. inc si loop ldir ; dec cx, loop back till zero. xchg bx,si jmps bad1 bade: mov word ptr badptr,bx ;restore new bad map pointer. mapex: clc ; no error flag. ret overflo: mov al,erdisk ; al = drive letter. add al,'A' ; make ascii. mov byte ptr mapmessagedrive,al mov bx,(offset mapmessage) call prtmsg ; common error return routine. mwerr: mov ax,hrdtrk ; ax = cylinder numbite operation. ; Exit: if error, ; cf (carry flag) = 1, ercode = dmastat, zf = 0. ; if no error, ; cf = 0, zf = 1. io_th: ; transfer variables from external to internal form. mov ax,sector ; hrdsec = sector. mov hrdsec,al mov ax,track ; hrdtrk = track. mov hrdtrk,ax mov al,sekdsk ; hrddsk = (sekdsk-8)/2. sub al,8 if nlp eq 2 ; if 2 logical per physical drive. shr al,1 ; E,F = hard drive 0. endif if nlp eq 4 ; if 4 logical per physical drive. shr al,1 shr abx] ;check it. jnz altmis ;nope. inc bx ;bumpt to msb. mov al,byte ptr hrdtrk+1 ;get msb track. cmp al,[bx] ;check it. jnz altmis inc bx mov al,[bx] ;get map sector. dec al ; make sectors start at 0. mov ch,al ;put in b. mov al,byte ptr hrdsec ;get sector. cmp al,ch ;check it. jnz altmis ; the current sector was found in badmap, so seek to alternate. inc bx ;alternate found. inc bx ;bump to alternate. mov cl,[bx] ;get lsb alternate track. inc bx modrivers for the morrow controller. ; reset the controller and do a home on hrddsk. mwhome: call mwreset ;reset controller. jc mwexit ; exit if error during reset. mov bx,(offset dmarg1) ;load arguments. mov byte ptr [bx],steprcl ;load step delay (slow). inc bx mov byte ptr [bx],headdly ;head settle delay. call mwissue ;do load constants again. jc mwexit ; exit if error during load constants. call mwptr ;get pointer to current cyl no. mov word ptr [bx],0 ; set up fake at cyer. mov ercyl,ax ; set for error routine. mov al,mwhead ; set head number for error routine. mov erhead,al mov al,mwsectr ; set sector number for error routine. mov ersect,al mov al,dmastat ; al = error status. mov ercode,al ; set for error print-out. or al,al ; clear zero flag. stc ; set error flag. ret ; fndact - Find actual (physical) address of an operand. ; Enter with offset in dx. ; Return with al=a16-19, dx=a00-a15 of physical address. fndact: mov ax,cs ; get basl,1 endif if (nlp eq 3) or (nlp gt 4) mov ah,0 ; ax = logical drive number. mov bl,nlp ; bl = logical per physical. div bl ; al = physical drive number. endif mov hrddsk,al mov ax,lsb20 ; dmadma = lsb20. mov dmadma,ax mov al,msb20 ; extdma = msb20. mov extdma,al mov al,oper ; mwop = oper - 1. dec al mov mwop,al io_thl: mov hdrtct,hdskrt ; init seek retry counter. io_srt: call mwtran ; do read or write. jnc io_thok ; hop if no error. call mwhome ; hov ch,[bx] ;get msb alternate track. push bx ;save bx. call mwseek ;do the seek. pop bx ;restore bx. jc alte ; exit if seek error. inc bx mov al,byte ptr mwop ;get the operation. mov byte ptr dmaop,al ;tell the controller. mov al,[bx] ;get the alternate sector. dec al ; make sectors start at 0. pop bx ;make stack right. jmps altfnd ;calculate head and do it. altmis: pop bx ;restore bx add bx,9 ; offset to next badmap entry. jmp all ;look some more. altelinder 0. mov cx,2 ;seek in 2 cylinders. call mwseek jc mwexit ; exit if error during seek. call mwptr ;get pointer again. mov word ptr [bx],cyl+100 ; maximum head travel. mov cx,0 ;seek to cylinder 0. call mwseek ;recal slowly. jc mwexit ; exit if error during seek. jmps mwreset ;back to fast stepping mode. ; seek hrddsk to the track in cx. mwseek: call mwptr ;get track pointer. mov dx,[bx] ; dx = old track number. mov [bx],cx ; store new track number. mov e of segment. mov cl,4 ; shift count. rol ax,cl ; shift segment left 4. mov cl,al ; save shifted out top 4 bits. and cl,0fh ; mask for top 4 bits only. and ax,0fff0h add dx,ax ; add shifted segment to offset. mov al,0 ; clear. a