fixup a couple problems encountered while testing.
This commit is contained in:
parent
5b6539a99d
commit
e6687dcefc
13
Makefile
13
Makefile
|
@ -1,7 +1,9 @@
|
||||||
|
|
||||||
|
|
||||||
bootblock : bootblock.omf
|
bootblock : bootblock.omf hfs.po
|
||||||
mpw makebiniigs -org 2048 bootblock.omf -o bootblock
|
mpw makebiniigs -s -org 2048 bootblock.omf -o bootblock
|
||||||
|
dd bs=512 if=bootblock of=hfs.po conv=notrunc oseek=0
|
||||||
|
|
||||||
|
|
||||||
bootblock.omf : bootblock.obj
|
bootblock.omf : bootblock.obj
|
||||||
mpw linkiigs bootblock.obj -o bootblock.omf
|
mpw linkiigs bootblock.obj -o bootblock.omf
|
||||||
|
@ -9,3 +11,10 @@ bootblock.omf : bootblock.obj
|
||||||
bootblock.obj : bootblock.aii hfs.aii
|
bootblock.obj : bootblock.aii hfs.aii
|
||||||
mpw asmiigs bootblock.aii -o bootblock.obj
|
mpw asmiigs bootblock.aii -o bootblock.obj
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
$(RM) bootblock bootblock.omf bootblock.obj
|
||||||
|
|
||||||
|
hfs.po:
|
||||||
|
mkfs-profuse --fst=hfs --size=800k --name="hfs boot" hfs.po
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
;
|
||||||
|
; HFS boot. Boot block.
|
||||||
|
; This is stage 0 of the bootloader. It will find a file named
|
||||||
|
; '!' in the root directory of an HFS volume, load it, and execute it
|
||||||
|
; in full 16-bit mode, with a = prodos block call vector.
|
||||||
|
;
|
||||||
|
; this currently only works with 512-byte blocks (max volume size = 64M)
|
||||||
|
; but there's enough room to support variable block sizes.
|
||||||
|
|
||||||
include 'hfs.aii'
|
include 'hfs.aii'
|
||||||
|
|
||||||
|
@ -6,7 +14,7 @@
|
||||||
|
|
||||||
zp record 0
|
zp record 0
|
||||||
slot ds.w 1
|
slot ds.w 1
|
||||||
vector ds.w 1
|
;vector ds.w 1
|
||||||
|
|
||||||
offset ds.w 1
|
offset ds.w 1
|
||||||
bnum ds.w 1
|
bnum ds.w 1
|
||||||
|
@ -28,6 +36,7 @@ data record $2000
|
||||||
|
|
||||||
|
|
||||||
entry read_block, read_block_abs, read_extent_block
|
entry read_block, read_block_abs, read_extent_block
|
||||||
|
entry vector
|
||||||
|
|
||||||
boot proc
|
boot proc
|
||||||
longi off
|
longi off
|
||||||
|
@ -51,6 +60,7 @@ boot proc
|
||||||
stz slot
|
stz slot
|
||||||
; check for prodos block-device signature bytes
|
; check for prodos block-device signature bytes
|
||||||
; todo -- switch to extended smartport? needed for second stage.
|
; todo -- switch to extended smartport? needed for second stage.
|
||||||
|
; xx $20 xx $00 xx $03 [xx $00 - smarport ]
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (slot),y
|
lda (slot),y
|
||||||
cmp #$20
|
cmp #$20
|
||||||
|
@ -59,6 +69,8 @@ boot proc
|
||||||
lda (slot),y
|
lda (slot),y
|
||||||
bne noboot
|
bne noboot
|
||||||
ldy #5
|
ldy #5
|
||||||
|
lda (slot),y
|
||||||
|
cmp #$03
|
||||||
bne noboot
|
bne noboot
|
||||||
; smartport - ,7 = 00
|
; smartport - ,7 = 00
|
||||||
ldy #$ff
|
ldy #$ff
|
||||||
|
@ -103,15 +115,13 @@ ok
|
||||||
xba
|
xba
|
||||||
sta offset
|
sta offset
|
||||||
|
|
||||||
lda data+drCTExtRec ; 1st allocation block
|
ldx #3*HFSExtentDescriptor.sizeof-2
|
||||||
|
@cloop lda data+drCTExtRec,x
|
||||||
xba
|
xba
|
||||||
sta extents
|
sta extents,x
|
||||||
lda data+drCTExtRec+2 ; # of allocation blocks
|
dex
|
||||||
xba
|
dex
|
||||||
sta extents+2
|
bpl @cloop
|
||||||
;
|
|
||||||
; need to do all 3?
|
|
||||||
;
|
|
||||||
endwith
|
endwith
|
||||||
|
|
||||||
; lda offset
|
; lda offset
|
||||||
|
@ -154,7 +164,8 @@ ok
|
||||||
again
|
again
|
||||||
ldx #512-2 ; last entry
|
ldx #512-2 ; last entry
|
||||||
@loop
|
@loop
|
||||||
lda data,x
|
lda data,x ; entry offset
|
||||||
|
xba
|
||||||
tay
|
tay
|
||||||
lda data+HFSCatalogKey.parentID,y ; parent id
|
lda data+HFSCatalogKey.parentID,y ; parent id
|
||||||
bne notfound
|
bne notfound
|
||||||
|
@ -205,6 +216,8 @@ found
|
||||||
and #%01111111
|
and #%01111111
|
||||||
beq notfound
|
beq notfound
|
||||||
sta count
|
sta count
|
||||||
|
|
||||||
|
; todo -- all extents...
|
||||||
lda data+8+dataExtents,y
|
lda data+8+dataExtents,y
|
||||||
xba
|
xba
|
||||||
sta extents
|
sta extents
|
||||||
|
@ -236,6 +249,7 @@ found
|
||||||
|
|
||||||
read_block proc
|
read_block proc
|
||||||
entry read_block_abs
|
entry read_block_abs
|
||||||
|
entry vector
|
||||||
|
|
||||||
; input
|
; input
|
||||||
; a = hfs block #
|
; a = hfs block #
|
||||||
|
@ -246,13 +260,22 @@ read_block proc
|
||||||
adc offset
|
adc offset
|
||||||
|
|
||||||
read_block_abs
|
read_block_abs
|
||||||
|
;
|
||||||
|
; based on testing, this drops into emulation mode, so do it and recover.
|
||||||
|
;
|
||||||
sta pro.block
|
sta pro.block
|
||||||
sep #$30
|
; pea @rts-1
|
||||||
jmp (vector)
|
; sep #$30
|
||||||
rep #$30
|
php
|
||||||
|
sec
|
||||||
|
xce
|
||||||
|
dc.b $20 ; jsr
|
||||||
|
vector dc.w $ffff
|
||||||
|
; jmp (vector)
|
||||||
|
;@rts
|
||||||
bcs @fail
|
bcs @fail
|
||||||
; bcs error...
|
xce
|
||||||
|
plp
|
||||||
rts
|
rts
|
||||||
@fail brk $ea
|
@fail brk $ea
|
||||||
endp
|
endp
|
||||||
|
|
Loading…
Reference in New Issue