mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-27 00:29:29 +00:00
Kernel 0.9.1 : Code reorganization & move to CSTR (GETTY,LOGIN)
This commit is contained in:
parent
c55cfbbf0e
commit
4eb13cc475
Binary file not shown.
Binary file not shown.
|
@ -51,7 +51,7 @@ DEV.HEADER cld
|
||||||
jmp (DRV.CS.START,x)
|
jmp (DRV.CS.START,x)
|
||||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||||
.BS 6
|
.BS 6
|
||||||
>PSTR "CON" NAME
|
>CSTR "CON" NAME
|
||||||
.HS 00 NAME must Be 5 bytes long
|
.HS 00 NAME must Be 5 bytes long
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Driver Code
|
* Driver Code
|
||||||
|
|
|
@ -214,7 +214,7 @@ SYS.SPrintF.YA .EQ $5A
|
||||||
SYS.FPrintF.YA .EQ $5C
|
SYS.FPrintF.YA .EQ $5C
|
||||||
* .EQ $5E
|
* .EQ $5E
|
||||||
|
|
||||||
SYS.FileSearch .EQ $60
|
* .EQ $60
|
||||||
SYS.GetFullPath.YA .EQ $62
|
SYS.GetFullPath.YA .EQ $62
|
||||||
SYS.LoadFile .EQ $64
|
SYS.LoadFile .EQ $64
|
||||||
SYS.SaveFile .EQ $66
|
SYS.SaveFile .EQ $66
|
||||||
|
@ -246,7 +246,7 @@ SYS.PTime2Time .EQ $94
|
||||||
SYS.LoadLib.YA .EQ $98
|
SYS.LoadLib.YA .EQ $98
|
||||||
SYS.UnloadLib.A .EQ $9A
|
SYS.UnloadLib.A .EQ $9A
|
||||||
SYS.LoadDrv.YA .EQ $9C
|
SYS.LoadDrv.YA .EQ $9C
|
||||||
* .EQ $9E
|
SYS.FileSearch .EQ $9E
|
||||||
|
|
||||||
SYS.ExecProcessNewEnvYA .EQ $A0
|
SYS.ExecProcessNewEnvYA .EQ $A0
|
||||||
SYS.ExecProcessYA .EQ $A2
|
SYS.ExecProcessYA .EQ $A2
|
||||||
|
|
|
@ -40,17 +40,13 @@ L.MSG.GREETINGS .DA MSG.GREETINGS
|
||||||
L.TERM .DA TERM
|
L.TERM .DA TERM
|
||||||
.DA 0 End Of Reloc Table
|
.DA 0 End Of Reloc Table
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT >SYSCALL GetArgC
|
CS.INIT ldy #S.PS.ARGC
|
||||||
cmp #1
|
lda (pPs),y
|
||||||
bne .1
|
cmp #2
|
||||||
|
bne .9
|
||||||
|
|
||||||
>LDYA L.MSG.USAGE
|
>DEBUG
|
||||||
>SYSCALL PrintF.YA
|
lda #1
|
||||||
lda #0
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
.1 lda #1
|
|
||||||
>SYSCALL GetArg.A
|
>SYSCALL GetArg.A
|
||||||
|
|
||||||
>SYSCALL MkNod.YA
|
>SYSCALL MkNod.YA
|
||||||
|
@ -80,6 +76,12 @@ CS.INIT >SYSCALL GetArgC
|
||||||
sta (pPs)
|
sta (pPs)
|
||||||
|
|
||||||
clc
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
>LDYA L.MSG.USAGE
|
||||||
|
>SYSCALL PrintF.YA
|
||||||
|
lda #0
|
||||||
|
sec
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN jsr Init.Timeout
|
CS.RUN jsr Init.Timeout
|
||||||
|
@ -293,7 +295,7 @@ Wait.TimeOut sec
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.END
|
CS.END
|
||||||
PRINT.DEBUG.CHAR .AS "0123456789ABCDEF"
|
PRINT.DEBUG.CHAR .AS "0123456789ABCDEF"
|
||||||
MSG.USAGE >CSTR "GETTY <DEV> <PROGRAM>\r\n"
|
MSG.USAGE >CSTR "Usage : GETTY <DEV> <PROGRAM>\r\n"
|
||||||
MSG.TELNET.OPT
|
MSG.TELNET.OPT
|
||||||
* .DA #IAC,#WILL,#TELOPT.BINARY
|
* .DA #IAC,#WILL,#TELOPT.BINARY
|
||||||
* .DA #IAC,#DO,#TELOPT.LINEMODE
|
* .DA #IAC,#DO,#TELOPT.LINEMODE
|
||||||
|
|
|
@ -37,8 +37,7 @@ L.MSG.HELP .DA MSG.HELP
|
||||||
L.MSG.LOAD .DA MSG.LOAD
|
L.MSG.LOAD .DA MSG.LOAD
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT >DEBUG
|
CS.INIT ldy #S.PS.ARGC
|
||||||
ldy #S.PS.ARGC
|
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
|
|
||||||
bne .1
|
bne .1
|
||||||
|
|
|
@ -38,7 +38,8 @@ L.MSG.PASSWORD .DA MSG.PASSWORD
|
||||||
L.SHELL .DA SHELL
|
L.SHELL .DA SHELL
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT lda (pPs)
|
CS.INIT >DEBUG
|
||||||
|
lda (pPs)
|
||||||
ora #S.PS.F.EVENT Now accept events
|
ora #S.PS.F.EVENT Now accept events
|
||||||
sta (pPs)
|
sta (pPs)
|
||||||
clc Tell TskMgr To stay in memory
|
clc Tell TskMgr To stay in memory
|
||||||
|
|
|
@ -65,7 +65,10 @@ Cmd.Parse.NextC lda (ZPPtr1)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* ZPCMDBuf-> Command line (formatted & not empty)
|
* ZPCMDBuf-> Command line (formatted & not empty)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec stz bStartProc
|
Cmd.Exec lda #0
|
||||||
|
>STA.G CMD.bStartProc
|
||||||
|
>STA.G CMD.hFullpath
|
||||||
|
>STA.G CMD.hExtCmdLine
|
||||||
>LDYA ZPCMDBuf
|
>LDYA ZPCMDBuf
|
||||||
|
|
||||||
>SYSCALL ExpandStr.YA
|
>SYSCALL ExpandStr.YA
|
||||||
|
@ -74,26 +77,7 @@ Cmd.Exec stz bStartProc
|
||||||
txa
|
txa
|
||||||
>STA.G CMD.hCmdLine
|
>STA.G CMD.hCmdLine
|
||||||
|
|
||||||
Cmd.Exec.2 ldy #$ff CMD Len
|
jsr Cmd.Exec.Split
|
||||||
|
|
||||||
.1 iny
|
|
||||||
lda (ZPPtr1),y Get CMD char...
|
|
||||||
beq .2
|
|
||||||
|
|
||||||
cmp #' ' we reached blank between CMD ARGS
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta (ZPPtr1),y Cut CMD with the ending 0
|
|
||||||
iny
|
|
||||||
|
|
||||||
.2 tya Y=CMD len+0, if ARGS="" Y=
|
|
||||||
clc
|
|
||||||
adc ZPPtr1
|
|
||||||
sta ZPPtr2
|
|
||||||
lda ZPPtr1+1
|
|
||||||
adc #0
|
|
||||||
sta ZPPtr2+1 ZPPtr2->ARGS or CMD ending 0 if empty
|
|
||||||
|
|
||||||
>LDYA L.INTCMDS
|
>LDYA L.INTCMDS
|
||||||
>STYA ZPCMDBuf we use ZPCMDBuf as a temp Ptr
|
>STYA ZPCMDBuf we use ZPCMDBuf as a temp Ptr
|
||||||
|
@ -139,16 +123,47 @@ Cmd.Exec.2 ldy #$ff CMD Len
|
||||||
inc ZPCMDBuf+1
|
inc ZPCMDBuf+1
|
||||||
bra .3
|
bra .3
|
||||||
|
|
||||||
.8 jsr Cmd.Exec.INT Found an internal Cmd...
|
.8 jmp (J.INTCMDS,x) Found an internal Cmd...
|
||||||
|
*--------------------------------------
|
||||||
Cmd.Exec.Done php
|
Cmd.Exec.Done php
|
||||||
pha
|
pha
|
||||||
>LDA.G CMD.hCmdLine
|
>LDA.G CMD.hCmdLine
|
||||||
>SYSCALL FreeMem.A
|
>SYSCALL FreeMem.A
|
||||||
pla
|
|
||||||
|
>LDA.G CMD.hExtCmdLine
|
||||||
|
beq .1
|
||||||
|
>SYSCALL FreeMem.A
|
||||||
|
|
||||||
|
.1 >LDA.G CMD.hFullpath
|
||||||
|
beq .2
|
||||||
|
>SYSCALL FreeMem.A
|
||||||
|
|
||||||
|
.2 pla
|
||||||
plp
|
plp
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
Cmd.Exec.Split ldy #$ff CMD Len
|
||||||
|
|
||||||
|
.1 iny
|
||||||
|
lda (ZPPtr1),y Get CMD char...
|
||||||
|
beq .2
|
||||||
|
|
||||||
|
cmp #' ' we reached blank between CMD ARGS
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta (ZPPtr1),y Cut CMD with the ending 0
|
||||||
|
iny
|
||||||
|
|
||||||
|
.2 tya Y=CMD len+0, if ARGS="" Y=
|
||||||
|
clc
|
||||||
|
adc ZPPtr1
|
||||||
|
sta ZPPtr2
|
||||||
|
lda ZPPtr1+1
|
||||||
|
adc #0
|
||||||
|
sta ZPPtr2+1 ZPPtr2->ARGS or CMD ending 0 if empty
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
* ZPPtr1->CMD
|
* ZPPtr1->CMD
|
||||||
* ZPPtr2->ARGS
|
* ZPPtr2->ARGS
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -157,12 +172,12 @@ Cmd.Exec.EXT >LDYAI 256
|
||||||
bcs .99
|
bcs .99
|
||||||
>STYA ZPCMDBuf
|
>STYA ZPCMDBuf
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta (ZPCMDBuf)
|
|
||||||
|
|
||||||
txa
|
txa
|
||||||
>STA.G CMD.hExtCmdLine
|
>STA.G CMD.hExtCmdLine
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta (ZPCMDBuf)
|
||||||
|
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
cmp #'/' Command line is already full path, no search
|
cmp #'/' Command line is already full path, no search
|
||||||
bne .1
|
bne .1
|
||||||
|
@ -234,9 +249,10 @@ Cmd.Exec.EXT.BIN
|
||||||
>PUSHW ZPCMDBuf
|
>PUSHW ZPCMDBuf
|
||||||
>SYSCALL StrCat
|
>SYSCALL StrCat
|
||||||
|
|
||||||
.1 >LDYA ZPCMDBuf
|
.1 >LDA.G CMD.bStartProc
|
||||||
bit bStartProc
|
asl
|
||||||
bmi .2 startproc
|
>LDYA ZPCMDBuf
|
||||||
|
bcs .2 startproc
|
||||||
|
|
||||||
>SYSCALL ExecProcessNewEnvYA
|
>SYSCALL ExecProcessNewEnvYA
|
||||||
jmp Cmd.Exec.Done
|
jmp Cmd.Exec.Done
|
||||||
|
@ -267,8 +283,6 @@ Cmd.Exec.EXT.SEP
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Internal Commands
|
* Internal Commands
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.INT jmp (J.INTCMDS,x)
|
|
||||||
*--------------------------------------
|
|
||||||
Cmd.Exec.CD lda (ZPPTR2)
|
Cmd.Exec.CD lda (ZPPTR2)
|
||||||
bne Cmd.Exec.CD1
|
bne Cmd.Exec.CD1
|
||||||
|
|
||||||
|
@ -276,7 +290,7 @@ Cmd.Exec.PWD ldy #S.PS.hPREFIX
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
>SYSCALL GetMemPtr.A
|
>SYSCALL GetMemPtr.A
|
||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
|
|
||||||
Cmd.Exec.CD1 stz UsrBuf256
|
Cmd.Exec.CD1 stz UsrBuf256
|
||||||
|
|
||||||
|
@ -380,21 +394,24 @@ Cmd.Exec.CD1 stz UsrBuf256
|
||||||
sta (pPs),y
|
sta (pPs),y
|
||||||
jsr SetPWD
|
jsr SetPWD
|
||||||
clc
|
clc
|
||||||
.9 rts
|
.9 jmp Cmd.Exec.Done
|
||||||
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.ERRSYN lda #SYSMGR.ERRSYN
|
Cmd.Exec.ERRSYN lda #SYSMGR.ERRSYN
|
||||||
sec
|
sec
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.STARTPROC
|
Cmd.Exec.STARTPROC
|
||||||
lda (ZPPTR2)
|
lda (ZPPTR2)
|
||||||
beq Cmd.Exec.ERRSYN
|
beq Cmd.Exec.ERRSYN
|
||||||
sec
|
lda #$ff
|
||||||
ror bStartProc
|
>STA.G CMD.bStartProc
|
||||||
|
|
||||||
>LDYA ZPPTR2
|
>LDYA ZPPTR2
|
||||||
>STYA ZPPTR1
|
>STYA ZPPTR1
|
||||||
jmp Cmd.Exec.2
|
|
||||||
|
jsr Cmd.Exec.Split
|
||||||
|
jmp Cmd.Exec.EXT
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.SET lda (ZPPTR2)
|
Cmd.Exec.SET lda (ZPPTR2)
|
||||||
bne Cmd.Exec.SETVAR
|
bne Cmd.Exec.SETVAR
|
||||||
|
@ -446,7 +463,8 @@ Cmd.Exec.SET lda (ZPPTR2)
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
.9 rts
|
.9 jmp Cmd.Exec.Done
|
||||||
|
|
||||||
|
|
||||||
Cmd.Exec.SETVAR ldy #0
|
Cmd.Exec.SETVAR ldy #0
|
||||||
|
|
||||||
|
@ -467,13 +485,13 @@ Cmd.Exec.SETVAR ldy #0
|
||||||
|
|
||||||
>LDYA ZPPTR2 String is VAR=VALUE...
|
>LDYA ZPPTR2 String is VAR=VALUE...
|
||||||
>SYSCALL PutEnv.YA
|
>SYSCALL PutEnv.YA
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
|
|
||||||
.2 dey String is "VAR=", Remove endig '='
|
.2 dey String is "VAR=", Remove endig '='
|
||||||
sta (ZPPTR2),y
|
sta (ZPPTR2),y
|
||||||
>LDYA ZPPTR2 String is "VAR"...
|
>LDYA ZPPTR2 String is "VAR"...
|
||||||
>SYSCALL UnsetEnv.YA
|
>SYSCALL UnsetEnv.YA
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
|
|
||||||
* Print requested VAR
|
* Print requested VAR
|
||||||
|
|
||||||
|
@ -487,7 +505,7 @@ Cmd.Exec.SETVAR ldy #0
|
||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
.9 rts
|
.9 jmp Cmd.Exec.Done
|
||||||
|
|
||||||
.99 jmp Cmd.Exec.ERRSYN
|
.99 jmp Cmd.Exec.ERRSYN
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -511,7 +529,7 @@ Cmd.Exec.TIME clc
|
||||||
|
|
||||||
>LDYAI UsrBuf256
|
>LDYAI UsrBuf256
|
||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
bcs Cmd.Exec.ECHO.RTS
|
bcs Cmd.Exec.ECHO.END
|
||||||
bra Cmd.Exec.ECHO.CR
|
bra Cmd.Exec.ECHO.CR
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.ECHO lda (ZPPtr2)
|
Cmd.Exec.ECHO lda (ZPPtr2)
|
||||||
|
@ -523,13 +541,13 @@ Cmd.Exec.ECHO lda (ZPPtr2)
|
||||||
Cmd.Exec.ECHO.CR
|
Cmd.Exec.ECHO.CR
|
||||||
lda #13
|
lda #13
|
||||||
>SYSCALL PutChar.A
|
>SYSCALL PutChar.A
|
||||||
bcs Cmd.Exec.ECHO.RTS
|
bcs Cmd.Exec.ECHO.END
|
||||||
|
|
||||||
lda #10
|
lda #10
|
||||||
>SYSCALL PutChar.A
|
>SYSCALL PutChar.A
|
||||||
|
|
||||||
Cmd.Exec.ECHO.RTS
|
Cmd.Exec.ECHO.END
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.READ lda (ZPPtr2)
|
Cmd.Exec.READ lda (ZPPtr2)
|
||||||
beq .9
|
beq .9
|
||||||
|
@ -613,7 +631,7 @@ Cmd.Exec.READ lda (ZPPtr2)
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
clc
|
clc
|
||||||
.99 rts
|
.99 jmp Cmd.Exec.Done
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.SLEEP lda (ZPPtr2)
|
Cmd.Exec.SLEEP lda (ZPPtr2)
|
||||||
beq .9
|
beq .9
|
||||||
|
@ -630,18 +648,18 @@ Cmd.Exec.SLEEP lda (ZPPtr2)
|
||||||
|
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
.9 jmp Cmd.Exec.ERRSYN
|
.9 jmp Cmd.Exec.ERRSYN
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.PAUSE lda #$FF
|
Cmd.Exec.PAUSE lda #$FF
|
||||||
>STA.G bPause
|
>STA.G bPause
|
||||||
clc
|
clc
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Cmd.Exec.EXIT lda #$FF
|
Cmd.Exec.EXIT lda #$FF
|
||||||
>STA.G bExit
|
>STA.G bExit
|
||||||
clc
|
clc
|
||||||
rts
|
jmp Cmd.Exec.Done
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE /A2OSX.SRC/SBIN/SHELL.S.CMD
|
SAVE /A2OSX.SRC/SBIN/SHELL.S.CMD
|
||||||
|
|
|
@ -163,7 +163,7 @@ CSH.Run jsr CSH.GetBuf
|
||||||
>STA.G bCmdBufexec
|
>STA.G bCmdBufexec
|
||||||
|
|
||||||
>LDA.G bEcho
|
>LDA.G bEcho
|
||||||
* beq .80
|
beq .80
|
||||||
|
|
||||||
>PUSHW ZPCMDBuf
|
>PUSHW ZPCMDBuf
|
||||||
>LDYA L.MSG.ECHO
|
>LDYA L.MSG.ECHO
|
||||||
|
|
|
@ -556,7 +556,6 @@ EscChars >PSTR "DBAC"
|
||||||
EscAscii .HS 04080A0B15
|
EscAscii .HS 04080A0B15
|
||||||
TIME .BS S.TIME
|
TIME .BS S.TIME
|
||||||
STAT .BS S.STAT
|
STAT .BS S.STAT
|
||||||
bStartProc .BS 1
|
|
||||||
CSH.TSIZE .HS 0001020405 00,CHAR,INT,LONG,FLOAT....
|
CSH.TSIZE .HS 0001020405 00,CHAR,INT,LONG,FLOAT....
|
||||||
CSH.ACCT .BS 1
|
CSH.ACCT .BS 1
|
||||||
CSH.ACC .BS 5
|
CSH.ACC .BS 5
|
||||||
|
@ -584,6 +583,7 @@ Sleep .BS 4
|
||||||
CMD.hCmdLine .BS 1
|
CMD.hCmdLine .BS 1
|
||||||
CMD.hFullpath .BS 1
|
CMD.hFullpath .BS 1
|
||||||
CMD.hExtCmdLine .BS 1
|
CMD.hExtCmdLine .BS 1
|
||||||
|
CMD.bStartProc .BS 1
|
||||||
CMD.VarName .BS VarLen.MAX+1
|
CMD.VarName .BS VarLen.MAX+1
|
||||||
CMD.Stat .BS S.STAT
|
CMD.Stat .BS S.STAT
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,95 @@ K.LoadDrv.YA jsr BIN.FindDRV
|
||||||
jsr K.FreeMem.A
|
jsr K.FreeMem.A
|
||||||
pla
|
pla
|
||||||
rts
|
rts
|
||||||
|
*/--------------------------------------
|
||||||
|
* # FileSearch
|
||||||
|
* Search a file in the provided PATH list
|
||||||
|
* And return, if found, the full path to it.
|
||||||
|
* ## In:
|
||||||
|
* PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB
|
||||||
|
* PUSHW = Ptr to File Name (CSTR)
|
||||||
|
* PUSHW = Ptr to DstBuf
|
||||||
|
* PUSHW = Ptr to DstStat
|
||||||
|
* ## Out:
|
||||||
|
* CC : success
|
||||||
|
* DstBuf = FilePath
|
||||||
|
* DstStat = S.STAT
|
||||||
|
* CS : not found
|
||||||
|
*\--------------------------------------
|
||||||
|
K.FileSearch >PULLW .4+1 DstStat
|
||||||
|
>PULLW .2+1 DstBuf
|
||||||
|
jsr K.FileSearch.I
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
ldx #$ff
|
||||||
|
|
||||||
|
.1 inx
|
||||||
|
lda K.Buf256,x
|
||||||
|
.2 sta $ffff,x Self Modified
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
ldx #S.STAT-1
|
||||||
|
|
||||||
|
.3 lda K.S.STAT,x
|
||||||
|
.4 sta $ffff,x Self Modified
|
||||||
|
dex
|
||||||
|
bpl .3
|
||||||
|
.9 rts
|
||||||
|
|
||||||
|
K.FileSearch.I >PULLW .4+1 Filename
|
||||||
|
>PULLYA Get Search list
|
||||||
|
jsr K.ExpandStr.YA Expand it
|
||||||
|
bcs .99
|
||||||
|
|
||||||
|
stx .98+1
|
||||||
|
>STYA .2+1 expanded search list ;
|
||||||
|
|
||||||
|
stz .1+1
|
||||||
|
|
||||||
|
.1 ldy #$ff Self Modified Index in Search list string
|
||||||
|
|
||||||
|
ldx #$0
|
||||||
|
|
||||||
|
.2 lda $ffff,y Self Modified, Search list string
|
||||||
|
beq .3 end of string, try it....
|
||||||
|
iny
|
||||||
|
cmp #';'
|
||||||
|
beq .3
|
||||||
|
sta K.Buf256,x
|
||||||
|
inx
|
||||||
|
bra .2
|
||||||
|
|
||||||
|
.3 txa
|
||||||
|
beq .98 String is empty....nothing to try
|
||||||
|
|
||||||
|
sty .1+1 save current index
|
||||||
|
|
||||||
|
ldy #$0
|
||||||
|
|
||||||
|
.4 lda $ffff,y Self Modified, Append Fiename...
|
||||||
|
sta K.Buf256,x
|
||||||
|
beq .5
|
||||||
|
iny
|
||||||
|
inx
|
||||||
|
bra .4
|
||||||
|
|
||||||
|
.5 stz K.Buf256+1,x set string ending 0
|
||||||
|
|
||||||
|
>PUSHWI K.S.STAT
|
||||||
|
>PUSHWI K.Buf256
|
||||||
|
>SYSCALL STAT -> BNK1
|
||||||
|
bcs .1 Failed...retry next path...
|
||||||
|
|
||||||
|
jsr .98 Discard Expanded hSrch list
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.98 lda #$ff SELF MODIFIED : Discard Expanded hSrch list
|
||||||
|
jsr K.FreeMem.A
|
||||||
|
lda #MLI.ERR.FNOTFND
|
||||||
|
sec
|
||||||
|
.99 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
BIN.FindLIB clc
|
BIN.FindLIB clc
|
||||||
.HS B0 bcs
|
.HS B0 bcs
|
||||||
|
@ -123,14 +212,11 @@ BIN.FindDRV sec
|
||||||
bcc .1
|
bcc .1
|
||||||
>LDYAI BIN.Find.ENV.DRV
|
>LDYAI BIN.Find.ENV.DRV
|
||||||
|
|
||||||
.1 >SYSCALL GetEnv.YA get value for Search Path
|
.1 jsr K.GetEnv.YA get value for Search Path
|
||||||
bcs .9
|
bcs .9
|
||||||
|
>PUSHYA
|
||||||
>PUSHYA Push Search path
|
>PUSHW BIN.CmdLine
|
||||||
|
jsr K.FileSearch.I find LIB/DRV in Search
|
||||||
>LDYA BIN.CmdLine
|
|
||||||
|
|
||||||
jsr K.FileSearch.I find libname in Search
|
|
||||||
bcs .9
|
bcs .9
|
||||||
>LDYAI K.Buf256
|
>LDYAI K.Buf256
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ K.GetDevByID.A cmp DevMgr.Count
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # GetDevByName.YA
|
* # GetDevByName.YA
|
||||||
* ## IN:
|
* ## IN:
|
||||||
* Y,A = Ptr to device name (PStr)
|
* Y,A = Ptr to device name (C-String)
|
||||||
* ## OUT:
|
* ## OUT:
|
||||||
* CC = OK, CS = ERROR
|
* CC = OK, CS = ERROR
|
||||||
* X = DEVID
|
* X = DEVID
|
||||||
|
@ -44,18 +44,12 @@ K.GetDevByName.YA
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 lda (ZPPtr2)
|
.1 ldy #$ff
|
||||||
cmp (ZPPtr1)
|
|
||||||
bne .3
|
|
||||||
|
|
||||||
tay
|
.2 iny
|
||||||
|
lda (ZPPtr1),y
|
||||||
.2 lda (ZPPtr1),y
|
ora (ZPPtr2),y
|
||||||
cmp (ZPPtr2),y
|
bne .3 Both char are 0, match!
|
||||||
bne .3
|
|
||||||
|
|
||||||
dey
|
|
||||||
bne .2
|
|
||||||
|
|
||||||
lda ZPPtr2
|
lda ZPPtr2
|
||||||
sec
|
sec
|
||||||
|
@ -66,7 +60,11 @@ K.GetDevByName.YA
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.3 lda ZPPtr2
|
.3 lda (ZPPtr1),y
|
||||||
|
cmp (ZPPtr2),y
|
||||||
|
beq .2
|
||||||
|
|
||||||
|
lda ZPPtr2
|
||||||
clc
|
clc
|
||||||
adc #S.DEV
|
adc #S.DEV
|
||||||
sta ZPPtr2
|
sta ZPPtr2
|
||||||
|
|
|
@ -484,7 +484,6 @@ ENV.SysVarsExit2
|
||||||
* ZPPtr3 -> PTR to Ending 0
|
* ZPPtr3 -> PTR to Ending 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
ENV.FindVarPtr1 jsr ENV.InitEnvPtr3 Store ENV
|
ENV.FindVarPtr1 jsr ENV.InitEnvPtr3 Store ENV
|
||||||
bcs .99
|
|
||||||
|
|
||||||
.1 lda (ZPPtr3)
|
.1 lda (ZPPtr3)
|
||||||
beq .9 end of ENV
|
beq .9 end of ENV
|
||||||
|
@ -509,7 +508,7 @@ ENV.FindVarPtr1 jsr ENV.InitEnvPtr3 Store ENV
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.9 sec
|
.9 sec
|
||||||
.99 rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* ENV.DiscardVarPtr3
|
* ENV.DiscardVarPtr3
|
||||||
* In:
|
* In:
|
||||||
|
@ -548,7 +547,7 @@ ENV.DiscardVarPtr3
|
||||||
ENV.InitEnvPtr3 ldy #S.PS.hENV
|
ENV.InitEnvPtr3 ldy #S.PS.hENV
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
jsr K.GetMemPtr.A
|
jsr K.GetMemPtr.A
|
||||||
>STYA ZPPtr3 Store ENV
|
>STYA ZPPtr3 Store ENV
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
ENV.NextEnvPtr3 ldy #0
|
ENV.NextEnvPtr3 ldy #0
|
||||||
|
|
|
@ -4,95 +4,6 @@ LOMEM $A00
|
||||||
INC 1
|
INC 1
|
||||||
AUTO 6
|
AUTO 6
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # FileSearch
|
|
||||||
* Search a file in the provided PATH list
|
|
||||||
* And return, if found, the full path to it.
|
|
||||||
* ## In:
|
|
||||||
* PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB
|
|
||||||
* PUSHW = Ptr to File Name (CSTR)
|
|
||||||
* PUSHW = Ptr to DstBuf
|
|
||||||
* PUSHW = Ptr to DstStat
|
|
||||||
* ## Out:
|
|
||||||
* CC : success
|
|
||||||
* DstBuf = FilePath
|
|
||||||
* DstStat = S.STAT
|
|
||||||
* CS : not found
|
|
||||||
*\--------------------------------------
|
|
||||||
K.FileSearch >PULLW .4+1 DstStat
|
|
||||||
>PULLW .2+1 DstBuf
|
|
||||||
jsr K.FileSearch.I
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
ldx #$ff
|
|
||||||
|
|
||||||
.1 inx
|
|
||||||
lda K.Buf256,x
|
|
||||||
.2 sta $ffff,x Self Modified
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
ldx #S.STAT-1
|
|
||||||
|
|
||||||
.3 lda K.S.STAT,x
|
|
||||||
.4 sta $ffff,x Self Modified
|
|
||||||
dex
|
|
||||||
bpl .3
|
|
||||||
.9 rts
|
|
||||||
|
|
||||||
K.FileSearch.I >PULLW .4+1
|
|
||||||
>PULLYA Get Search list
|
|
||||||
>SYSCALL ExpandStr.YA Expand it (SYSCALL to BNK2)
|
|
||||||
bcs .99
|
|
||||||
|
|
||||||
stx .98+1
|
|
||||||
>STYA .2+1 expanded search list ;
|
|
||||||
|
|
||||||
stz .1+1
|
|
||||||
|
|
||||||
.1 ldy #$ff Self Modified Index in Search list string
|
|
||||||
|
|
||||||
ldx #$0
|
|
||||||
|
|
||||||
.2 lda $ffff,y Self Modified, Search list string
|
|
||||||
beq .3 end of string, try it....
|
|
||||||
iny
|
|
||||||
cmp #';'
|
|
||||||
beq .3
|
|
||||||
sta K.Buf256,x
|
|
||||||
inx
|
|
||||||
bra .2
|
|
||||||
|
|
||||||
.3 txa
|
|
||||||
beq .98 String is empty....nothing to try
|
|
||||||
|
|
||||||
sty .1+1 save current index
|
|
||||||
|
|
||||||
ldy #$0
|
|
||||||
|
|
||||||
.4 lda $ffff,y Self Modified, Append Fiename...
|
|
||||||
sta K.Buf256,x
|
|
||||||
beq .5
|
|
||||||
iny
|
|
||||||
inx
|
|
||||||
bra .4
|
|
||||||
|
|
||||||
.5 stz K.Buf256+1,x set string ending 0
|
|
||||||
|
|
||||||
>PUSHWI K.S.STAT
|
|
||||||
>PUSHWI K.Buf256
|
|
||||||
jsr K.STAT
|
|
||||||
bcs .1 Failed...retry next path...
|
|
||||||
|
|
||||||
jsr .98 Discard Expanded hSrch list
|
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
.98 lda #$ff SELF MODIFIED : Discard Expanded hSrch list
|
|
||||||
jsr K.FreeMem.A
|
|
||||||
lda #MLI.ERR.FNOTFND
|
|
||||||
sec
|
|
||||||
.99 rts
|
|
||||||
*/--------------------------------------
|
|
||||||
* # GetFullPath.YA
|
* # GetFullPath.YA
|
||||||
* ## In :
|
* ## In :
|
||||||
* Y,A = Filename (C-String)
|
* Y,A = Filename (C-String)
|
||||||
|
|
|
@ -434,14 +434,14 @@ DevMgr.NUL cld
|
||||||
jmp (DevMgr.NUL.Code,x)
|
jmp (DevMgr.NUL.Code,x)
|
||||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.OPENED
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.OPENED
|
||||||
.BS 6
|
.BS 6
|
||||||
>PSTR "NUL" NAME
|
>CSTR "NUL" NAME
|
||||||
.HS 00 NAME must Be 4 bytes long
|
.HS 00 NAME must Be 4 bytes long
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DevMgr.SYS cld
|
DevMgr.SYS cld
|
||||||
jmp (DevMgr.SYS.Code,x)
|
jmp (DevMgr.SYS.Code,x)
|
||||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||||
.BS 6
|
.BS 6
|
||||||
>PSTR "SYS" NAME
|
>CSTR "SYS" NAME
|
||||||
.HS 00 NAME must Be 4 bytes long
|
.HS 00 NAME must Be 4 bytes long
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Setup AuxLC $FFFE->Kernel IRQ Handler
|
* Setup AuxLC $FFFE->Kernel IRQ Handler
|
||||||
|
@ -856,7 +856,7 @@ MSG.KCREAD >CSTR "Reading Kernel Config File..."
|
||||||
MSG.KCREAD.OK >CSTR "OK\n"
|
MSG.KCREAD.OK >CSTR "OK\n"
|
||||||
MSG.KCREAD.KO >CSTR "\nError While Reading Kernel Config File, Using Default.\n"
|
MSG.KCREAD.KO >CSTR "\nError While Reading Kernel Config File, Using Default.\n"
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DEV.SYS >PSTR "SYS"
|
DEV.SYS >CSTR "SYS"
|
||||||
I.ENV.A2osX >CSTR "A2OSX"
|
I.ENV.A2osX >CSTR "A2OSX"
|
||||||
I.ENV.PATH >CSTR "PATH=${A2OSX}SBIN/;${A2OSX}BIN/"
|
I.ENV.PATH >CSTR "PATH=${A2OSX}SBIN/;${A2OSX}BIN/"
|
||||||
I.ENV.LIB >CSTR "LIB=${A2OSX}LIB/"
|
I.ENV.LIB >CSTR "LIB=${A2OSX}LIB/"
|
||||||
|
|
|
@ -62,7 +62,7 @@ K.SYSCALL.JMP .DA 0 $00
|
||||||
.DA K.FPrintF.YA
|
.DA K.FPrintF.YA
|
||||||
.DA 0
|
.DA 0
|
||||||
|
|
||||||
.DA K.FileSearch $60
|
.DA 0 $60
|
||||||
.DA K.GetFullPath.YA
|
.DA K.GetFullPath.YA
|
||||||
.DA K.LoadFile
|
.DA K.LoadFile
|
||||||
.DA K.SaveFile
|
.DA K.SaveFile
|
||||||
|
@ -98,7 +98,7 @@ K.SYSCALL.JMP .DA 0 $00
|
||||||
.DA K.LoadLib.YA
|
.DA K.LoadLib.YA
|
||||||
.DA K.UnloadLib.A
|
.DA K.UnloadLib.A
|
||||||
.DA K.LoadDrv.YA
|
.DA K.LoadDrv.YA
|
||||||
.DA 0
|
.DA K.FileSearch
|
||||||
|
|
||||||
.DA K.ExecProcessNewEnv.YA $A0
|
.DA K.ExecProcessNewEnv.YA $A0
|
||||||
.DA K.ExecProcess.YA
|
.DA K.ExecProcess.YA
|
||||||
|
|
|
@ -328,18 +328,29 @@ PS.Init jsr BIN.Load.YA Y,A=filename full path
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PS.DupEnv.A jsr K.GetMemPtr.A
|
PS.DupEnv.A jsr K.GetMemPtr.A
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
>LDYAI K.ENV.SIZE
|
>LDYAI K.ENV.SIZE
|
||||||
jsr K.GetMem.YA
|
jsr K.GetMem.YA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>STYA ZPPtr2
|
>STYA ZPPtr2
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
.1 lda (ZPPtr1),y
|
.1 lda (ZPPtr1),y
|
||||||
sta (ZPPtr2),y
|
sta (ZPPtr2),y
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
iny
|
.2 iny
|
||||||
|
bne .3
|
||||||
|
inc ZPPtr1+1
|
||||||
|
inc ZPPtr2+1
|
||||||
|
|
||||||
|
.3 lda (ZPPtr1),y
|
||||||
|
sta (ZPPtr2),y
|
||||||
|
bne .2
|
||||||
|
|
||||||
|
iny
|
||||||
bne .1
|
bne .1
|
||||||
inc ZPPtr1+1
|
inc ZPPtr1+1
|
||||||
inc ZPPtr2+1
|
inc ZPPtr2+1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user