A2osX/SYS/KERNEL.S.PFT.txt

161 lines
2.9 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
*--------------------------------------
2016-09-26 16:00:52 +00:00
* K.PFTAdd
* In :
* Out :
*--------------------------------------
2018-12-21 14:32:45 +00:00
K.PFTAdd
2016-09-26 16:00:52 +00:00
*--------------------------------------
* K.PFTRemove
* In :
* Out :
*--------------------------------------
K.PFTRemove
clc
2018-12-21 14:32:45 +00:00
K.PFTRemove.RTS rts
2016-09-26 16:00:52 +00:00
*--------------------------------------
2020-02-14 07:21:56 +00:00
* PFT.CheckPath
2016-09-26 16:00:52 +00:00
* In :
2020-02-14 07:21:56 +00:00
* (pStack),y = PATH (C-String)
2016-09-26 16:00:52 +00:00
* Out :
2016-08-24 15:42:33 +00:00
*--------------------------------------
2020-02-14 07:21:56 +00:00
PFT.CheckPath0 ldy #0
.HS 2C BIT ABS
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
stx .6+1 Save SYSCALL #
lda (pStack),y
pha
iny
lda (pStack),y
>PUSHA
pla
>PUSHA
>PUSHWI K.Buf256
>SYSCALL2 realpath
2018-12-21 14:32:45 +00:00
bcs K.PFTRemove.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
2018-12-21 14:32:45 +00:00
.1 lda Flt.Table.hPath,x
beq .8
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
jsr K.GetMemPtr
>STYA 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
2018-12-21 14:32:45 +00:00
.3 lda K.Buf256,y path is "/FILTER/..." ?
cmp #'/'
bne .8
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
lda Flt.Table.hLib,x get hLib
2018-06-21 15:12:10 +00:00
jsr K.GetMemPtr
2018-12-21 14:32:45 +00:00
>STYA .7+1
2016-08-24 15:42:33 +00:00
pla discard JSR return @
pla
2018-11-16 16:04:20 +00:00
>LDYAI K.Buf256 pass full path to handler
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
.6 ldx #$ff SELF MODIFIED SYSCALL #
.7 jmp $ffff SELF MODIFIED
2019-10-10 10:23:02 +00:00
2018-12-21 14:32:45 +00:00
.8 inx
cpx #K.FLT.MAX
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
2016-08-24 15:42:33 +00:00
rts
*--------------------------------------
2018-09-05 15:22:46 +00:00
* PFT.CheckNodeA
2016-09-26 16:00:52 +00:00
* In :
2018-11-16 16:04:20 +00:00
* A = hFILE
2016-09-26 16:00:52 +00:00
* Out :
2016-08-24 15:42:33 +00:00
*--------------------------------------
2018-11-16 16:04:20 +00:00
PFT.CheckNodeA stx .80+1 Save SYSCALL #
sta .81+1 Save hFILE
2018-10-08 05:55:28 +00:00
2018-11-16 16:04:20 +00:00
tax
2019-02-27 15:00:56 +00:00
lda OF.Table.hFD-1,x
2019-02-24 22:11:52 +00:00
beq .9
2019-10-10 10:23:02 +00:00
2018-11-19 21:13:55 +00:00
sta IO.hFD
2019-02-27 15:00:56 +00:00
ldy OF.Table.hPath-1,x if 0, its a hDEV
2019-01-13 13:10:14 +00:00
bne .10
2019-10-10 10:23:02 +00:00
2019-01-13 13:10:14 +00:00
tax
2019-02-27 15:00:56 +00:00
ldy Dev.Table-1,x
lda Dev.Table,x
2019-01-13 13:10:14 +00:00
bra .11
2019-10-10 10:23:02 +00:00
2019-01-13 13:10:14 +00:00
.10 jsr K.GetMemPtr
.11 >STYA pFD
2018-07-20 11:51:08 +00:00
ldy #S.FD.HANDLER
2018-11-16 16:04:20 +00:00
lda (pFD),y
beq .8 Handler is 0, back to kernel....
2018-06-21 15:12:10 +00:00
jsr K.GetMemPtr
>STYA .1+1
pla discard JSR return @
pla
2018-11-16 16:04:20 +00:00
ldx .80+1 restore SYSCALL #
lda .81+1 restore passed hFILE
2018-11-19 07:43:00 +00:00
.1 jmp $ffff SELF MODIFIED
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
.8 lda (pFD) #S.FD.T
bne .80
ldy #S.FD.REG.REF
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
.81 lda #$ff SELF MODIFIED
clc
2016-08-24 15:42:33 +00:00
rts
2019-10-10 10:23:02 +00:00
2019-02-24 22:11:52 +00:00
.9 lda #E.INVH
sec
rts
2016-08-24 15:42:33 +00:00
*--------------------------------------
MAN
2018-11-17 17:17:13 +00:00
SAVE USR/SRC/SYS/KERNEL.S.PFT
LOAD USR/SRC/SYS/KERNEL.S
2016-08-24 15:42:33 +00:00
ASM