NetDisk/installdriver.asm
Stephen Heumann ff538de39c Add basic infrastructure for an installable GS/OS driver.
Currently, this can install the DIBs from the driver, but no driver calls are implemented.
2018-08-06 20:22:33 -05:00

44 lines
827 B
NASM

case on
GSOSBusy gequ $E100BE
INSTALL_DRIVER gequ $01FCA8
dummy private
end
* Adapted from procedure shown in Brutal Deluxe GS/OS Internals book
InstallDriver start
phb ; set data bank to $E1 (to access GSOSBusy)
pea $E1E1
plb
plb
lda #$8000 ; check and set GS/OS busy flag
tsb |GSOSBusy
bne exit ; bail out if GS/OS is busy
phd
lda >gsosDP ; set DP to GS/OS direct page
tcd ; (should be unnecessary for INSTALL_DRIVER)
jsl ForceLCBank1 ; force in language card bank 1
pha ; save old state reg
ldx #dibList
ldy #^dibList
jsl INSTALL_DRIVER ; install the driver
tcd ; save INSTALL_DRIVER result
jsl RestoreStateReg ; restore old state reg
lda #$8000 ; clear GS/OS busy flag
trb |GSOSBusy
tdc ; return INSTALL_DRIVER result
pld ; restore direct page
exit plb
rtl
end