2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2019-05-25 19:24:07 +00:00
|
|
|
|
AUTO 3,1
|
2016-10-07 15:28:17 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
DRV.DiskII.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
|
2017-10-18 15:32:56 +00:00
|
|
|
|
.DA 280
|
|
|
|
|
.DA #0
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.PS "Disk ][ 5.25"
|
2017-10-18 15:32:56 +00:00
|
|
|
|
.BS 4
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.DA #S.DIB.T.DISKII
|
2017-10-18 15:32:56 +00:00
|
|
|
|
.DA #0
|
2018-08-25 11:23:59 +00:00
|
|
|
|
.DA K.VER
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-11-07 16:28:34 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-11-07 16:28:34 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
DRV.RamDrive.S jsr DRV.Blk
|
2017-11-07 16:28:34 +00:00
|
|
|
|
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
|
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.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
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.BS 3
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.PS "ProDOS /RAM Disk"
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.DA #S.DIB.T.RAM
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.DA #0
|
2018-08-25 11:23:59 +00:00
|
|
|
|
.DA K.VER
|
2017-11-07 16:28:34 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
DRV.BlkDev.S jsr DRV.Blk
|
2017-10-18 15:32:56 +00:00
|
|
|
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>LDYAI DRV.BlkDev.DIB
|
2018-07-06 14:42:20 +00:00
|
|
|
|
jmp DRV.STATUS.YA
|
2017-10-18 15:32:56 +00:00
|
|
|
|
.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
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.PS "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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-06 14:42:20 +00:00
|
|
|
|
* IOCTL to BLK protocol converter
|
2019-05-06 12:58:15 +00:00
|
|
|
|
* in : pIOCTL
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-06 14:42:20 +00:00
|
|
|
|
DRV.BLK txa
|
2017-10-18 15:32:56 +00:00
|
|
|
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
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
|
2017-10-18 15:32:56 +00:00
|
|
|
|
rts
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
|
|
|
|
DRV.BLK.P .BS 6
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-21 16:29:15 +00:00
|
|
|
|
* 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
|
2017-03-21 16:29:15 +00:00
|
|
|
|
iny
|
2018-07-10 15:33:13 +00:00
|
|
|
|
lda (pFD),y
|
2019-05-06 12:58:15 +00:00
|
|
|
|
sta .1+2
|
2017-09-13 06:17:46 +00:00
|
|
|
|
|
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
|
2017-03-21 16:29:15 +00:00
|
|
|
|
rts
|
2018-07-06 14:42:20 +00:00
|
|
|
|
|
2018-06-20 15:02:09 +00:00
|
|
|
|
DRV.SmartPort.Cnt
|
2017-09-13 06:17:46 +00:00
|
|
|
|
.HS 03030301030101010404
|
2017-03-21 16:29:15 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-05 15:39:36 +00:00
|
|
|
|
* NULL DEVICE
|
|
|
|
|
* - OPEN,WRITE,CLOSE always succeed.
|
|
|
|
|
* - READ returns EOF.
|
2017-11-21 16:27:07 +00:00
|
|
|
|
*--------------------------------------
|
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
|
2016-10-07 15:28:17 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
DRV.NULL.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED
|
2017-01-25 21:46:40 +00:00
|
|
|
|
.DA #0,#0,#0
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.PS "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
|
2017-01-25 21:46:40 +00:00
|
|
|
|
.DA #0
|
2018-08-25 11:23:59 +00:00
|
|
|
|
.DA K.VER
|
2017-01-25 21:46:40 +00:00
|
|
|
|
*--------------------------------------
|
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
|
|
|
|
|
*--------------------------------------
|
2016-10-07 15:28:17 +00:00
|
|
|
|
MAN
|
2020-12-15 13:23:22 +00:00
|
|
|
|
SAVE usr/src/sys/kernel.s.drv
|
|
|
|
|
LOAD usr/src/sys/kernel.s
|
2016-10-07 15:28:17 +00:00
|
|
|
|
ASM
|