A2osX/SYS/KERNEL.S.DEV.txt

161 lines
2.7 KiB
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
PREFIX /A2OSX.BUILD
2017-12-22 21:24:30 +00:00
AUTO 4,1
*/--------------------------------------
2018-06-21 15:12:10 +00:00
* # GetDevByID
2018-06-14 15:31:36 +00:00
* **In:**
2018-06-18 06:22:50 +00:00
* A = DevID
2018-06-14 15:31:36 +00:00
* **Out:**
2018-06-18 06:22:50 +00:00
* CC = OK, CS = ERROR
2018-07-18 15:30:42 +00:00
* Y,A = FD
2018-08-08 15:13:37 +00:00
* X = hFD
*\--------------------------------------
2018-07-09 15:25:38 +00:00
K.GetDevByID cmp DevMgr.DevCnt
2018-06-25 05:59:43 +00:00
bcs K.GetDev.NODEV
tax
2017-01-12 17:43:45 +00:00
2018-08-08 15:13:37 +00:00
lda Dev.Table.hFD,x
pha
ldy Dev.Table.pFDLO,x
lda Dev.Table.pFDHI,x
plx
2018-06-25 05:59:43 +00:00
* clc
.9 rts CC
*/--------------------------------------
2018-06-21 15:12:10 +00:00
* # GetDevByName
2018-06-14 15:31:36 +00:00
* **In:**
* Y,A = Ptr to device name (C-String)
2018-06-14 15:31:36 +00:00
* **Out:**
2018-08-08 15:13:37 +00:00
* CC = OK, CS = ERROR
* Y,A = FD
* X = DevID
*\--------------------------------------
2018-06-21 15:12:10 +00:00
K.GetDevByName >STYA ZPPtr1
2015-03-14 21:48:35 +00:00
2015-06-03 18:30:57 +00:00
ldx #0
2018-08-08 15:13:37 +00:00
.1 ldy Dev.Table.pFDLO,x
lda Dev.Table.pFDHI,x
2018-06-25 05:59:43 +00:00
>STYA ZPPtr2
2018-07-11 15:13:29 +00:00
lda ZPPtr2
2018-06-25 05:59:43 +00:00
clc
2018-07-10 15:33:13 +00:00
adc #S.FD.DEV.NAME
2018-06-25 05:59:43 +00:00
sta ZPPtr3
2018-07-11 15:13:29 +00:00
lda ZPPtr2+1
2018-06-25 05:59:43 +00:00
adc #0
sta ZPPtr3+1
2018-07-11 15:13:29 +00:00
ldy #$ff
2016-10-07 20:48:49 +00:00
.2 iny
lda (ZPPtr1),y
2018-06-25 05:59:43 +00:00
cmp (ZPPtr3),y
bne .4
2018-06-25 05:59:43 +00:00
ora (ZPPtr3),y Both char are 0 ?
bne .2 no....loop
2015-06-03 18:30:57 +00:00
2018-07-11 15:13:29 +00:00
ldy ZPPtr2
2018-07-18 06:02:43 +00:00
lda ZPPtr2+1
2015-03-14 21:48:35 +00:00
clc
rts
2015-06-03 18:30:57 +00:00
2017-01-12 17:43:45 +00:00
.4 inx
2018-07-09 15:25:38 +00:00
cpx DevMgr.DevCnt
2017-01-12 17:43:45 +00:00
bne .1
2015-06-03 18:30:57 +00:00
2018-06-25 05:59:43 +00:00
K.GetDev.NODEV lda #MLI.E.NODEV
sec
2018-07-11 15:13:29 +00:00
K.GetDev.9 rts
2018-01-15 06:50:44 +00:00
*/--------------------------------------
2018-06-21 15:12:10 +00:00
* # GetDevStatus
2018-07-19 15:33:55 +00:00
* ## C
2018-08-08 15:13:37 +00:00
* `int getdevstatus ( short int hFD, S.DIB * dstat );`
2018-07-19 15:33:55 +00:00
* ## ASM
2018-06-14 15:31:36 +00:00
* **In:**
2018-07-19 15:33:55 +00:00
* `>PUSHWI S.DIB`
* `lda DevID`
* `>SYSCALL GetDevStatus`
2018-06-14 15:31:36 +00:00
* **Out:**
2018-01-15 06:50:44 +00:00
*\--------------------------------------
2018-07-19 15:33:55 +00:00
K.GetDevStatus pha
>PULLW K.S.IOCTL+S.IOCTL.BUFPTR
pla
2018-08-08 15:13:37 +00:00
jsr K.GetMemPtr
2018-07-11 15:13:29 +00:00
bcs K.GetDev.9
2018-01-15 06:50:44 +00:00
2018-07-11 15:13:29 +00:00
>STYA pFD
2018-01-15 06:50:44 +00:00
2018-07-18 15:30:42 +00:00
ldy #S.FD.DEV.DRVPTR
lda (pFD),y
sta .1+1
iny
lda (pFD),y
sta .1+2
2018-07-19 15:33:55 +00:00
lda #S.IOCTL.STATCODE.GETDIB
sta K.S.IOCTL+S.IOCTL.STATCODE
2018-07-18 15:30:42 +00:00
>LDYAI K.S.IOCTL
ldx #IOCTL.STATUS
.1 jmp $ffff
2018-07-19 15:33:55 +00:00
.9 rts
2018-07-17 15:45:59 +00:00
*/--------------------------------------
* # MKDev
* **In:**
* Y,A = Ptr to FD.DEV
* **Out:**
* A = DEVID
*\--------------------------------------
K.MKDev >STYA .1+1
2018-08-08 15:13:37 +00:00
2018-07-17 15:45:59 +00:00
ldx DevMgr.DevCnt
cmp #K.DEV.MAX
beq .9
>LDYAI S.FD.DEV
2018-08-11 10:57:57 +00:00
ldx #S.MEM.F.FD
jsr MEM.GetMem.YAX
2018-08-24 12:40:19 +00:00
bcs .99
2018-07-17 15:45:59 +00:00
>STYA .2+1
phx
ldx DevMgr.DevCnt
2018-08-08 15:13:37 +00:00
sta Dev.Table.pFDHI,x
2018-07-17 15:45:59 +00:00
tya
2018-08-08 15:13:37 +00:00
sta Dev.Table.pFDLO,x
2018-07-17 15:45:59 +00:00
pla
2018-08-08 15:13:37 +00:00
sta Dev.Table.hFD,x
2018-07-17 15:45:59 +00:00
2018-08-24 12:40:19 +00:00
lda #0 TODO Irq Flag
2018-08-08 15:13:37 +00:00
sta Dev.Table.F,x
2018-07-17 15:45:59 +00:00
ldx #S.FD.DEV-1
.1 lda $ffff,x SELF MODIFIED
.2 sta $ffff,x SELF MODIFIED
dex
bpl .1
2018-08-08 15:13:37 +00:00
lda DevMgr.DevCnt
2018-07-17 15:45:59 +00:00
inc DevMgr.DevCnt
rts
.9 lda #K.E.OOH
* sec
2018-08-24 12:40:19 +00:00
.99 rts
2016-02-24 19:52:24 +00:00
*--------------------------------------
2015-03-14 21:48:35 +00:00
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.DEV
LOAD /A2OSX.SRC/SYS/KERNEL.S
2015-03-14 21:48:35 +00:00
ASM