A2osX/SYS/KERNEL.S.PFT.txt

164 lines
2.5 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
2016-08-24 15:42:33 +00:00
*--------------------------------------
2020-03-10 16:42:07 +00:00
PFT.CheckPath1 ldy #1
.HS 2C BIT ABS
2020-02-14 07:21:56 +00:00
PFT.CheckPath2 ldy #2
.HS 2C BIT ABS
PFT.CheckPath4 ldy #4
2019-10-10 10:23:02 +00:00
2020-02-14 07:21:56 +00:00
lda (pStack),y
pha
iny
lda (pStack),y
2020-03-16 06:50:15 +00:00
ply
PFT.CheckPathYA >PUSHYA
2020-12-15 13:23:22 +00:00
2020-03-16 06:50:15 +00:00
stx .6+1 Save SYSCALL #
2020-02-14 07:21:56 +00:00
>PUSHWI K.Buf256
>SYSCALL2 realpath
2021-05-04 17:31:21 +00:00
bcs PFT.RTS
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
ldx #0
2019-10-10 10:23:02 +00:00
2021-02-11 22:08:22 +00:00
.1 inx
2023-10-18 05:41:12 +00:00
lda PFTs.pHI-1,x
2018-12-21 14:32:45 +00:00
beq .8
2019-10-10 10:23:02 +00:00
2021-01-12 21:14:13 +00:00
sta ZPPtr1+1
2021-06-19 17:46:36 +00:00
2023-10-18 05:41:12 +00:00
lda PFTs.pLO-1,x
2021-01-12 21:14:13 +00:00
sta ZPPtr1
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
ldy #$ff
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
.2 iny
lda (ZPPtr1),y "/FILTER\0"
beq .3 end of filter string....
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
cmp K.Buf256,y can be \0
beq .2
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
bra .8
2019-10-10 10:23:02 +00:00
2021-06-17 17:38:34 +00:00
.3 lda K.Buf256,y
beq .4 path is "/FILTER" ?
cmp #'/' path is "/FILTER/..." ?
bne .8
2019-10-10 10:23:02 +00:00
2021-06-17 17:38:34 +00:00
iny
2023-10-18 05:41:12 +00:00
.4 lda PFTs.cbLO-1,x
2021-01-12 21:14:13 +00:00
sta .7+1
2023-10-18 05:41:12 +00:00
lda PFTs.cbHI-1,x
2021-01-12 21:14:13 +00:00
sta .7+2
2021-06-19 17:46:36 +00:00
2021-02-11 22:08:22 +00:00
stx hHandler
2021-06-19 17:46:36 +00:00
2016-08-24 15:42:33 +00:00
pla discard JSR return @
pla
2021-06-17 17:38:34 +00:00
2021-01-12 21:14:13 +00:00
lda /K.Buf256 pass full path to handler
2019-10-10 10:23:02 +00:00
2020-12-15 13:23:22 +00:00
.6 ldx #$ff SELF MODIFIED SYSCALL #
2021-02-11 22:08:22 +00:00
2018-12-21 14:32:45 +00:00
.7 jmp $ffff SELF MODIFIED
2019-10-10 10:23:02 +00:00
2023-10-18 05:41:12 +00:00
.8 cpx #K.PFT.MAX
2018-12-21 14:32:45 +00:00
bne .1
2018-11-16 22:43:12 +00:00
2019-12-02 07:09:58 +00:00
>LDYAI K.Buf256
2018-11-16 16:04:20 +00:00
*--------------------------------------
PFT.YAToMLIPATH >STYA .1+1
2019-10-10 10:23:02 +00:00
2018-11-16 16:04:20 +00:00
ldx #0 no filter, prodos path
2019-10-10 10:23:02 +00:00
2018-11-16 16:04:20 +00:00
.1 lda $ffff,x SELF MODIFIED
beq .2
2019-10-10 10:23:02 +00:00
2018-11-16 16:04:20 +00:00
inx
sta K.MLI.PATH,x
cpx #MLI.MAXPATH
bne .1
2019-10-10 10:23:02 +00:00
2018-11-16 16:04:20 +00:00
.2 stx K.MLI.PATH
inx
stz K.MLI.PATH,x Make ending 0 for /dev/xxx path
>LDYAI K.MLI.PATH
>STYA K.MLI.PARAMS+1
2019-10-10 10:23:02 +00:00
2018-11-16 16:04:20 +00:00
clc
2021-05-04 17:31:21 +00:00
PFT.RTS rts
2016-08-24 15:42:33 +00:00
*--------------------------------------
2020-08-19 19:39:43 +00:00
PFT.CheckNode4 ldy #4
2020-12-15 13:23:22 +00:00
2021-05-14 20:58:20 +00:00
PFT.CheckNodeY lda (pStack),y
2020-12-15 13:23:22 +00:00
2018-11-16 16:04:20 +00:00
PFT.CheckNodeA stx .80+1 Save SYSCALL #
2021-07-24 20:42:23 +00:00
sta IO.hFILE
2018-10-08 05:55:28 +00:00
2021-07-24 20:42:23 +00:00
tax
beq .9
2023-01-17 06:31:23 +00:00
2023-10-18 05:41:12 +00:00
cpx #K.FILE.MAX+1
2021-07-24 20:42:23 +00:00
bcs .9
2023-10-18 05:41:12 +00:00
ldy FILEs.hFD-1,x
sty IO.hFD
lda FDs.pLO-1,y
sta pFD
lda FDs.pHI-1,y
sta pFD+1
2021-07-24 20:42:23 +00:00
beq .9
2023-01-17 06:31:23 +00:00
2021-05-04 17:31:21 +00:00
ldy #S.FD.PFT
2018-11-16 16:04:20 +00:00
lda (pFD),y
beq .8 Handler is 0, back to kernel....
2021-02-11 22:08:22 +00:00
tax
2023-10-18 05:41:12 +00:00
lda PFTs.cbLO-1,x
2021-02-11 22:08:22 +00:00
sta .7+1
2023-10-18 05:41:12 +00:00
lda PFTs.cbHI-1,x
2021-06-19 17:46:36 +00:00
sta .7+2
2021-02-11 22:08:22 +00:00
stx hHandler
2021-06-19 17:46:36 +00:00
pla discard JSR return @
pla
2018-11-16 16:04:20 +00:00
ldx .80+1 restore SYSCALL #
2021-07-24 20:42:23 +00:00
lda IO.hFILE
2018-11-16 16:04:20 +00:00
2021-02-11 22:08:22 +00:00
.7 jmp $ffff SELF MODIFIED
2016-08-24 15:42:33 +00:00
2023-10-18 05:41:12 +00:00
.8 jsr DEV.GetPDrv
lda (pFD) #S.FD.T
2020-09-07 20:40:50 +00:00
cmp #S.FD.T.CDEV
2020-12-15 13:23:22 +00:00
bcs .80
2020-09-07 20:40:50 +00:00
ldy #S.FD.REG.REF REG or DIR
2018-11-16 16:04:20 +00:00
lda (pFD),y
sta K.MLI.PARAMS+1
2019-10-10 10:23:02 +00:00
2018-11-16 16:04:20 +00:00
.80 ldx #$ff SELF MODIFIED
2021-07-24 20:42:23 +00:00
.81 lda IO.hFILE
2018-11-16 16:04:20 +00:00
clc
2019-10-10 10:23:02 +00:00
2020-12-15 13:23:22 +00:00
.99 rts
2021-07-24 20:42:23 +00:00
.9 lda #E.INVH
sec
rts
2016-08-24 15:42:33 +00:00
*--------------------------------------
MAN
2020-12-15 13:23:22 +00:00
SAVE usr/src/sys/kernel.s.pft
LOAD usr/src/sys/kernel.s
2016-08-24 15:42:33 +00:00
ASM