;********************************************************************** Title 'Cold Boot Loader Rev_E4 27_Jan_83 Copyright_1983 Morrow Designs' ;********************************************************************** ; ;The following Cold Boot Loader Programs are included in this module ;------------------------------------------------------------------- ; DJDMA Disk Jockey DMA controller with 5 1/4" Drives ; >>>>> FOR SOFT SECTORED DISKS <<<<< ; ;Note: ;----- ; Provisions have been made for a Micronix boot loader for use with ; the DJDMA Controller. This loader always gets loaded to 0100h. ; ;System Memroy Maps ;================== ; 1) The following table gives a general idea as to where the ; various parts of of the operating system are in memory. ; 2) 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. ; 3) 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. ; 4) 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. ; 5) The BIOS can take up as much as 6.4k bytes of space; However, ; only 4k bytes are actually on the disk. The remaining space is ; used for uninitialized storage. ; ; sysgen 48k 56k 60k 62k 64k ; image CP/M CP/M CP/M CP/M CP/M ; ; 900 ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ Loader ; B00 9100 B100 C100 C900 D100 CCP ; 1300 9900 B900 C900 D100 D900 BDOS ; 2100 A700 C700 D700 EF00 E700 Cbios ; 3100 B700 D700 E700 FF00 F700 Tables (approx.) ; 35FF BFFF DFFF EFFF F7FF FFFF End of Memory ; ; ~~~~ 8900 A900 B900 C100 C900 DDT page ;***************************** ;Begin User Configuration Area ;***************************** ; ;Define TRUE and FALSE ;--------------------- ; TRUE equ 1 FALSE equ 0 ;Set the Memory Size ;------------------- ; msize equ 48 ;Memory size of target CP/M ;Misc Equates ;------------ ; biosln equ 13h ;BIOS length in pages micron equ FALSE ;Set for Micronix boot loader (only DJDMA) absasm equ TRUE ;set for MAC retries equ 10 ;Maximum # of disk retries page ;***************************** ;Begin Internal System Equates ;***************************** ;Starting addresses ;------------------ ; if not absasm aseg endif ccpln equ 800h ;Length of the CCP bdosln equ 0e00h ;Length of the BDOS size equ msize*1024 ;Memory size in Kilo-bytes ccp equ size-(biosln*100h+ccpln+bdosln) bdos equ ccp+ccpln bios equ ccp+ccpln+bdosln retries equ 10 load1 equ 100h ;read offset#1 for movcpm ;Load and execution addresses ;---------------------------- ; 1) If this program is being used to boot Micronix, and the load ; address is moved forward from 0100h, then the starting extended ; address for the djdma boot loader should be adjusted. ; if micron eq FALSE loaddr equ ccp ;Load address for floppy cboot equ bios ;Cold boot address for CP/M else ;Micronix boot loader loaddr equ 0100h cboot equ 0100h ;Cold boot address for the loader endif page ;********************************************************************** ;Cold boot loader for the Disk Jockey DMA controller using 5 1/4" ;Soft Sectored Disks <<<<<<<<<<<<<<<<<<<<< ;********************************************************************** ; ;DJDMA Disk Controller (5 1/4" Disks) ;==================================== ; 1) The warm boot starts from track 0 sector 1 and continues ; through to track 1 sector 1. ; 2) The cold boot loader (track 0, sector 0) is loaded into ; RAM at 80h. This loader will start loading from track 0, ; sector 1 and stops at track 1, sector 9. The load ; sequence is as follows: ; ; track sector sysgen load order Name ; 0 0 900 80 0 Cold boot ; 0 1 b00 9500 1 CCP ; 0 2 d00 9700 2 ; 0 3 f00 9900 3 ; 0 4 1100 9b00 4 ; 0 5 1300 9d00 5 BDOS ; 0 6 1500 9f00 6 ; 0 7 1700 a100 7 ; 0 8 1900 a300 8 ; 0 9 1b00 a500 9 ; ; 1 0 1d00 a700 10 ; 1 1 1f00 a900 11 ; 1 2 2100 ab00 12 CBIOS ; 1 3 2300 ad00 13 ; 1 4 2500 af00 14 ; 1 5 2700 b100 15 ; 1 6 2900 b300 16 ; 1 7 2b00 b500 17 ; 1 8 2d00 b700 18 ; 1 9 2f00 b900 19 page ;5 1/4" DJDMA Equates ;==================== ; ;Define Boot Address for DJDMA boot equ 80h org boot djkick equ 0EFh ;I/O port to start DJDMA controller activity channl equ 50h ;Default Channel Address trkoff equ 9*512 ;Number of bytes loaded from track 0 setdma equ 23h ;Set DMA address djhalt equ 25h ;Halt controller djbran equ 26h ;Branch controller command redtrk equ 29h ;Read track command load2 equ 100h ;read offset#2 for movcpm offset equ 900h-boot ;read offset for DDT page ;Begin 5 1/4" DJDMA Executable Code ;================================== ; mvi a,djbran ;Load branch channel command sta channl lxi h,commnd ;Load new command channel address shld channl+1 xra a sta channl+3 djstrt: out djkick ;Start controller djwait: lda djdone ;Get final status ora a ;0 = still busy jz djwait ;Loop if busy lxi h,sectb0 ;Check for bad load lxi b,40ffh ;b = ok, c = loaded lxi d,endtbl-sectb0 ;Error count + # of sectors djloop: mov a,m ;Load sector code cmp c ;Check for 0ffh (already loaded) jz djcont ;Skip if load was 'ok' mov m,c ;Load 'loaded' flag cmp b ;Check for 'ok' status jz djcont ;Skip if load ok inr m ;Make flag = 0 inr d ;Bump error counter djcont: dcr e ;Bump sector count inx h ;Bump table pointer jnz djloop mov a,d ;Check out error counter ora a jz cboot ;Start CP/M if no errors dcr m ;Drop retry counter jnz djstrt ;Retry load operation jmp $ ;Dynamic error halt ;DJDMA Command Strings ;--------------------- ; ;Set the DMA Address commnd: db setdma dw loaddr-512 ;Start at CCP if micron eq 0 db 0 ;Extended address for CP/M else db 0ffh ;Wrap around from ffff00 to 000100 endif ;Read a Track db redtrk db 0 ;Track 0 db 0 ;Side 0 db 0 ;Drive 0 dw sectb0 ;Sector table 0 db 0 ;Extended address db 0 ;Returned status ;Set the DMA Address db setdma dw loaddr+trkoff ;Load address for track 1 db 0 ;Extended address ;Read a Track db redtrk db 1 ;Track 1 db 0 ;Side 0 db 0 ;Drive 0 dw sectb1 ;Sector table 1 db 0 ;Extended address db 0 ;Returned status ;Halt Command db djhalt ;Halt controller djdone: db 0 ;Returned status ;Sector tables for read track command ;------------------------------------ ; 1) Boot + 5ch contains 'configuration byte' for 5" drives org boot+5dh sectb0: db 0, 0, 0, 0, 0 ;load all 10 1024 byte sectors (boot loader is sectb1: db 0, 0, 0, 0, 0 ;read in too, below the ccp ;Other storage ;------------- ; db retries ;Retry counter endtbl equ $-1 ;end of table marker end