; ABOOT5F2.ASM. 11-14-87 TRS. Source: ABOOTSS.ASM and ABOOTSS.DOC ; obtained from Ron Jacobs. That file already edited out all refs to disks ; other than 5-1/4" soft sector. TRS edit (marked ###) followed the DOC ; file's instructions in numbering second track aó Trk 0, Side 1. ; Also changed MSIZE to 64 and biosln to 18 (Value 18 taken from bioslen in ; PRN file for CBIOS5F2. ;********************************************************************** 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 Š»###NOTÅ thaô thå 64ë cbioó assembleä froí cbios5f2.así startó aô E800¬ anä » thå CCÐ startó aô D200. ;***************************** ;Begin User Configuration Area ;***************************** ; ;Define TRUE and FALSE ;--------------------- ; TRUE equ 1 FALSE equ 0 ;Set the Memory Size ;------------------- ; msize equ 64 ;Memory size of target CP/M ;##tï matcè msizå iî CBIOS5F2.ASM ;Misc Equates ;------------ ; biosln equ 18h ;BIOS length in pages ;##aó determineä froí assemblù oæ CBIOS5F2.ASM 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 ;********************************************************************** ;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 ;###Track 0 db 80h ;### Side 1 (coded as 80h) 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 ;###ADDED BY TRS TO INCLUDE IDENTIFICATION FOR 2-SIDED DISK IN ; SECOND CPM DISË SECTOR (STARTING AT 80H) ORG BOOT+80H DB 00,04h,00,00,00,00,00,00,00,28h,00,04h,0Fh,01h,0C2h,00 DB 0BFh,00,0E0h,00,30h,00,02h,00,89h,00,00,00,00,00,00,00 ;###Theså datá werå takeî directlù froí thå seconä CP/Í sectoò oæ á » formatteä, 2-sideä, doublå densitù Morro÷ 5-1/4¢ disk. Š end