Skip to content

Commit

Permalink
host fst updates.
Browse files Browse the repository at this point in the history
1. don't lookup the .host device during startup - startup happens before the boot.driver is loaded
2. lookup the .host device when a path-based or volumegs call is made.
3. when building a vcr, store the ptr so it can be dereferenced later, if needed.
  • Loading branch information
ksherlock committed Jul 14, 2018
1 parent e890e33 commit 524fa1a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 18 deletions.
1 change: 1 addition & 0 deletions fst.equ
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ptr ds.l 1 ; misc ptr

my_vcr ds.l 1
my_fcr ds.l 1
my_vcr_ptr ds.l 1
cookie ds.w 1
call_class ds.w 1
tmp ds.w 1
Expand Down
68 changes: 50 additions & 18 deletions host.fst.aii
Original file line number Diff line number Diff line change
Expand Up @@ -161,64 +161,80 @@ rtl_invalid_pcount proc



sys_startup proc
find_host_device proc
with dev_parms

; 1. find the .host device.

; find .host device. if no .host, returns to gs/os.
; entry via jsr
; exit via rts (success) / sys_exit (fail).
lda dev_id
beq @search
bmi @fail
rts
@fail plx
lda #unknown_vol
sec
jml sys_exit
@search
lda #-1
sta dev_id
lda #1
sta dev_dev_id
stz dev_num
loop
@loop
lda #drvr_get_dib
sta dev_callnum
jsl dev_dispatcher
bcs no
; appletalk puts up a dialog box....
bcs @fail

ldy #$34 ; dib device id
lda [dev_dib_ptr],y
cmp #$10 ; file server
bne next
bne @next

short m
ldy #$0e ; name $04 H O S T
lda [dev_dib_ptr],y
cmp #$04
bne next
bne @next

iny
lda [dev_dib_ptr],y
cmp #'H'
bne next
bne @next

iny
lda [dev_dib_ptr],y
cmp #'O'
bne next
bne @next

iny
lda [dev_dib_ptr],y
cmp #'S'
bne next
bne @next

iny
lda [dev_dib_ptr],y
cmp #'T'
bne next
bne @next

long m
lda dev_dev_id
sta dev_id
bra got_device
clc
rts

next
@next
long m
; try the next one.
inc dev_dev_id
bra loop
bra @loop
endp

sys_startup proc

got_device

stz dev_id

; sanity check that the global buffer location
; is where I expect it.
Expand Down Expand Up @@ -346,6 +362,7 @@ app_entry proc
@path
; path checking...

jsr find_host_device
jsr check_path1
bcc @call
jml sys_exit
Expand Down Expand Up @@ -399,6 +416,8 @@ app_entry proc





app_table
dc.w rtl_bad_system_call ;
dc.w create ; ($01) Create
Expand Down Expand Up @@ -751,6 +770,13 @@ volume proc

with dp, fst_parms

;
; volume requires a device id. it doesn't fit
; into the standard table so we check for the
; .host device here.
;

jsr find_host_device
lda dev1_num
beq no

Expand Down Expand Up @@ -789,6 +815,8 @@ build_vcr proc
lda #0
jsl find_vcr
bcs create_vcr
stx my_vcr_ptr
sty my_vcr_ptr+2
jsl deref

stx my_vcr
Expand Down Expand Up @@ -844,6 +872,9 @@ create_vcr
ldx #host_name
ldy #^host_name
jsl alloc_vcr
stx my_vcr_ptr
sty my_vcr_ptr+2

lda #out_of_mem
bcs exit

Expand Down Expand Up @@ -1052,8 +1083,9 @@ open proc
sty my_fcr+2

; need to re-deref the vcr?
ldx vcr_ptr
ldy vcr_ptr+2
; vcr_ptr is actually a pathname.
ldx my_vcr_ptr
ldy my_vcr_ptr+2
jsl deref
stx my_vcr
sty my_vcr+2
Expand Down

0 comments on commit 524fa1a

Please sign in to comment.