***************************************************************** * * * Morrow Designs CP/M vers 2.2 Cold Boot Loader. * * Cbios revision E.2, 3/4/82. * * * * The following routines will boot CP/M from the * * Disk Jockey 2D Rev. B 8 inch disk controller (DJ2D/B), * * * * 8 inch floppy disk boot loader for the * * Morrow Designs Disk Jockey 2D/B (DJ2DB) * * * * The 'order' column is the interleave sequence used by the * * loader during the load. * * * * track sector sysgen load order Name * * * * 0 1 900 ff00 0 Boot loader * * 0 2 980 Unused * * 0 3 a00 * * 0 4 a80 * * 0 5 b00 9100 1 CCP * * 0 6 b80 9180 12 * * 0 7 c00 9200 2 * * 0 8 c80 9280 13 * * 0 9 d00 9300 3 * * 0 10 d80 9380 14 * * 0 11 e00 9400 4 * * 0 12 e80 9480 15 * * 0 13 f00 9500 5 * * 0 14 f80 9580 16 * * 0 15 1000 9600 6 * * 0 16 1080 9680 17 * * 0 17 1100 9700 7 * * 0 18 1180 9780 18 * * 0 19 1200 9800 8 * * 0 20 1280 9880 19 * * 0 21 1300 9900 9 BDOS * * 0 22 1380 9980 20 * * 0 23 1400 9a00 10 * * 0 24 1480 9a80 21 * * 0 25 1500 9b00 11 * * 0 26 1580 9b80 22 * * * * Track 1 is recorded in double density format. There are * * 1024 bytes per sector. * * * * 1 1 1600 9c00 4 * * 1 2 1a00 a000 1 * * 1 3 1e00 a400 5 CBIOS (@ a700h) * * 1 4 2200 a800 2 * * 1 5 2600 ac00 6 * * 1 6 2a00 b000 3 * * 1 7 2e00 b400 7 * * 1 8 3200 b800 Unused * * * * Three spare sectors (track 0, sectors 2 to 4) have been * * provided for a more advanced boot loader at a later date. * * * * The warm boot loader starts on track 0, sector 5 and * * continues through to track 1 sector 3. Only the first * * 3/4 K bytes of track 1, sector 3 is loaded since CP/M * * requires that the warm boot loader load up to the start * * of (but not past) the Cbios jump table. * * * ***************************************************************** ***************************************************************** * * * The following table gives a general idea as to where the * * various parts of of the operating system are in memory. * * * * The only changes to the map that I see in the future is * * the increasing the space for the uninitialized tables * * following the Cbios. The amount of code and table space * * that can actually be loaded from the disk is fixed by the * * amount of space available on the system tracks. * * * * Our most restrictive (smallest) drive is the 5 1/4 inch * * 'minnie floppy'. This drive has 20 512 byte sectors for * * a total of 10k bytes on the system tracks. The 8 inch * * floppy disk drive is also very close to being filled up. * * * * Since 512 bytes are reserved for the cold boot loader we * * have a total of 9.5k bytes for the operating system. Out * * of this 5.5k bytes are used by the (CCP + BDOS) leaving * * us with a total of 4k bytes of loaded code and data space * * to play with. Right now we are using all of this space * * so any major additions will have to result in a little * * (lot?) of code shuffeling or in the creation of a Cbios * * that simply will not fit on a small disk drive. * * * * sysgen 48k 56k 60k 62k 64k * * image CP/M CP/M CP/M CP/M CP/M * * * * 900 ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ Loader * * b00 9500 b500 c500 cd00 d500 CCP * * 1300 9d00 bd00 cd00 d500 dd00 BDOS * * 2100 ab00 cb00 db00 e300 ed00 Cbios * * 3100 bb00 db00 eb00 f300 fb00 Tables * * 35ff bfff dfff efff f7ff ffff The End * * * * ~~~~ 8d00 ad00 bd00 c500 cd00 DDT * * * ***************************************************************** msize equ 56 ;Memory size of target CP/M biosln equ 10h ;BIOS length codlen equ 11h ;Code length ccpln equ 800h bdosln equ 0e00h size equ (msize*1024) ccp equ size-(biosln*100h+ccpln+bdosln) bdos equ ccp+ccpln bios equ ccp+ccpln+bdosln cboot equ bios ;Cold boot address for CP/M loaddr equ ccp ;Load address for floppy retries equ 10 ;Maximum # of disk retries ***************************************************************** * * * The following equates are for the Disk Jockey 2D/B. * * * ***************************************************************** origin equ 0E000H ;Orgin of DJ 2D Mod B PROM djram equ origin+400h ;Disk Jockey 2D Mod B routines tkzero equ origin+9h ;Track 0 seek trkset equ origin+0ch ;Set track setsec equ origin+0fH ;Set sector setdma equ origin+12h ;Set DMA address dread equ origin+15h ;Read sector dmast equ origin+24h ;Get DMA address status equ origin+27h ;Disk status dskerr equ origin+2ah ;Flash error light setden equ origin+2dh ;Set density boot equ djram+300h ;Upper 3/4 of on board floppy RAM offset equ 900h-boot ;DDT offset org boot ***************************************************************** * * * Cold boot loader for the Disk Jockey 2D Revision B controller * * * ***************************************************************** t0boot mvi a,5-2 ;First sector - 2 newsec equ $-1 inr a ;Update sector # inr a cpi 27 ;Size of track in sectors + 1 trksiz equ $-1 jc nowrap ;Skip if not at end of track jnz t1boot ;Done with this track exit equ $-2 sui 27-6 ;Back up to sector 6 backup equ $-1 lxi h,loaddr-80h ;Memory address of sector - 100h nxtdma equ $-2 shld newdma nowrap sta newsec ;Save the updated sector # mov c,a call setsec ;Set up the sector lxi h,loaddr-100h ;Memory address of sector - 100h newdma equ $-2 lxi d,100h ;Update DMA address secsiz equ $-2 dad d nowrp shld newdma ;Save the updated DMA address mov b,h mov c,l call setdma ;Set up the new DMA address lxi b,retries*100h+0;Maximum # of errors, track # nxtrty equ $-2 fread push b call trkset ;Set up the proper track call dread ;Read the sector pop b jnc t0boot ;Continue if no error dcr b jnz fread ;Keep trying if error jmp dskerr ;Too many errors, flash the light t1boot lxi h,cboot ;We jump to cboot next time shld exit mvi c,1 ;Select double density call setden xra a ;First sector - 2 sta newsec mvi a,8 ;Size of (logical) track + 1 sta trksiz dcr a ;Number of sectors to back up sta backup lxi h,loaddr+0700h ;DMA start address for first revolution - 2048 shld newdma lxi h,loaddr+0300h ;DMA start address for second revolution - 2048 shld nxtdma lxi h,2048 ;Difference between DMA addresses shld secsiz lxi h,retries*100h+1;Maximum # of errors, track # shld nxtrty jmp t0boot ;Go load in track 1 end