title bios1 (excbios1) disk drive tables ;**************************************** ;* * ;* EXECUTIVE BIOS * ;* for * ;* CP/M 3.XX * ;* by * ;* * ;* Glenn S. Tenney * ;* and * ;* Roger W. Chapman * ;* * ;* Copyright (c) 1983 * ;* Osborne Computer Corporation * ;* * ;**************************************** ; This module is only the various disk parameter ; tables. ; Built-in drives are generated as permanent with ; directory checksums. ; Written by: Glenn S. Tenney, November 1982 ; Various macros used to generate disk tables for ; CP/M Plus. ; define the 16-drive drive table dtbl macro ?list local ?n ?n set 0 irp ?drv, ?n set ?n+1 dw ?drv endm if ?n gt 16 .' Too many drives. Max 16 allowed' exitm endif if ?n lt 16 rept (16-?n) dw 0 endm endif endm Š ; defines the disk parameter header dph macro ?trans,?dpb,?csize,?asize local ?csv,?alv dw ?trans ; translate (skew) table db 0,0,0,0,0,0,0,0,0 ; BDOS scratch area db 0 ; media flag dw ?dpb ; disk parameter block if not nul ?csize dw ?csv ; checksum vector else dw 0fffeh ; GENCPM sets checksum vector endif if not nul ?asize dw ?alv ; allocation vector else dw 0fffeh ; GENCPM sets allocation vector endif dw 0fffeh,0fffeh,0fffeh ; GENCPM sets: dirbcb, dtabcb, hash alloc'd db 0 ; hash bank if not nul ?csize ?csv: ds ?csize ; checksum vector endif if not nul ?asize ?alv: ds ?asize ; allocation vector endif endm ; defines disk parameter blocks dpb macro ?psize,?pspt,?trks,?bls,?ndirs,?off,?ncks local ?spt,?bsh,?blm,?exm,?dsm,?drm,?al0,?al1,?cks,?psh,?psm local ?n ;; physical sector mask and physical sector shift ;; ?psh set 0 ?n set ?psize/128 ?psm set ?n-1 rept 8 ?n set ?n/2 if ?n eq 0 exitm endif ?psh set ?psh+1 endm ?spt set ?pspt*(?psize/128) ?bsh set 3 ?n set ?bls/1024 rept 8 ?n set ?n/2 if ?n eq 0 Š exitm endif ?bsh set ?bsh + 1 endm ?blm set ?bls/128-1 ?size set (?trks-?off)*?spt ?dsm set ?size/(?bls/128)-1 ?exm set ?bls/1024 if ?dsm gt 255 if ?bls eq 1024 .' Invalid disk size with 1k block size' exitm endif ?exm set ?exm/2 endif ?exm set ?exm-1 ?al1 set 0 ?n set ((?ndirs and 7fffh)*32+?bls-1)/?bls rept ?n ?al1 set (?al1 shr 1) or 8000h endm ?al0 set high ?al1 ?al1 set low ?al1 ?drm set (?ndirs and 7fffh)-1 if not nul ?ncks ?cks set ?ncks else ?cks set (?ndirs and 7fffh)/4+(?ndirs and 8000h) endif ;; all computed finally dw ?spt ; 128 byte sectors per track db ?bsh,?blm ; block shift and mask db ?exm ; extent mask dw ?dsm ; maximum block number dw ?drm ; maximum directory number db ?al0,?al1 ; alloc vector for directory dw ?cks ; checksum size dw ?off ; number of reserved tracks db ?psh,?psm ; physical sector size and mask endm ; ; ; include EXCBIOSE.LIB .xlist include EXCBIOSE.LIB .list page ; declare the drive table public drvtbl ; table of drives public dpbtbl ; our dpb table w/ prefix public dph0,dph1 ; Built-in drive's dph's Š extrn stdini,stdsel,stdrd,stdwt ; built-in std routines cseg ; must be in common drvtbl: dtbl ; Note: With disk change in the interrupt routine, the dph must be ; in common memory. ; every dph MUST have a prefix as follows: ; -9 dw init-routine (at cboot once only) ; -7 dw read-routine ; -5 dw write-routine ; -3 dw seldisk-routine ; -1 db controller-relative drive number ; +0 dph --- the dph itself --- ; see the stdsel, stdrd and stdwt routines ; for documentation ; drive 0 dw stdini ; standard init routine dw stdrd ; standard read routine dw stdwt ; standard write routine dw stdsel ; standard seldisk routine db 0 ; controller drive # 0 ;dph0: dph oddxlt,dpbd1,16,48 ; use Osborne dd for now (as max) ; but, let gencpm alloc space dph0: dph oddxlt,dpbd1 ; use Osborne dd for now (as max) ; drive 1 dw stdini ; standard init routine dw stdrd ; standard read routine dw stdwt ; standard write routine dw stdsel ; standard seldisk routine db 1 ; controller drive # 1 ;dph1: dph oddxlt,dpbd1,16,48 dph1: dph oddxlt,dpbd1 cseg ; must be in common Šdpbtbl: ; each dpb is preceeded by ; associated device type code ; then sectors per track (actual) ; then addr of skew table (or 0) ; the table is terminated by an entry ; with a sectors/trk of 0ffh ; db disk-type-code ; db sectors-per-track ; dw skew-table ; lbl: dpb psize , pspt , trks , bls , ndirs , off , ncks db dskd1 ; Osborne ssdd db 5 dw oddxlt dpbd1: dpb 1024,5,40,1024,64+8000h,3 db dsks1 ; Osborne sssd db 10 dw osdxlt dpbs1: dpb 256,10,40,2048,64+8000h,3 db xerox ; Xerox db 18 dw xrxxlt dpbx0: dpb 128,18,40,1024,32+8000h,3 db ibm ; IBM db 8 dw ibmxlt dpbibm: dpb 512,8,40,1024,64+8000h,1 db dec ; DEC db 9 dw decxlt dpbdec: dpb 512,9,40,1024,64+8000h,2 db 0 ; 8" sssd db 0ffh ; end of table 26 dw stdxlt ibm8: dpb 128,26,77,1024,64+8000h,2 dseg ; ok in bank 0 ; these are the actual skew tables oddxlt equ 0 ; no skewing needed osdxlt: db 0,2,4,6,8,1,3,5,7,9 xrxxlt: db 0,5,10,15 ; physical equals logical Š db 2,7,12,17 db 4,9,14 db 1,6,11,16 db 3,8,13 ibmxlt equ 0 ; no skewing needed decxlt: db 0,2,4,6,8,1,3,5,7 stdxlt: 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 end