mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-10 09:30:40 +00:00
Kernel 0.9.1 : KERNEL API reorg
This commit is contained in:
parent
399bdc0cae
commit
703779cec0
Binary file not shown.
Binary file not shown.
@ -22,7 +22,7 @@ K.OpenDir.YA jsr PFT.CheckPathYA
|
||||
bcs .99
|
||||
|
||||
>STYA ZPPtr1
|
||||
stx K.ReadDir.A.hDir
|
||||
stx .8+1
|
||||
|
||||
ldy #1
|
||||
lda (ZPPtr2),y One char ?
|
||||
@ -45,12 +45,12 @@ K.OpenDir.YA jsr PFT.CheckPathYA
|
||||
ldy #S.NODE.DIR.REF
|
||||
sta (ZPPtr1),y
|
||||
|
||||
.8 lda K.ReadDir.A.hDir
|
||||
.8 lda #$ff Self Modified
|
||||
clc
|
||||
rts
|
||||
|
||||
.98 pha save MLI error
|
||||
lda K.ReadDir.A.hDir
|
||||
lda .8+1
|
||||
jsr K.CloseDir.A.1
|
||||
pla get back MLI error
|
||||
sec
|
||||
@ -69,7 +69,6 @@ K.OpenDir.YA jsr PFT.CheckPathYA
|
||||
*\--------------------------------------
|
||||
K.ReadDir.A.hDir .BS 1
|
||||
K.ReadDir.A.hMem .BS 1
|
||||
K.ReadDir.A.hDIRENT .BS 1
|
||||
K.ReadDir.A.BufSize .BS 2
|
||||
K.ReadDir.A.ECIB .BS 1
|
||||
*--S.DIR Cache ------------------------
|
||||
@ -207,10 +206,8 @@ K.ReadDir.A.ROOT
|
||||
ldy #S.NODE.DIR.FC
|
||||
lda #16
|
||||
sta (ZPPtr1),y Flag that we returned somthing for next time
|
||||
|
||||
lda K.ReadDir.A.hDIRENT
|
||||
tax
|
||||
jmp K.GetMemPtr.A
|
||||
|
||||
jmp K.ReadDir.A.EXIT
|
||||
*--------------------------------------
|
||||
K.ReadDir.A.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
|
||||
|
||||
@ -396,16 +393,16 @@ K.ReadDir.A.DIR2 jsr K.ReadDir.A.GetBuf
|
||||
|
||||
.8
|
||||
* lda #0 S.MEM.F.INIT0 already did this
|
||||
* sta (ZPPtr4) Ending 0
|
||||
* sta (ZPPtr4) Ending 0
|
||||
|
||||
lda K.ReadDir.A.hDir Restore ZPPtr1 trashed by STR API calls
|
||||
lda K.ReadDir.A.hDir Restore ZPPtr1 trashed by STR API calls
|
||||
jsr K.GetMemPtr.A
|
||||
>STYA ZPPtr1
|
||||
|
||||
ldx #3
|
||||
ldy #S.NODE.DIR.EL+3
|
||||
|
||||
.81 lda K.ReadDir.A.EL,x Store back this session prameters to S.DIR
|
||||
.81 lda K.ReadDir.A.EL,x Store back this session prameters to S.DIR
|
||||
sta (ZPPtr1),y
|
||||
dey
|
||||
dex
|
||||
@ -413,8 +410,9 @@ K.ReadDir.A.DIR2 jsr K.ReadDir.A.GetBuf
|
||||
|
||||
jsr K.ReadDir.A.CLN Discard READBUFFER
|
||||
|
||||
lda K.ReadDir.A.hDIRENT
|
||||
tax
|
||||
K.ReadDir.A.EXIT
|
||||
ldx #$ff Self Modified : hDIRENT
|
||||
txa
|
||||
jmp K.GetMemPtr.A
|
||||
*--------------------------------------
|
||||
K.ReadDir.A.CLN pha
|
||||
@ -427,7 +425,7 @@ K.ReadDir.A.GetBuf
|
||||
>LDYA K.ReadDir.A.BufSize Get a BufSize bytes buffer for storing results
|
||||
jsr K.GetMem0.YA make sure 0 filled
|
||||
bcs .9
|
||||
stx K.ReadDir.A.hDIRENT
|
||||
stx K.ReadDir.A.EXIT+1
|
||||
>STYA ZPPtr4
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
|
@ -16,7 +16,7 @@ AUTO 6
|
||||
K.GetFullPath.YA
|
||||
>STYA ZPPtr1
|
||||
|
||||
ldx #0
|
||||
ldx #$ff
|
||||
|
||||
lda (ZPPtr1)
|
||||
beq .10
|
||||
@ -29,26 +29,25 @@ K.GetFullPath.YA
|
||||
jsr K.GetMemPtr.A
|
||||
>STYA ZPPtr2
|
||||
|
||||
ldy #0
|
||||
ldy #$ff
|
||||
|
||||
.1 lda (ZPPtr2),y
|
||||
beq .2
|
||||
sta K.Buf256,x
|
||||
iny
|
||||
.1 iny
|
||||
inx
|
||||
lda (ZPPtr2),y
|
||||
sta K.Buf256,x
|
||||
bne .1
|
||||
|
||||
.2 ldy #0
|
||||
dex
|
||||
|
||||
.2 ldy #$ff
|
||||
|
||||
.3 lda (ZPPtr1),y
|
||||
beq .8
|
||||
sta K.Buf256,x
|
||||
iny
|
||||
.3 iny
|
||||
inx
|
||||
lda (ZPPtr1),y
|
||||
sta K.Buf256,x
|
||||
bne .3
|
||||
|
||||
.8 stz K.Buf256,x
|
||||
>LDYAI K.Buf256
|
||||
.8 >LDYAI K.Buf256
|
||||
jmp K.NewStr.YA
|
||||
*/--------------------------------------
|
||||
* # LoadFile
|
||||
@ -81,7 +80,7 @@ K.LoadFile lda (pStack) read PTR.LO on top of stack
|
||||
jsr K.GetMem.YA
|
||||
bcs .10
|
||||
>STYA K.LoadFile.Mem
|
||||
stx K.LoadFile.hMem
|
||||
stx .8+1
|
||||
|
||||
jsr K.FOpen
|
||||
bcs .9
|
||||
@ -100,7 +99,7 @@ K.LoadFile lda (pStack) read PTR.LO on top of stack
|
||||
|
||||
pla
|
||||
ply
|
||||
ldx K.LoadFile.hMem
|
||||
.8 ldx #$ff Self Modified
|
||||
clc
|
||||
.9 rts
|
||||
|
||||
@ -112,7 +111,7 @@ K.LoadFile lda (pStack) read PTR.LO on top of stack
|
||||
rts
|
||||
|
||||
.97 pha
|
||||
lda K.LoadFile.hMem
|
||||
lda .8+1
|
||||
jsr K.FreeMem.A
|
||||
pla
|
||||
|
||||
@ -124,7 +123,6 @@ K.LoadFile lda (pStack) read PTR.LO on top of stack
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.LoadFile.hFile .BS 1
|
||||
K.LoadFile.hMem .BS 1
|
||||
K.LoadFile.Mem .BS 2
|
||||
*/--------------------------------------
|
||||
* # SaveFile
|
||||
@ -184,8 +182,6 @@ K.ChTyp jsr PFT.CheckPathSTK
|
||||
* PUSHW = PATH
|
||||
*\--------------------------------------
|
||||
K.ChMod
|
||||
sec
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # ChOwn
|
||||
* ## In:
|
||||
@ -193,8 +189,6 @@ K.ChMod
|
||||
* PUSHW = PATH
|
||||
*\--------------------------------------
|
||||
K.ChOwn
|
||||
sec
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # ChGrp
|
||||
* ## In:
|
||||
|
@ -397,6 +397,19 @@ PullPtr1Ptr2 clc
|
||||
>PULLW ZPPtr3
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
K.DEBUG >SYSCALL PrintF.YA
|
||||
lda #'@'
|
||||
>SYSCALL PutChar.A
|
||||
lda #13
|
||||
>SYSCALL PutChar.A
|
||||
lda #10
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
>DEBUG
|
||||
rts
|
||||
*--------------------------------------
|
||||
|
||||
|
||||
MAN
|
||||
SAVE /A2OSX.SRC/SYS/KERNEL.S.JMP
|
||||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||||
|
@ -230,11 +230,12 @@ K.RealPath.YA >STYA ZPPtr1
|
||||
ldy #$ff
|
||||
|
||||
.1 iny
|
||||
lda (ZPPtr2),y
|
||||
beq .2
|
||||
inx
|
||||
lda (ZPPtr2),y
|
||||
sta K.Buf256,x
|
||||
bra .1
|
||||
bne .1
|
||||
|
||||
dex
|
||||
|
||||
.2 ldy #$ff
|
||||
|
||||
@ -243,10 +244,11 @@ K.RealPath.YA >STYA ZPPtr1
|
||||
lda (ZPPtr1),y
|
||||
sta K.Buf256,x
|
||||
bne .3 X=LEN, K.Buf256 = /dir1..../file(/) /x0
|
||||
*\--------------------------------------
|
||||
*--------------------------------------
|
||||
.4 dex
|
||||
beq .89 we have '/'....nothing to do...
|
||||
lda K.Buf256,x
|
||||
|
||||
lda K.Buf256,x Skip any / at the end of string....
|
||||
cmp #'/'
|
||||
bne .5
|
||||
|
||||
@ -257,28 +259,40 @@ K.RealPath.YA >STYA ZPPtr1
|
||||
.6 lda K.Buf256,x
|
||||
cmp #'/'
|
||||
beq .8
|
||||
|
||||
cmp #'.'
|
||||
bne .7
|
||||
|
||||
iny
|
||||
.HS 2C BIT ABS
|
||||
ldy #0
|
||||
.HS 2C BIT ABS, skip "LDY #0"
|
||||
.7 ldy #0 not a dot....reset dot counter
|
||||
|
||||
bra .80 always, should end with a '/'
|
||||
|
||||
.7 dex
|
||||
bra .6 always, should end with a '/'
|
||||
|
||||
.8 dey we found "/." ?
|
||||
bmi .80
|
||||
bne .9
|
||||
.8 tya
|
||||
beq .80 Y was 0....nothing to do...
|
||||
dey "/." ?
|
||||
bne .9 no..
|
||||
|
||||
jsr K.RealPath.RemoveAtX we found "/.", remove,useless....
|
||||
|
||||
bra .80
|
||||
|
||||
.9 dey we found "/.." ?
|
||||
bne .90 "/......" ...mmm...syntax error
|
||||
|
||||
|
||||
.9 dey "/.." ?
|
||||
bne .90 "/..." ??!!...mmm...syntax error
|
||||
|
||||
txa we found "/.."
|
||||
beq .90 at the beginning of string...cannot remove /dir/..
|
||||
|
||||
jsr K.RealPath.RemoveAtX remove "/.."
|
||||
|
||||
dex skip actual "/"
|
||||
|
||||
.11 lda K.Buf256,x go to "/dir"
|
||||
cmp #'/'
|
||||
bne .11
|
||||
|
||||
jsr K.RealPath.RemoveAtX ...remove "/dir"
|
||||
|
||||
.80 txa
|
||||
beq .89
|
||||
@ -286,16 +300,8 @@ K.RealPath.YA >STYA ZPPtr1
|
||||
bra .5
|
||||
|
||||
.89 >LDYAI K.Buf256
|
||||
>SYSCALL PrintF.YA
|
||||
lda #'@'
|
||||
>SYSCALL PutChar.A
|
||||
lda #13
|
||||
>SYSCALL PutChar.A
|
||||
lda #10
|
||||
>SYSCALL PutChar.A
|
||||
jsr K.DEBUG
|
||||
|
||||
>DEBUG
|
||||
|
||||
>LDYAI K.Buf256
|
||||
jmp K.NewStr.YA
|
||||
|
||||
@ -303,6 +309,28 @@ K.RealPath.YA >STYA ZPPtr1
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.RealPath.RemoveAtX
|
||||
txa X = "/something"
|
||||
tay
|
||||
|
||||
.1 iny
|
||||
lda K.Buf256,y
|
||||
beq .2
|
||||
cmp #'/'
|
||||
bne .1
|
||||
|
||||
.2 phx
|
||||
|
||||
.3 lda K.Buf256,y
|
||||
sta K.Buf256,x
|
||||
beq .8
|
||||
iny
|
||||
inx
|
||||
bne .3
|
||||
|
||||
.8 plx
|
||||
rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.SRC/SYS/KERNEL.S.STDLIB
|
||||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||||
|
Loading…
x
Reference in New Issue
Block a user