host fst updates.

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.
This commit is contained in:
Kelvin Sherlock 2018-07-14 09:10:34 -04:00
parent e890e33f39
commit 524fa1a94b
2 changed files with 51 additions and 18 deletions

View File

@ -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

View File

@ -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
got_device
sys_startup proc
stz dev_id
; sanity check that the global buffer location
; is where I expect it.
@ -346,6 +362,7 @@ app_entry proc
@path
; path checking...
jsr find_host_device
jsr check_path1
bcc @call
jml sys_exit
@ -399,6 +416,8 @@ app_entry proc
app_table
dc.w rtl_bad_system_call ;
dc.w create ; ($01) Create
@ -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
@ -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
@ -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
@ -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