mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-08 11:30:41 +00:00
Kernel version 0.8 : KM.VSDRIVE, work in progress
This commit is contained in:
parent
be7ee09659
commit
8f5c5f448b
BIN
A2OSX.BOOT.po
BIN
A2OSX.BOOT.po
Binary file not shown.
BIN
A2OSX.SRC.po
BIN
A2OSX.SRC.po
Binary file not shown.
@ -139,7 +139,7 @@ DumpProDOSDev >LDYA L.MSG2
|
|||||||
sta ZPPTR2+1
|
sta ZPPTR2+1
|
||||||
|
|
||||||
cmp #$C1
|
cmp #$C1
|
||||||
bcc .8 3rd Party Driver loaded in RAM...
|
bcc .6 3rd Party Driver loaded in RAM...
|
||||||
|
|
||||||
cmp #$C8
|
cmp #$C8
|
||||||
bcs .4 In ProDOS Space.../RAM or DisK II
|
bcs .4 In ProDOS Space.../RAM or DisK II
|
||||||
|
@ -15,65 +15,190 @@ AUTO 6
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TmpPtr1 .EQ $0
|
TmpPtr1 .EQ $0
|
||||||
TmpPtr2 .EQ $2
|
TmpPtr2 .EQ $2
|
||||||
|
VS.CMD .EQ $C5 "E": Virtual Drive Command Envelope
|
||||||
|
DRV.EntryPoint .EQ $BF41
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB DRV/X.SER.6551.S
|
.INB DRV/X.SER.6551.S
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
VSDRIVE.Init >LDAXI VSDRIVE.MSG0
|
VSDRIVE.Init >LDAXI VSDRIVE.MSG0
|
||||||
jsr VSDRIVE.Print
|
jsr PrintCStrAX
|
||||||
|
|
||||||
jsr VSDRIVE.Check
|
jsr VSDRIVE.Check
|
||||||
bcc .1
|
bcc .1
|
||||||
|
|
||||||
>LDAXI VSDRIVE.MSG1
|
>LDAXI VSDRIVE.MSG1
|
||||||
jsr VSDRIVE.Print
|
jsr PrintCStrAX
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.1 jsr VSDRIVE.Detect
|
.1 jsr SSC.Detect
|
||||||
bcc .2
|
bcc .2
|
||||||
|
|
||||||
>LDAXI VSDRIVE.MSG2
|
>LDAXI VSDRIVE.MSG2
|
||||||
jsr VSDRIVE.Print
|
jsr PrintCStrAX
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.2 jsr VSDRIVE.Install
|
.2 sta DRV+2 DRV.Slotn0
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
pha
|
||||||
>LDAXI VSDRIVE.MSG3
|
>LDAXI VSDRIVE.MSG3
|
||||||
jsr VSDRIVE.Print
|
jsr PrintCStrAX
|
||||||
|
|
||||||
|
jsr VSDRIVE.SetSlot
|
||||||
|
bcc .3
|
||||||
|
>LDAXI VSDRIVE.MSG4
|
||||||
|
jsr PrintCStrAX
|
||||||
|
rts
|
||||||
|
|
||||||
|
.3 pha save slot
|
||||||
|
pha 2 times
|
||||||
|
>LDAXI VSDRIVE.MSG5
|
||||||
|
jsr PrintCStrAX
|
||||||
|
|
||||||
|
jsr VSDRIVE.Install
|
||||||
|
|
||||||
|
>LDAXI VSDRIVE.MSG6
|
||||||
|
jsr PrintCStrAX
|
||||||
|
|
||||||
>DEBUG
|
>DEBUG
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
VSDRIVE.Check
|
VSDRIVE.Check bit RRAMWRAMBNK2
|
||||||
|
bit RRAMWRAMBNK2
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda $D001
|
||||||
|
eor DRV
|
||||||
|
bne .8
|
||||||
|
lda $D002
|
||||||
|
eor DRV+1
|
||||||
|
bne .8
|
||||||
|
sec
|
||||||
|
|
||||||
|
.8 bit RROMBNK1
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
SSC.Detect stz TmpPtr1
|
||||||
|
lda #$C1
|
||||||
|
sta TmpPtr1+1
|
||||||
|
|
||||||
|
.1 ldx #DEVSIG.Value-DEVSIG.Offset-1
|
||||||
|
|
||||||
|
.2 ldy DEVSIG.Offset,x
|
||||||
|
lda (TmpPtr1),y
|
||||||
|
cmp DEVSIG.Value,x
|
||||||
|
bne .3
|
||||||
|
dex
|
||||||
|
bpl .2
|
||||||
|
lda TmpPtr1+1
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.3 inc TmpPtr1+1 no match, try next slot....
|
||||||
|
lda TmpPtr1+1
|
||||||
|
cmp #$C8
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
.9 sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
VSDRIVE.Ping
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
VSDRIVE.Detect
|
* Find 2 free slots in DEVPTRS (D1 & D2)
|
||||||
|
*--------------------------------------
|
||||||
|
VSDRIVE.SetSlot ldx #2 Starts at Slot1
|
||||||
|
|
||||||
|
.1 lda DEVPTRS,x Drive1
|
||||||
|
cmp DEVPTRS pointing to S0D1 NODEV ?
|
||||||
|
bne .2
|
||||||
|
lda DEVPTRS+1,x
|
||||||
|
cmp DEVPTRS+1
|
||||||
|
bne .2
|
||||||
|
lda DEVPTRS+16,x Drive2
|
||||||
|
cmp DEVPTRS
|
||||||
|
bne .2
|
||||||
|
lda DEVPTRS+17,x
|
||||||
|
cmp DEVPTRS+1
|
||||||
|
bne .2
|
||||||
|
|
||||||
.9 clc
|
lda #DRV.EntryPoint
|
||||||
rts
|
sta DEVPTRS,x
|
||||||
*--------------------------------------
|
sta DEVPTRS+16,x
|
||||||
*--------------------------------------
|
lda /DRV.EntryPoint
|
||||||
VSDRIVE.Install
|
sta DEVPTRS+1,x
|
||||||
rts
|
sta DEVPTRS+17,x
|
||||||
*--------------------------------------
|
|
||||||
VSDRIVE.Print >STAX TmpPtr1
|
|
||||||
ldy #0
|
|
||||||
|
|
||||||
.1 lda (TmpPtr1),y
|
txa
|
||||||
beq .9
|
asl
|
||||||
ora #$80
|
asl
|
||||||
jsr COUT
|
asl
|
||||||
|
ldy DEVCNT
|
||||||
iny
|
iny
|
||||||
|
sta DEVLST,y add Drv1
|
||||||
|
ora #$80
|
||||||
|
iny
|
||||||
|
sta DEVLST,y add Drv2
|
||||||
|
sty DEVCNT
|
||||||
|
|
||||||
|
txa
|
||||||
|
lsr
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.2 inx
|
||||||
|
inx
|
||||||
|
cpx #16
|
||||||
bne .1
|
bne .1
|
||||||
.9 jmp CROUT
|
rts sec from CPX
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
VSDRIVE.MSG0 >CSTR "VSDRIVE ('Vitual Serial Hard Drive') Driver For A2osX"
|
VSDRIVE.Install ldx #9
|
||||||
VSDRIVE.MSG1 >CSTR "VSDRIVE Already Installed."
|
.1 lda ProDOS.PATCH,x
|
||||||
VSDRIVE.MSG2 >CSTR "SSC Not Detected."
|
sta DRV.EntryPoint,x
|
||||||
VSDRIVE.MSG3 >CSTR "VSDRIVE Driver Successfully Installed."
|
dex
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
bit RRAMWRAMBNK2
|
||||||
|
bit RRAMWRAMBNK2
|
||||||
|
|
||||||
|
ldx #DRV.SIZE
|
||||||
|
.2 lda DRV-1,x
|
||||||
|
sta $D000,x
|
||||||
|
dex
|
||||||
|
bne .2
|
||||||
|
|
||||||
|
bit RROMBNK1
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
.INB X.PRINTF.S
|
||||||
|
*--------------------------------------
|
||||||
|
DEVSIG.Offset .HS 05070B0C
|
||||||
|
DEVSIG.Value .HS 38180131
|
||||||
|
VSDRIVE.MSG0 >CSTR "VSDRIVE (ADT Vitual Serial Hard Drive) Driver For A2osX\n"
|
||||||
|
VSDRIVE.MSG1 >CSTR "VSDRIVE (Or other custom Driver) Already Installed.\n"
|
||||||
|
VSDRIVE.MSG2 >CSTR "SSC Not Detected.\n"
|
||||||
|
VSDRIVE.MSG3 >CSTR "SCC Found At Slot %d.\n"
|
||||||
|
VSDRIVE.MSG4 >CSTR "No ProDOS device slot available.\n"
|
||||||
|
VSDRIVE.MSG5 >CSTR "VSDRIVE Installed 2 devices at S%dD1 & S%dD2.\n"
|
||||||
|
VSDRIVE.MSG6 >CSTR "VSDRIVE Driver Successfully Installed.\n"
|
||||||
|
*--------------------------------------
|
||||||
|
* ProDOS $BE41->$BE4B Patch for switching to BANK2 (10 bytes)
|
||||||
|
*--------------------------------------
|
||||||
|
ProDOS.PATCH .PH DRV.EntryPoint
|
||||||
|
bit RRAMWRAMBNK2
|
||||||
|
jsr $D001
|
||||||
|
bit RRAMWRAMBNK1
|
||||||
|
rts
|
||||||
|
.EP
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Driver
|
* Driver
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -82,7 +207,13 @@ VSDRIVE.MSG3 >CSTR "VSDRIVE Driver Successfully Installed."
|
|||||||
* OP = 4 : Write drv2
|
* OP = 4 : Write drv2
|
||||||
* OP = 5 : Read drv2
|
* OP = 5 : Read drv2
|
||||||
* CMD = $CE+OP+BLKLO+BLKHI+CHKSUM
|
* CMD = $CE+OP+BLKLO+BLKHI+CHKSUM
|
||||||
|
* DO NOT trash DRV.COMMAND...DRV.BLKNUM as ProDOS
|
||||||
|
* reuses them after Block operation
|
||||||
|
* A1,A2 are used by Disk II Driver,
|
||||||
|
* so we use it safely as Tmp Ptr
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
DRV.A1L .EQ $3C
|
||||||
|
DRV.A1H .EQ $3D
|
||||||
DRV.A2L .EQ $3E
|
DRV.A2L .EQ $3E
|
||||||
DRV.A2H .EQ $3F
|
DRV.A2H .EQ $3F
|
||||||
DRV.COMMAND .EQ $42
|
DRV.COMMAND .EQ $42
|
||||||
@ -91,7 +222,7 @@ DRV.BUFF .EQ $44
|
|||||||
DRV.BLKNUM .EQ $46
|
DRV.BLKNUM .EQ $46
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV .EQ *
|
DRV .EQ *
|
||||||
.PH $D001 Main LC Bnk 1 $D001->$DFFF
|
.PH $D001 Main LC Bnk 2 $D001->$DFFF
|
||||||
cld
|
cld
|
||||||
DRV.Slotn0 ldx #$ff Self Modified
|
DRV.Slotn0 ldx #$ff Self Modified
|
||||||
lda DRV.COMMAND
|
lda DRV.COMMAND
|
||||||
@ -118,8 +249,8 @@ DRV.Slotn0 ldx #$ff Self Modified
|
|||||||
.9 lda #MLI.ERR.IO
|
.9 lda #MLI.ERR.IO
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.DO.CMD sta DRVDRV.CmdBuf.Cmd store cmd
|
DRV.DO.CMD sta DRV.CmdBuf.Cmd store cmd
|
||||||
eor #$CE
|
eor #VS.CMD
|
||||||
sta DRV.CmdBuf.Sum
|
sta DRV.CmdBuf.Sum
|
||||||
|
|
||||||
lda DRV.BLKNUM
|
lda DRV.BLKNUM
|
||||||
@ -132,6 +263,12 @@ DRV.DO.CMD sta DRVDRV.CmdBuf.Cmd store cmd
|
|||||||
eor DRV.CmdBuf.Sum
|
eor DRV.CmdBuf.Sum
|
||||||
sta DRV.CmdBuf.Sum
|
sta DRV.CmdBuf.Sum
|
||||||
|
|
||||||
|
lda DRV.BUFF
|
||||||
|
sta DRV.A2L
|
||||||
|
lda DRV.BUFF+1
|
||||||
|
inc
|
||||||
|
sta DRV.A2H
|
||||||
|
|
||||||
stz SSC.RESET,x
|
stz SSC.RESET,x
|
||||||
|
|
||||||
lda #SSC.CTL.B115200+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP
|
lda #SSC.CTL.B115200+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP
|
||||||
@ -159,8 +296,15 @@ DRV.DO.CMD sta DRVDRV.CmdBuf.Cmd store cmd
|
|||||||
iny
|
iny
|
||||||
cpy #4
|
cpy #4
|
||||||
bne .2
|
bne .2
|
||||||
* skip CS
|
|
||||||
iny
|
* Get ProDOS Date/time send from server if READ (3 or 5)
|
||||||
|
|
||||||
|
lda DRV.COMMAND
|
||||||
|
cmp #1
|
||||||
|
bne .6
|
||||||
|
|
||||||
|
* Read block
|
||||||
|
iny Skip Checksum
|
||||||
|
|
||||||
.3 jsr DRV.SSCGet
|
.3 jsr DRV.SSCGet
|
||||||
bcs .9
|
bcs .9
|
||||||
@ -170,31 +314,53 @@ DRV.DO.CMD sta DRVDRV.CmdBuf.Cmd store cmd
|
|||||||
iny
|
iny
|
||||||
cpy #9
|
cpy #9
|
||||||
bne .3
|
bne .3
|
||||||
|
|
||||||
|
* recieve Header CS and check
|
||||||
|
|
||||||
jsr DRV.SSCGet
|
jsr DRV.SSCGet
|
||||||
bcs .9
|
bcs .9
|
||||||
cmp DRV.CmdBuf.Sum
|
cmp DRV.CmdBuf.Sum
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
.4 jsr DRV.SSCGet
|
||||||
|
bcs .9
|
||||||
|
sta (DRV.BUFF),y
|
||||||
|
iny
|
||||||
|
bne .4
|
||||||
|
|
||||||
|
.5 jsr DRV.SSCGet
|
||||||
|
bcs .9
|
||||||
|
sta (DRV.A2L),y
|
||||||
|
iny
|
||||||
|
bne .5
|
||||||
|
|
||||||
|
jsr DRV.BufCheckSum
|
||||||
|
sta DRV.CmdBuf.Sum
|
||||||
|
jsr DRV.SSCGet
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
cmp DRV.CmdBuf.Sum
|
||||||
|
bne .9
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
* Write Block
|
||||||
|
.6
|
||||||
|
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 sec
|
.9 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.CmdBuf .HS $CE
|
DRV.CmdBuf .DA #VS.CMD
|
||||||
DRV.CmdBuf.Cmd .BS 1
|
DRV.CmdBuf.Cmd .BS 1
|
||||||
DRV.CmdBuf.Blk .BS 2
|
DRV.CmdBuf.Blk .BS 2
|
||||||
DRV.CmdBuf.Sum .BS 1
|
DRV.CmdBuf.Sum .BS 1
|
||||||
DRV.CmdBuf.Time .BS 4
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.BufCheckSum lda DRV.BUFF
|
DRV.BufCheckSum lda #0
|
||||||
sta DRV.A2L
|
|
||||||
lda DRV.BUFF+1
|
|
||||||
inc
|
|
||||||
sta DRV.A2H
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
tay
|
tay
|
||||||
|
|
||||||
.1 eor (DRV.BUFF),y
|
.1 eor (DRV.BUFF),y
|
||||||
@ -203,13 +369,13 @@ DRV.BufCheckSum lda DRV.BUFF
|
|||||||
bne .1
|
bne .1
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.SSCSend
|
DRV.SSCSend pha
|
||||||
.1 lda SSC.STATUS,x
|
.1 lda SSC.STATUS,x
|
||||||
bit #SSC.STATUS.DCD+SSC.STATUS.DSR
|
bit #SSC.STATUS.DCD+SSC.STATUS.DSR
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
and #SSC.STATUS.TDRE Outgoing char?
|
and #SSC.STATUS.TDRE Outgoing char?
|
||||||
bne .1
|
beq .1
|
||||||
|
|
||||||
pla
|
pla
|
||||||
sta SSC.DATA,x
|
sta SSC.DATA,x
|
||||||
@ -231,9 +397,7 @@ DRV.SSCGet
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.BS 4 Time,Date
|
|
||||||
.EP
|
.EP
|
||||||
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.SIZE .EQ *-DRV
|
DRV.SIZE .EQ *-DRV
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -34,7 +34,7 @@ PrintCStrAX >STAX TmpPtr1
|
|||||||
lda (TmpPtr1),y
|
lda (TmpPtr1),y
|
||||||
beq .9
|
beq .9
|
||||||
cmp #'%'
|
cmp #'%'
|
||||||
bne .4
|
bne .5
|
||||||
|
|
||||||
.11 iny
|
.11 iny
|
||||||
lda (TmpPtr1),y
|
lda (TmpPtr1),y
|
||||||
|
Loading…
x
Reference in New Issue
Block a user