Mercurial > hg > Members > kono > nitros9-code
changeset 553:b93501797906
Added boot_vhd.asm from Robert Gault
author | boisy |
---|---|
date | Sun, 20 Oct 2002 05:16:37 +0000 |
parents | fcb97f0ba24b |
children | afff0087c27f |
files | 3rdparty/booters/boot_vhd.asm 3rdparty/booters/makefile |
diffstat | 2 files changed, 167 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3rdparty/booters/boot_vhd.asm Sun Oct 20 05:16:37 2002 +0000 @@ -0,0 +1,163 @@ +******************************************************************** +* Boot - CoCo Emulator Virtual Hard Disk Booter +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Acquired from Robert Gault BGP 02/10/19 + + nam Boot + ttl CoCo Emulator Virtual Hard Disk Booter + + ifp1 + use defsfile + endc + +tylg set Systm+Objct +atrv set ReEnt+rev +rev set 2 + +* This boot module is intended for either MESS or Jeff's emulator +* Written by Robert Gault based on a personal boot for an RGBDOS hard drive +* Hard Disk Interface registers for the VHD emulator drives + +dataport equ $FF80 +status equ dataport+3 +commnd equ dataport+3 +buffer equ dataport+4 +lsn equ dataport + + + mod eom,name,tylg,atrv,start,size + +blockloc rmb 2 pointer to memory requested +blockimg rmb 2 duplicate of the above +bootloc rmb 3 sector pointer; not byte pointer +bootsize rmb 2 size in bytes +size equ . + +name fcs /Boot/ + fcb 1 +start clra + ldb #size +clean pshs a + decb + bne clean + tfr s,u get pointer to data area + pshs u save pointer to data area + + lda #$d0 forced interrupt; kill floppy activity + sta $FF48 command register + clrb +pause decb + bne pause + lda $FF48 clear controller + clr $FF40 make sure motors are turned off + sta $FFD9 fast clock + +* Request memory for LSN0 + ldd #1 + os9 F$SRqMem request one page of RAM + bcs error + bsr getpntr + +* Get LSN0 into memory + + clrb MSB sector + ldx #0 LSW sector + bsr mread + bcs error + ldd bootsize,u + beq error + pshs d + +* Return memory + + ldd #$100 + ldu blockloc,u + os9 F$SRtMem + puls d + os9 F$BtMem + bcs error + bsr getpntr + std blockimg,u + +* Get os9boot into memory + + ldd bootsize,u + leas -2,s same as a PSHS D +getboot std ,s + ldb bootloc,u MSB sector location + ldx bootloc+1,u LSW sector location + bsr mread + ldd bootloc+1,u update sector location by one to 24bit word + addd #1 + std bootloc+1,u + ldb bootloc,u + adcb #0 + stb bootloc,u + inc blockloc,u update memory pointer for upload + ldd ,s update size of file left to read + subd #$100 file read one sector at a time + bhi getboot + + leas 4+size,s reset the stack same as PULS U,D + ldd bootsize,u + ldx blockimg,u pointer to start of os9boot in memory + andcc #%11111110 clear carry + rts back to os9p1 + +error leas 2+size,s + ldb #E$NotRdy drive not ready + rts + +getpntr tfr u,d save pointer to requested memory + ldu 2,s recover pointer to data stack + std blockloc,u + rts + +mread tstb LSN0 high byte + bne read10 + cmpx #0 LSN0 low word + bne read10 + bsr read10 + bcc readlsn0 + rts + +readlsn0 pshs a,x,y find location of boot track + ldy blockloc,u + lda DD.Bt,y os9boot pointer + ldx DD.Bt+1,y LSW of 24 bit address + sta bootloc,u + stx bootloc+1,u + ldx DD.BSZ,y os9boot size in bytes + stx bootsize,u + clra + puls a,x,y,pc + +* Generic read + +read10 clra + bsr setup + bra command + +setup pshs x + stb lsn + stx lsn+1 + ldx blockloc,u + stx buffer + puls x,pc + +command + sta commnd + lda commnd + rts + +* Fillers to get to $1D0 + + fill $39,$1D0-*-3 + + emod +eom equ * + end
--- a/3rdparty/booters/makefile Wed Oct 16 20:02:31 2002 +0000 +++ b/3rdparty/booters/makefile Sun Oct 20 05:16:37 2002 +0000 @@ -4,7 +4,7 @@ BOOTERS_NITROS = boot_ide_nl2 BOOTERS_L2 = boot_ktlr boot_ktlr_id5 boot_rampak \ boot_tc3 boot_tc3_id5 boot_ide boot_wd1002 \ - boot_burke boot_rom + boot_burke boot_rom boot_vhd BOOTERS_L1 = boot_ktlr_l1 boot_ktlr_id5_l1 boot_rampak_l1 \ boot_tc3_l1 boot_tc3_id5_l1 boot_ide_l1 \ boot_burke_l1 boot_rom_l1 @@ -48,6 +48,9 @@ boot_rom: boot_rom.asm $(AS) $(AFLAGS) $(ASOUT)$@ $< -aLevel=2 +boot_vhd: boot_vhd.asm + $(AS) $(AFLAGS) $(ASOUT)$@ $< -aLevel=2 + # OS-9 Level One Booters boot_rom_l1: boot_rom_l1.asm $(AS) $(AFLAGS) $(ASOUT)$@ $< -aLevel=1