mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-05 16:30:45 +00:00
Kernel 0.9.1 : Code reorganization & move to CSTR : SHELL, bugfix
This commit is contained in:
parent
4f34c436df
commit
e85146e6cc
Binary file not shown.
Binary file not shown.
@ -265,7 +265,7 @@ SYS.CreateProcessYA .EQ $A6
|
||||
* .EQ $AC
|
||||
SYS.GetPSList.YA .EQ $AE
|
||||
|
||||
SYS.GetArgC .EQ $B0
|
||||
*SYS.GetArgC .EQ $B0
|
||||
SYS.GetArg.A .EQ $B2
|
||||
SYS.ExpandStr.YA .EQ $B4
|
||||
* .EQ $B6
|
||||
|
@ -1,6 +1,6 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.BUILD
|
||||
LOMEM $900
|
||||
LOMEM $A00
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
|
@ -272,7 +272,7 @@ Cmd.Exec.PWD ldy #S.PS.hPREFIX
|
||||
|
||||
Cmd.Exec.CD1 lda (ZPPTR2) Get ARG
|
||||
cmp #'/' Full Path?
|
||||
bne .1
|
||||
bne .20
|
||||
|
||||
sta (ZPCMDBuf)
|
||||
|
||||
@ -281,7 +281,7 @@ Cmd.Exec.CD1 lda (ZPPTR2) Get ARG
|
||||
sta (ZPCMDBuf),y
|
||||
bra .1
|
||||
|
||||
ldy #S.PS.hPREFIX no, init target prefix with actual prefix
|
||||
.20 ldy #S.PS.hPREFIX no, init target prefix with actual prefix
|
||||
lda (pPs),y
|
||||
>SYSCALL GetMemPtr.A
|
||||
>PUSHYA
|
||||
@ -289,21 +289,31 @@ Cmd.Exec.CD1 lda (ZPPTR2) Get ARG
|
||||
>SYSCALL StrCpy
|
||||
|
||||
ldy #0
|
||||
|
||||
|
||||
.10 iny
|
||||
lda (ZPCMDBuf),y
|
||||
bne .10 get strlen ...
|
||||
|
||||
.1 ldx #0 dot counter for /./ & /../ detection
|
||||
|
||||
.12 inc ZPPTR2
|
||||
.12 lda (ZPPTR2)
|
||||
bne .21 last char...
|
||||
|
||||
dey
|
||||
lda (ZPCMDBuf),y
|
||||
iny
|
||||
cmp #'/'
|
||||
beq .8
|
||||
lda #'/'
|
||||
sta (ZPCMDBuf),y
|
||||
iny
|
||||
bra .13
|
||||
|
||||
.21 inc ZPPTR2
|
||||
bne .11
|
||||
inc ZPPTR2+1
|
||||
|
||||
.11 lda (ZPPTR2)
|
||||
beq .8 last char...
|
||||
|
||||
sta (ZPCMDBuf),y
|
||||
.11 sta (ZPCMDBuf),y
|
||||
iny
|
||||
cmp #'/'
|
||||
beq .13
|
||||
@ -324,13 +334,12 @@ Cmd.Exec.CD1 lda (ZPPTR2) Get ARG
|
||||
dey remove "./" at the end of path....
|
||||
bra .1
|
||||
|
||||
.14 dey remove "/../" at the end of path : "/dir1/../"
|
||||
dey
|
||||
.14 dey remove "../" at the end of path : "/dir1/../"
|
||||
dey
|
||||
dey
|
||||
beq Cmd.Exec.ERRSYN path was "/../".....error....
|
||||
|
||||
.16 dey
|
||||
.16 dey path is something like : /dir1/, skip ending '/'
|
||||
lda (ZPCMDBuf),y path is something like : /dir1
|
||||
cmp #'/'
|
||||
bne .16
|
||||
@ -344,6 +353,8 @@ Cmd.Exec.CD1 lda (ZPPTR2) Get ARG
|
||||
|
||||
>LDYA ZPCMDBuf
|
||||
>SYSCALL PrintF.YA
|
||||
lda #'!'
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
>LEA.G CMD.Stat
|
||||
>PUSHYA
|
||||
|
@ -4,27 +4,6 @@ LOMEM $A00
|
||||
INC 1
|
||||
AUTO 6
|
||||
*/--------------------------------------
|
||||
* # GetArgC
|
||||
* Returns argument count in the process command line.
|
||||
* ## In:
|
||||
* none.
|
||||
* ## Out:
|
||||
* A = Command line Arg Count (Including /path/cmd)
|
||||
*\--------------------------------------
|
||||
K.GetArgC jsr ARG.InitArgPtr1
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda (ZPPtr1)
|
||||
beq .8
|
||||
|
||||
jsr ARG.NextArgPtr1
|
||||
inx
|
||||
bne .1
|
||||
|
||||
.8 txa
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # GetArg.A
|
||||
* ## In:
|
||||
* A = argument index.
|
||||
|
@ -357,6 +357,7 @@ ENV.ExpandSysVar
|
||||
cmp #'9'+1
|
||||
bcs .1
|
||||
and #$0F
|
||||
>DEBUG
|
||||
jsr K.GetArg.A
|
||||
bcs .99
|
||||
|
||||
|
@ -109,7 +109,7 @@ K.SYSCALL.JMP .DA 0 $00
|
||||
.DA 0
|
||||
.DA K.GetPSList.YA
|
||||
|
||||
.DA K.GetArgC $B0
|
||||
.DA * $B0
|
||||
.DA K.GetArg.A
|
||||
.DA K.ExpandStr.YA
|
||||
.DA 0
|
||||
|
@ -173,6 +173,10 @@ PS.CreateChild ldx #0
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
PS.CmdLine2Args >STYA ZPPtr1
|
||||
>SYSCALL PrintF.YA
|
||||
lda #']'
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 lda (ZPPtr1),y compute strlen in Y,X
|
||||
|
Loading…
Reference in New Issue
Block a user