A2osX/SYS/KERNEL.S.DEV.txt

124 lines
2.2 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
*/--------------------------------------
* # GetDevByID.A
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
* Y,A = DEVSLOT
* note: X Unmodified
*\--------------------------------------
K.GetDevByID.A cmp DevMgr.Count
2016-09-21 15:20:37 +00:00
bcs K.GetDevDNF
2015-06-03 18:30:57 +00:00
asl
asl
asl
asl
2015-06-03 18:30:57 +00:00
tay
2017-01-12 17:43:45 +00:00
2018-01-15 06:50:44 +00:00
lda /Dev.Table
adc #0
2015-06-03 18:30:57 +00:00
rts CC
*/--------------------------------------
* # GetDevByName.YA
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:**
2015-03-14 21:48:35 +00:00
* CC = OK, CS = ERROR
2015-06-03 18:30:57 +00:00
* X = DEVID
* Y,A = DEVSLOT
*\--------------------------------------
K.GetDevByName.YA
2017-01-12 17:43:45 +00:00
>STYA ZPPtr1
>LDYAI Dev.Table+S.DEV.NAME
2017-01-12 17:43:45 +00:00
>STYA ZPPtr2
2015-03-14 21:48:35 +00:00
2015-06-03 18:30:57 +00:00
ldx #0
.1 ldy #$ff
2016-10-07 20:48:49 +00:00
.2 iny
lda (ZPPtr1),y
cmp (ZPPtr2),y
bne .3
ora (ZPPtr2),y Both char are 0 ?
bne .2 no....loop
2015-06-03 18:30:57 +00:00
2017-01-12 17:43:45 +00:00
lda ZPPtr2
2018-01-15 06:50:44 +00:00
and #$F0
2015-06-03 18:30:57 +00:00
tay
2017-01-12 17:43:45 +00:00
lda ZPPtr2+1
2015-03-14 21:48:35 +00:00
clc
rts
2015-06-03 18:30:57 +00:00
.3 lda ZPPtr2
2015-03-14 21:48:35 +00:00
clc
adc #S.DEV
2017-01-12 17:43:45 +00:00
sta ZPPtr2
2015-06-03 18:30:57 +00:00
bcc .4
2017-01-12 17:43:45 +00:00
inc ZPPtr2+1
2015-06-03 18:30:57 +00:00
2017-01-12 17:43:45 +00:00
.4 inx
cpx DevMgr.Count
bne .1
2015-06-03 18:30:57 +00:00
K.GetDevDNF lda #MLI.E.NODEV CS from cpx/beq
2015-03-14 21:48:35 +00:00
rts
2018-01-15 06:50:44 +00:00
*/--------------------------------------
* # GetDevStatus.A
2018-06-14 15:31:36 +00:00
* **In:**
2018-01-15 06:50:44 +00:00
* A = DevID
2018-06-14 15:31:36 +00:00
* **Out:**
2018-01-15 06:50:44 +00:00
* Y,A = S.DSTAT
*\--------------------------------------
K.DevClose.A ldx #DEVMGR.CLOSE
.HS 2C BIT ABS
2018-01-15 06:50:44 +00:00
K.GetDevStatus.A
ldx #DEVMGR.STATUS
2018-01-15 06:50:44 +00:00
jsr K.GetDevByID.A
bcs K.IOCTL.9
2018-01-15 06:50:44 +00:00
>STYA pDev
jmp (pDev)
*/--------------------------------------
* # IOCTL
2018-06-18 06:22:50 +00:00
* ## C
* `int ioctl ( short int id, short int op, void *param);`
* ## ASM
2018-06-14 15:31:36 +00:00
* **In:**
2018-06-18 06:22:50 +00:00
* `PUSHWI param`
* `lda #op`
* `ldy id`
* `>SYSCALL IOCTL`
2018-06-14 15:31:36 +00:00
* **Out:**
2018-01-15 06:50:44 +00:00
* Y,A = ...
*\--------------------------------------
2018-06-18 06:22:50 +00:00
K.IOCTL tax op
>PULLB .1+1 param LO
>PULLB .2+1 param HI
2018-01-15 06:50:44 +00:00
2018-06-18 06:22:50 +00:00
tya id
2018-01-15 06:50:44 +00:00
jsr K.GetDevByID.A
bcs K.IOCTL.9
2018-01-15 06:50:44 +00:00
>STYA pDev
.1 ldy #$ff SELF MODIFIED
.2 lda #$ff SELF MODIFIED
2018-06-18 06:22:50 +00:00
jmp (pDev) x = op
2018-01-15 06:50:44 +00:00
K.IOCTL.9 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