Title Micro_Decision No Boot Diskette (14_Dec_83) ; ; This code appears in sectors 1 and 2 of of track 0 on ; non-system diskettes. This position independent code outputs the ; message 'Not a SYSTEM Diskette' on the console. Putting it in ; sector 1 garantees that you'll know that there's no system on ; the disk (i.e. that it's not the wrong system, just no system). The ; reason that the code is in sector 2 as well is to catch those times ; when you've switched a data diskette for a system disk and tried to ; to do a warm boot (e.i. after using the virtual drive). ; The requirment for position independence then comes from the ; fact that, when this code is executed due to a cold boot, it will be ; in a different location than when it is executed as a result of a ; warm boot. The cold typically resides either in the TPA or in the ; unallocated memory space above the CBIOS, while the warm start ; execution address is always the start of the CCP. ; Notice that the CCP has two entry points in successive ; locations depending on the state of the submit flag. The three ; NOPs at the start of the program catch accesses to entry point 1 ; making sure that all users of this code enter at the same place. ; ;---------------------------------------------------------------------- ; Equates ;-------- ; .z80 aseg org 0 ;Give an absolute origin for ease of debugging BadID equ 4B6Fh ;Bad Map ID Word (in bad map pointer structure) BadRev equ 10h ;Bad Map Revision Number (in bad map header) Mesg equ 3 ;Rom entry - print a message ended by a 0 Bter equ 18h ;Rom entry - print Push Reset... and then halt BnkStb equ 41h ;Bank Strobe (Rom Control port for an MD-11) RomCnt equ 0F6h ;Rom control port for an MD-3 Stack equ 0FF80h ;Reset loc. stack pointer; Start execution seg. PcHL equ 0E9h ;z80 instruction - jp (HL) PopHL equ 0E1h ;z80 instruction - pop HL cr equ 0Dh ;Carriage Return lf equ 0Ah ;Line Feed page 64 ;---------------------------------------------------------------------- ; Move the Execution Segment into Common Memory ;---------------------------------------------- ; ; Main Entry Point 1 - Cold Boot CCP1: nop ;(Normal entry on cold boot) nop ;(and catches accesses to 1st CCP entry) nop ; Main Entry Point 2 - Warm Boot CCP2: ld sp,stack ld hl,PcHL * 256 + PopHl ;HL:= instructions pop hl, pchl ld (stack),hl ;(stack):= Instructions pop hl, pchl call stack ;Put location Here on the stack ;stack returns HL Pair pointing ;to 'here' for the following ldir Here: ld de,There-Here ;offset to .phase stack add hl,de ;[HL] -> source ld bc,Ends-Begins ;length to move ld de,Stack ;above stack ldir ;copy to common jp Stack ;execute it There: ;---------------------------------------------------------------------- ; Execution Segment ;------------------ ; 1) This section of code prints the Not a SYSTEM Diskette message ; and then goes to bter (prints Press Reset to try again & then halts) ; 2) This segment MUST NOT reside in the lowest 8k of memory because the ; rom must be on for the mesg and bter calls. ; .phase Stack ;this stuff is above the stack Begins: ld de,Emsg ld a,0 out (BnkStb),a ;MD-11 rom on, bank 1 out (RomCnt),a ;MD-3 rom on call Mesg ;Print the error message jp Bter ;Print push reset... and then halt Emsg: db cr,lf, 'Not a SYSTEM Diskette' db cr,lf, 0 Ends: .dephase page ;---------------------------------------------------------------------- ; Boot Loader MTABs (14_Dec_83) ;----------------------------- ; ;Drive MTAB for Seagate st506 BMtab: db 00101110b ;(DSKDEF0) $SECZRO, 4 heads, drive 2 db 01101111b ;(DSKDEF1) @DRVRDY,DRVDEN,@HASBAD,@FSTSEK,1024 dw 0FFFFh ;(CRNCYL) Current Cylinder (lo) ; Current Cylinder (hi) dw 153 ;(MAXCYL) Max Cylinders (lo) ; Max Cylinders (hi) db 1 ;(STPRAT) Step Rate (3ms) db 5 ;(STPSET) Settling Time (15ms) db 1 ;(STPRCL) Recal Step Rate (3ms) db 0 ;(HLDDLY) Head Load time (0) db 0 ;(MOTDLY) Motor On time (0) dw 128 ;(STRPRE) Start Write Pre-Comp (lo) ; Start Write Pre-Comp (hi) dw 128 ;(STRLOC) Start Lo-Current (lo) ; Start Lo-Current (hi) db 0 ;(FMTTYP) Format Type ;---------------------------------------------------------------------- ; HDSKEW - Default Hard Disk Sector Skew Table (13_Dec_83) ;--------------------------------------------------------- ; HDskew: db 2 db 4 db 6 db 8 db 1 db 3 db 5 db 7 db 0 ;Start of table ;---------------------------------------------------------------------- ; Bad Map Pointer Structure ;-------------------------- ; ds 70h - $, 0 ;Fill to the start of bad map pointer structure dw BadID ;Validation word for the pointer structure dw 0 ;Track db 0 ;Head db 0 ;Sector (Note that its zero based) dw 200h ;Offset to the start of the bad map dw BMtab ;Offset to start of the Boot Mtab dw HDskew ;Offset to start of the Hard Disk Skew Table page ds 80h - $, 0 ;Fill to the start of the Mtab Structure ;---------------------------------------------------=================== ; disk format tables for old udecision compatibility (for dd ds floppy) ;---------------------------------------------------=================== ; btab: db 21h ;Micro-Decision MTAB db 0dch db 125 db 4 db 0afh db 3 db 5 db 28 db 0ffh dw 40 ;Disk Parameter Block db 4 db 15 db 1 dw 194 dw 191 db 0e0h db 0 dw 48 dw 2 db 43h page ds 200h - $, 0 ;Fill to the start of the bad map ;---------------------------------------------------------------------- ; Bad Map ;-------- ; ; Header for the bad map table ;----------------------------- ; ds 4,0 ;Reserved for Link Field db 10h ;Bad Map Revision Number db 0 ;Reserved db 0 ;Current Number of Bad Map Entries db 27 ;Maximum Number of Bad Map Entries ; Bad Map Table ;-------------- ; ; Entry 1 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 0 ; " Sector ; Entry 2 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 1 ; " Sector ; Entry 3 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 2 ; " Sector page ; Entry 4 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 3 ; " Sector ; Entry 5 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 4 ; " Sector ; Entry 6 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 5 ; " Sector ; Entry 7 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 6 ; " Sector ; Entry 8 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 7 ; " Sector ; Entry 9 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 1 ; " Head db 8 ; " Sector page ; Entry 10 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 0 ; " Sector ; Entry 11 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 1 ; " Sector ; Entry 12 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 2 ; " Sector ; Entry 13 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 3 ; " Sector ; Entry 14 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 4 ; " Sector ; Entry 15 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 5 ; " Sector page ; Entry 16 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 6 ; " Sector ; Entry 17 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 7 ; " Sector ; Entry 18 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 2 ; " Head db 8 ; " Sector ; Entry 19 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 0 ; " Sector ; Entry 20 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 1 ; " Sector ; Entry 21 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 2 ; " Sector ; Entry 22 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 3 ; " Sector page ; Entry 23 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 4 ; " Sector ; Entry 24 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 5 ; " Sector ; Entry 25 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 6 ; " Sector ; Entry 26 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 7 ; " Sector ; Entry 27 dw 0 ;Bad track db 0 ; " Head db 0 ; " Sector dw 0 ;Replacement Track db 3 ; " Head db 8 ; " Sector ds 3FFh - $, 0 end