mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-08 04:29:37 +00:00
Path Filter:Work In Progress
This commit is contained in:
parent
9222922ed3
commit
5251ba0527
@ -7,9 +7,10 @@ AUTO 6
|
||||
*--------------------------------------
|
||||
* KERNEL CONSTANTS DEFINITON
|
||||
*--------------------------------------
|
||||
K.ENV.SIZE .EQ $100
|
||||
K.ENV.SIZE .EQ 256
|
||||
K.EVT.MAX .EQ 16
|
||||
K.DEV.MAX .EQ 32
|
||||
K.DEV.MAX .EQ 16
|
||||
K.FLT.MAX .EQ 8
|
||||
K.PS.MAX .EQ 64
|
||||
*--------------------------------------
|
||||
* Aux ZP
|
||||
@ -73,14 +74,16 @@ D.STACK.TOP .EQ $03F0 ...Down to $0300
|
||||
*--------------------------------------
|
||||
KrnBuffer256 .EQ $0C00
|
||||
*--------------------------------------
|
||||
*** Z80 Reserved ***
|
||||
*** Z80 Reserved $0F00-10FF***
|
||||
*--------------------------------------
|
||||
Z80STACK .EQ $0FFF (0FFFFh) Down to $0F00
|
||||
Z80JMP .EQ $1000
|
||||
*--------------------------------------
|
||||
EvtMgr.Table .EQ $1100 K.EVT.MAX*S.EVT.SIZE=32*8=256b
|
||||
*--------------------------------------
|
||||
DevMgr.Table .EQ $1200 K.DEV.MAX*S.DEV.SIZE=32*16=512b
|
||||
DevMgr.Table .EQ $1200 K.DEV.MAX*S.DEV.SIZE=16*16=256b
|
||||
*--------------------------------------
|
||||
FltMgr.Table .EQ $1300 K.FLT.MAX*S.FLT.SIZE=8*32=256b
|
||||
*--------------------------------------
|
||||
TskMgr.Table .EQ $1400 K.PS.MAX*S.PS.SIZE=64*16=1k
|
||||
*--------------------------------------
|
||||
@ -277,10 +280,10 @@ SYS.FEOF .EQ $EE
|
||||
|
||||
SYS.REMOVE .EQ $F0
|
||||
SYS.RENAME .EQ $F2
|
||||
SYS.OPENDIR .EQ $F4
|
||||
SYS.READDIR .EQ $F6
|
||||
SYS.OPENDIRYA .EQ $F4
|
||||
SYS.READDIRYA .EQ $F6
|
||||
|
||||
SYS.CLOSEDIR .EQ $F8
|
||||
SYS.CLOSEDIRYA .EQ $F8
|
||||
SYS.MKDIR .EQ $FA
|
||||
SYS.MKNOD .EQ $FC
|
||||
SYS.MKFIFO .EQ $FE
|
||||
@ -482,7 +485,7 @@ S.EVT.DATAW2 .EQ 6
|
||||
*
|
||||
S.EVT .EQ 8
|
||||
*--------------------------------------
|
||||
* S.LISTDIR STRUCT
|
||||
* S.LISTDIR STRUCT (Obsolete)
|
||||
*--------------------------------------
|
||||
S.LISTDIR.hONLINE .EQ 0
|
||||
S.LISTDIR.ONLINEPTR .EQ 1
|
||||
@ -500,5 +503,67 @@ S.LISTDIR.hPATTERN .EQ 15 Pattern for file filtering
|
||||
*
|
||||
S.LISTDIR.SIZE .EQ 16
|
||||
*--------------------------------------
|
||||
* for
|
||||
*--------------------------------------
|
||||
S.STAT.MODE .EQ 0
|
||||
S.STAT.MODE.XO .EQ $0001
|
||||
S.STAT.MODE.WO .EQ $0002
|
||||
S.STAT.MODE.RO .EQ $0004
|
||||
S.STAT.MODE.XG .EQ $0008
|
||||
S.STAT.MODE.WG .EQ $0010
|
||||
S.STAT.MODE.RG .EQ $0020
|
||||
S.STAT.MODE.XU .EQ $0040
|
||||
S.STAT.MODE.WU .EQ $0080
|
||||
S.STAT.MODE.RU .EQ $0100
|
||||
S.STAT.MODE.SST .EQ $0200
|
||||
S.STAT.MODE.SGID .EQ $0400
|
||||
S.STAT.MODE.SUID .EQ $0800
|
||||
S.STAT.DEV .EQ 2
|
||||
S.STAT.UID .EQ 4
|
||||
S.STAT.GID .EQ 6
|
||||
S.STAT.INO .EQ 8
|
||||
S.STAT.NLINK .EQ 16
|
||||
S.STAT.SIZE .EQ 24
|
||||
S.STAT.ATIME .EQ 32 DWORD
|
||||
S.STAT.MTIME .EQ 36 DWORD
|
||||
S.STAT.CTIME .EQ 40 DWORD
|
||||
S.STAT.BLOCKS .EQ 48
|
||||
S.STAT.BLKSIZE .EQ 56
|
||||
*
|
||||
S.STAT .EQ 64
|
||||
*--------------------------------------
|
||||
* S.FILE for FOPEN,FREAD......
|
||||
*--------------------------------------
|
||||
S.FILE.HANDLER .EQ 0 0=KRNL,!0=hDEV,hLIB (LIBNFS,LIBTCPIP.....)
|
||||
S.FILE.TYPE .EQ 1
|
||||
S.FILE.TYPE.REG .EQ 1
|
||||
S.FILE.TYPE.DIR .EQ 2
|
||||
S.FILE.TYPE.BLK .EQ 3
|
||||
S.FILE.TYPE.CHR .EQ 4
|
||||
S.FILE.TYPE.LNK .EQ 5
|
||||
S.FILE.TYPE.SOCK .EQ 6
|
||||
S.FILE.TYPE.FIFO .EQ 7
|
||||
|
||||
S.FILE.DATA .EQ 16 64 byte opaque data (for NFSv3)
|
||||
*
|
||||
* no S.FILE,Variable size
|
||||
*--------------------------------------
|
||||
* S.DIR for OpenDir,ReadDir,CloseDir
|
||||
*--------------------------------------
|
||||
S.DIR.HANDLER .EQ 0
|
||||
S.DIR.INO .EQ 1
|
||||
S.DIR.PATH .EQ 2
|
||||
*
|
||||
* no S.DIR
|
||||
*--------------------------------------
|
||||
* S.DIRENT for ReadDir
|
||||
*--------------------------------------
|
||||
S.DIRENT
|
||||
S.DIRENT.STAT .EQ 0
|
||||
S.DIRENT.NAME .EQ S.STAT
|
||||
S.DIRENT
|
||||
*--------------------------------------
|
||||
S.PFILTER
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE INC/A2OSX.I
|
||||
|
48
SYS/KERNEL.S.DIR.txt
Normal file
48
SYS/KERNEL.S.DIR.txt
Normal file
@ -0,0 +1,48 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.SRC
|
||||
NEW
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
* In :
|
||||
* X = #SYSCall
|
||||
* Y,A = PATH (PSTR)
|
||||
* Out :
|
||||
* CC : Y,A = PTR to S.DIR
|
||||
* CS : A = EC
|
||||
*--------------------------------------
|
||||
S.OPENDIRYA jsr S.PFTCHECKPATHYA
|
||||
* if
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* In :
|
||||
* Y,A = PTR to S.DIR
|
||||
* Out :
|
||||
* CC : Y,A = PTR to S.DIRENT
|
||||
* CS : A = EC
|
||||
*--------------------------------------
|
||||
S.READDIRYA
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.9 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
* In :
|
||||
* Y,A = PTR to S.DIR
|
||||
*--------------------------------------
|
||||
S.CLOSEDIRYA
|
||||
|
||||
rts
|
||||
|
||||
*--------------------------------------
|
||||
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE SYS/KERNEL.S.DIR
|
||||
LOAD SYS/KERNEL.S
|
||||
ASM
|
88
SYS/KERNEL.S.PFT.txt
Normal file
88
SYS/KERNEL.S.PFT.txt
Normal file
@ -0,0 +1,88 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.SRC
|
||||
NEW
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
* In :
|
||||
* Y,A = PATH (PSTR)
|
||||
* Out :
|
||||
* CC :
|
||||
* CS : A = EC
|
||||
*--------------------------------------
|
||||
S.PFTCHECKPATHYA
|
||||
phx save #SYSCALL
|
||||
>STYA ZPQuickPtr1
|
||||
|
||||
>LDYA FltMgr.Table
|
||||
>STYA ZPQuickPtr2
|
||||
|
||||
.1 lda (ZPQuickPtr2) Get Filter Len
|
||||
beq .9 End Of Table, Exit
|
||||
tay
|
||||
lda (ZPQuickPtr1),y is there a "/" at this point in SRC path?
|
||||
cmp #'/'
|
||||
bne .8
|
||||
|
||||
.2 lda (ZPQuickPtr1),y
|
||||
cmp (ZPQuickPtr2),y
|
||||
bne .8
|
||||
dey
|
||||
bne .2
|
||||
|
||||
lda (ZPQuickPtr2) get len again
|
||||
tay
|
||||
iny
|
||||
lda (ZPQuickPtr2),y get hLib
|
||||
jsr S.GetMemPtrA
|
||||
>STYA .3+1
|
||||
|
||||
pla getback #SYSCALL
|
||||
|
||||
pla discard JSR return @
|
||||
pla
|
||||
|
||||
>LDYA ZPQuickPtr1 restore passed params
|
||||
.3 jmp $ffff
|
||||
|
||||
|
||||
.8 lda ZPQuickPtr2
|
||||
clc
|
||||
adc (ZPQuickPtr2) Add STR len
|
||||
adc #2 skip hMem & XOffset
|
||||
sta ZPQuickPtr2
|
||||
bcc .1 always
|
||||
|
||||
|
||||
.9 plx restore X from Stack
|
||||
rts
|
||||
*--------------------------------------
|
||||
* In :
|
||||
* Y,A = PTR to S.DIR
|
||||
* Out :
|
||||
* CC : Y,A = PTR to S.DIRENT
|
||||
* CS : A = EC
|
||||
*--------------------------------------
|
||||
S.PFTCHECKFILEYA
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.9 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
* In :
|
||||
* Y,A = PTR to S.FILE
|
||||
*--------------------------------------
|
||||
S.PFTCHECKDIRYA
|
||||
|
||||
rts
|
||||
|
||||
*--------------------------------------
|
||||
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE SYS/KERNEL.S.PFT
|
||||
LOAD SYS/KERNEL.S
|
||||
ASM
|
Loading…
Reference in New Issue
Block a user