A2osX/SYS/KERNEL.S.DRV.txt

273 lines
5.4 KiB
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
2019-05-25 19:24:07 +00:00
AUTO 3,1
*--------------------------------------
2018-06-20 15:02:09 +00:00
* DRV.DiskII
2018-06-19 05:55:12 +00:00
* X = IOCTL
2018-06-20 15:02:09 +00:00
* Y,A = PTR to S.IOCTL
*--------------------------------------
2018-06-20 15:02:09 +00:00
DRV.DiskII cld
2018-07-09 15:25:38 +00:00
cpx #IOCTL.FORMAT
2018-12-21 14:32:45 +00:00
bcs DRV.RamDrive.9
2018-07-06 14:42:20 +00:00
>STYA pIOCTL
2018-06-20 15:02:09 +00:00
jmp (.1,x)
2020-11-19 15:34:02 +00:00
2021-05-04 17:31:21 +00:00
.1 .DA DRV.DiskII.S
2018-07-06 14:42:20 +00:00
.DA DRV.BLK READ
.DA DRV.BLK WRITE
*--------------------------------------
2021-05-04 17:31:21 +00:00
DRV.DiskII.S >LDYAI DRV.DiskII.DIB
2018-07-06 14:42:20 +00:00
jmp DRV.STATUS.YA
*--------------------------------------
2018-07-19 15:33:55 +00:00
DRV.DiskII.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
.DA 280
.DA #0
2018-12-10 16:45:37 +00:00
>PSTR "Disk ][ 5.25"
.BS 4
2018-07-19 15:33:55 +00:00
.DA #S.DIB.T.DISKII
.DA #0
2018-08-25 11:23:59 +00:00
.DA K.VER
*--------------------------------------
2018-06-20 15:02:09 +00:00
* DRV.RamDrive
2018-06-19 05:55:12 +00:00
* X = IOCTL
2018-06-20 15:02:09 +00:00
* Y,A = PTR to S.IOCTL
*--------------------------------------
2018-06-20 15:02:09 +00:00
DRV.RamDrive cld
2018-07-09 15:25:38 +00:00
cpx #IOCTL.CONTROL
2018-12-21 14:32:45 +00:00
bcs DRV.RamDrive.9
2018-07-06 14:42:20 +00:00
>STYA pIOCTL
2018-06-20 15:02:09 +00:00
jmp (.1,x)
2021-05-04 17:31:21 +00:00
.1 .DA DRV.RamDrive.S
2018-07-06 14:42:20 +00:00
.DA DRV.BLK READ
.DA DRV.BLK WRITE
.DA DRV.BLK FORMAT
2018-12-21 14:32:45 +00:00
DRV.RamDrive.9 jmp A2osX.BadCall
*--------------------------------------
2021-05-04 17:31:21 +00:00
DRV.RamDrive.S jsr DRV.Blk
bcs .9
2021-05-04 17:31:21 +00:00
2018-07-19 15:33:55 +00:00
stx DRV.RamDrive.DIB+S.DIB.SIZE
sty DRV.RamDrive.DIB+S.DIB.SIZE+1
>LDYAI DRV.RamDrive.DIB
2018-07-06 14:42:20 +00:00
jmp DRV.STATUS.YA
.9 rts
*--------------------------------------
2018-07-19 15:33:55 +00:00
DRV.RamDrive.DIB
.DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
.BS 3
>PSTR "ProDOS /RAM Disk"
2018-07-19 15:33:55 +00:00
.DA #S.DIB.T.RAM
.DA #0
2018-08-25 11:23:59 +00:00
.DA K.VER
*--------------------------------------
2021-04-29 11:56:34 +00:00
* DRV.BlkDev
2018-06-19 05:55:12 +00:00
* X = IOCTL
2018-06-20 15:02:09 +00:00
* Y,A = PTR to S.IOCTL
*--------------------------------------
2021-04-29 11:56:34 +00:00
DRV.BlkDev cld
2018-07-09 15:25:38 +00:00
cpx #IOCTL.CONTROL
2018-12-21 14:32:45 +00:00
bcs DRV.RamDrive.9
2018-07-06 14:42:20 +00:00
>STYA pIOCTL
2018-06-20 15:02:09 +00:00
jmp (.1,x)
2021-05-04 17:31:21 +00:00
.1 .DA DRV.BlkDev.S
2018-07-06 14:42:20 +00:00
.DA DRV.BLK READ
.DA DRV.BLK WRITE
.DA DRV.BLK FORMAT
*--------------------------------------
2021-05-04 17:31:21 +00:00
DRV.BlkDev.S jsr DRV.Blk
bcs .9
2021-05-04 17:31:21 +00:00
2021-04-29 11:56:34 +00:00
stx DRV.BlkDev.DIB+S.DIB.SIZE
sty DRV.BlkDev.DIB+S.DIB.SIZE+1
2021-04-29 11:56:34 +00:00
>LDYAI DRV.BlkDev.DIB
2018-07-06 14:42:20 +00:00
jmp DRV.STATUS.YA
.9 rts
*--------------------------------------
2021-04-29 11:56:34 +00:00
DRV.BlkDev.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
2018-07-06 14:42:20 +00:00
.BS 3
>PSTR "ProDOS Block Dev"
2018-07-19 15:33:55 +00:00
.DA #S.DIB.T.PRODOS
2018-07-06 14:42:20 +00:00
.DA #0
2018-08-25 11:23:59 +00:00
.DA K.VER
*--------------------------------------
2018-07-06 14:42:20 +00:00
* IOCTL to BLK protocol converter
2019-05-06 12:58:15 +00:00
* in : pIOCTL
*--------------------------------------
2018-07-06 14:42:20 +00:00
DRV.BLK txa
lsr
2021-04-29 11:56:34 +00:00
sta DRV.BLK.P CMD
2020-12-15 13:23:22 +00:00
ldy #S.FD.DEV.DEVID Drive 1, or 2
2018-07-11 15:13:29 +00:00
lda (pFD),y
dec O or 1
lsr in Carry
php
2018-07-10 15:33:13 +00:00
ldy #S.FD.DEV.BUSID
2018-07-11 15:13:29 +00:00
lda (pFD),y
asl
asl
asl
asl
asl
plp
ror DSSS0000
2021-04-29 11:56:34 +00:00
sta DRV.BLK.P+1 UNITNUM
2018-07-06 14:42:20 +00:00
ldx #3
ldy #S.IOCTL.BUFPTR+3
2020-11-19 15:34:02 +00:00
2018-07-06 14:42:20 +00:00
.1 lda (pIOCTL),y BUF,BLKNUM
2021-04-29 11:56:34 +00:00
sta DRV.BLK.P+2,x
2018-07-06 14:42:20 +00:00
dey
dex
bpl .1
2020-11-19 15:34:02 +00:00
2018-07-10 15:33:13 +00:00
ldy #S.FD.DEV.BUSPTR
lda (pFD),y
2018-07-06 14:42:20 +00:00
sta .3+1
iny
2018-07-10 15:33:13 +00:00
lda (pFD),y
2018-07-06 14:42:20 +00:00
sta .3+2
2020-01-28 16:42:51 +00:00
2018-07-06 14:42:20 +00:00
jsr GO.ProDOS
2020-01-28 16:42:51 +00:00
2018-07-06 14:42:20 +00:00
ldx #5
2020-11-19 15:34:02 +00:00
2021-04-29 11:56:34 +00:00
.2 lda DRV.BLK.P,x
sta DRV.BLK.Cmd,x
2018-07-06 14:42:20 +00:00
dex
bpl .2
2020-11-19 15:34:02 +00:00
2018-07-06 14:42:20 +00:00
.3 jsr $ffff SELF MODIFIED
jsr GO.A2osX
rts
2021-04-29 11:56:34 +00:00
DRV.BLK.P .BS 6
*--------------------------------------
* Smartport Driver
*--------------------------------------
2018-06-20 15:02:09 +00:00
DRV.SmartPort cld
2019-05-06 12:58:15 +00:00
>STYA pIOCTL
>STYA .3 smartport Params
2018-07-06 14:42:20 +00:00
txa
lsr
2019-05-06 12:58:15 +00:00
sta .2
2018-07-06 14:42:20 +00:00
tax
2020-01-07 16:46:50 +00:00
lda DRV.SmartPort.Cnt,x
sta (pIOCTL) S.IOCTL.CNT
ldy #S.FD.DEV.DEVID
lda (pFD),y
ldy #S.IOCTL.UNITNUM
sta (pIOCTL),y
2018-07-10 15:33:13 +00:00
ldy #S.FD.DEV.BUSPTR
lda (pFD),y
2019-05-06 12:58:15 +00:00
sta .1+1
iny
2018-07-10 15:33:13 +00:00
lda (pFD),y
2019-05-06 12:58:15 +00:00
sta .1+2
2020-08-18 15:00:56 +00:00
jsr GO.ProDOS Remapped SP
2020-01-28 16:42:51 +00:00
2019-05-06 12:58:15 +00:00
.1 jsr $ffff
.2 .BS 1
.3 .BS 2
2020-08-18 15:00:56 +00:00
jsr GO.A2osX
rts
2018-07-06 14:42:20 +00:00
2018-06-20 15:02:09 +00:00
DRV.SmartPort.Cnt
.HS 03030301030101010404
*--------------------------------------
2018-07-05 15:39:36 +00:00
* NULL DEVICE
* - OPEN,WRITE,CLOSE always succeed.
* - READ returns EOF.
*--------------------------------------
2018-06-21 15:12:10 +00:00
DRV.NULL cld
2018-07-06 14:42:20 +00:00
>STYA pIOCTL
2018-12-21 14:32:45 +00:00
txa
2021-05-04 17:31:21 +00:00
beq DRV.NULL.S
2018-12-21 14:32:45 +00:00
jmp (.1-12,x)
2018-06-20 15:02:09 +00:00
*--------------------------------------
2019-10-03 06:25:27 +00:00
.1
2018-12-21 14:32:45 +00:00
* .DA DRV.NULL.STATUS
* .DA A2osX.BADCALL READBLOCK
* .DA A2osX.BADCALL WRITEBLOCK
* .DA A2osX.BADCALL FORMAT
* .DA A2osX.BADCALL CONTROL
* .DA A2osX.BADCALL INIT
2021-04-29 11:56:34 +00:00
.DA DRV.CLCRTS OPEN
.DA DRV.CLCRTS CLOSE
2021-05-04 17:31:21 +00:00
.DA DRV.NULL.R
2021-04-29 11:56:34 +00:00
.DA DRV.CLCRTS WRITE
*--------------------------------------
2018-07-19 15:33:55 +00:00
DRV.NULL.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED
.DA #0,#0,#0
2018-12-21 14:32:45 +00:00
>PSTR "NULL Device"
2018-06-18 06:22:50 +00:00
.BS 5
2018-07-19 15:33:55 +00:00
.DA #S.DIB.T.CHAR
.DA #0
2018-08-25 11:23:59 +00:00
.DA K.VER
*--------------------------------------
2021-05-04 17:31:21 +00:00
DRV.NULL.S >LDYAI DRV.NULL.DIB
2018-12-21 14:32:45 +00:00
*--------------------------------------
2018-07-06 14:42:20 +00:00
DRV.STATUS.YA >STYA .2+1
2021-05-04 17:31:21 +00:00
ldy #S.IOCTL.S
2018-07-06 14:42:20 +00:00
lda (pIOCTL),y
beq .1
2020-11-19 15:34:02 +00:00
2021-05-04 17:31:21 +00:00
cmp #S.IOCTL.S.GETDIB
2018-07-06 14:42:20 +00:00
bne .9
2020-11-19 15:34:02 +00:00
2018-07-19 15:33:55 +00:00
ldx #S.DIB-1
2018-07-06 14:42:20 +00:00
.HS 2C bit abs
.1 ldx #3
ldy #S.IOCTL.BUFPTR
lda (pIOCTL),y
sta .3+1
iny
lda (pIOCTL),y
sta .3+2
2020-11-19 15:34:02 +00:00
2018-07-06 14:42:20 +00:00
.2 lda $ffff,x SELF MODIFIED
.3 sta $ffff,x SELF MODIFIED
dex
bpl .2
2020-11-19 15:34:02 +00:00
2018-07-06 14:42:20 +00:00
clc
rts
.9 lda #MLI.E.BADCTL
sec
rts
*--------------------------------------
2021-05-04 17:31:21 +00:00
DRV.NULL.R ldx #C.EOF
2021-04-29 11:56:34 +00:00
ldy #S.IOCTL.BYTECNT
2018-07-05 15:39:36 +00:00
lda #1
sta (pIOCTL),y
iny
dec
sta (pIOCTL),y
ldy #S.IOCTL.BUFPTR
lda (pIOCTL),y
sta .1+1
iny
lda (pIOCTL),y
sta .1+2
.1 stx $ffff SELF MODIFIED
2018-12-21 14:32:45 +00:00
*--------------------------------------
2021-04-29 11:56:34 +00:00
DRV.CLCRTS clc
2018-07-05 15:39:36 +00:00
rts
*--------------------------------------
MAN
2020-12-15 13:23:22 +00:00
SAVE usr/src/sys/kernel.s.drv
LOAD usr/src/sys/kernel.s
ASM