Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-03-13 17:10:36 +01:00
parent b6fe126b0b
commit b9c8617882
13 changed files with 100 additions and 149 deletions

Binary file not shown.

View File

@ -55,28 +55,27 @@ CS.RUN ldy #S.PS.PID
cmp #1
bne .9
* ldy #S.PS.hStdIn
* lda (pPS),y
* >SYSCALL feof
* bcs .99
* tay
* bne .1
ldy #S.PS.hStdIn
lda (pPS),y
>SYSCALL feof
bcs .99
tay
bne .1
* >SYSCALL getchar
* bcs .99
>SYSCALL getchar
bcs .99
* cmp #18 CTRL-R for Root mode
* bne .1
cmp #18 CTRL-R for Root mode
bne .1
>LDYA L.MSG.CTRLR
>SYSCALL PutS
>LDYA L.BINSH
jsr CS.RUN.EXEC.YA
>LDYA L.BINPS
jsr CS.RUN.EXEC.YA
>SLEEP
.1 jsr CS.RUN.ETCINIT
bcs .99
@ -153,7 +152,7 @@ CS.RUN.ETCINIT >LDYAI 256
rts
*--------------------------------------
CS.RUN.EXEC.YA >PUSHYA
>PUSHBI S.PS.F.HOLD+S.PS.F.SLEEP+S.PS.F.NOHUP
>PUSHBI S.PS.F.HOLD
>SYSCALL ExecL
rts
*--------------------------------------
@ -165,7 +164,7 @@ CS.QUIT clc
*--------------------------------------
CS.END
*--------------------------------------
MSG.CTRLR .AZ "INITD:Ctrl-R Pressed, entering ROOT mode..."
MSG.CTRLR .AZ "INITD:Entering ROOT mode..."
BINSH .AZ "${ROOT}bin/sh"
ETCINIT .AZ "${ROOT}etc/init"
BINMEM .AZ "${ROOT}bin/mem"

View File

@ -146,31 +146,32 @@ CS.RUN.AUTH lda #3
*--------------------------------------
CS.RUN.EXEC ldx #1
.1 lda S.Table.hSID-1,x
beq .2
*.1 lda S.Table.hSID-1,x
* beq .2
inx
cpx #K.USR.MAX+1
bne .1
* inx
* cpx #K.USR.MAX+1
* bne .1
lda #E.OOH
* sec
rts
* lda #E.OOH
** sec
* rts
.2 stx ZPNewSession
ldy #S.PS.hSession
lda (pPS),y
sta ZPOldSession
.2
* stx ZPNewSession
* ldy #S.PS.hSession
* lda (pPS),y
* sta ZPOldSession
txa
sta (pPS),y
* txa
* sta (pPS),y
lda ZPNewSID
sta S.Table.hSID-1,x
* lda ZPNewSID
* sta S.Table.hSID-1,x
ldy #S.PS.hStdIn
lda (pPS),y
sta S.Table.hFILE-1,x
* ldy #S.PS.hStdIn
* lda (pPS),y
* sta S.Table.hFILE-1,x
>LDYA L.ETCMOTD
jsr CS.RUN.DumpFile
@ -183,22 +184,22 @@ CS.RUN.EXEC ldx #1
>SLEEP
lda ZPOldSID
beq .8
* lda ZPOldSID
* beq .8
>SYSCALL CloseSession
* >SYSCALL CloseSession
stz ZPOldSID
* stz ZPOldSID
.8 ldx ZPNewSession
lda S.Table.hSID-1,x
stz S.Table.hSID-1,x
stz S.Table.hFILE-1,x
*.8 ldx ZPNewSession
* lda S.Table.hSID-1,x
* stz S.Table.hSID-1,x
* stz S.Table.hFILE-1,x
* >SYSCALL FreeMem
ldy #S.PS.hSession
lda ZPOldSession
sta (pPS),y
* ldy #S.PS.hSession
* lda ZPOldSession
* sta (pPS),y
sec
.9 rts

View File

@ -6,7 +6,6 @@ NEW
* ## C / CSH
* `int setenv(const char *name, const char *value);`
* ## ASM
* **In:**
* `>PUSHW name`
* `>PUSHW value`
* `>SYSCALL setenv`
@ -27,7 +26,6 @@ K.SetEnv
* ## C / CSH
* `char *getenv(const char *name, char *value);`
* ## ASM
* **In:**
* `>PUSHW name`
* `>PUSHW value`
* `>SYSCALL getenv`
@ -36,12 +34,6 @@ K.SetEnv
* CS : not found
*\--------------------------------------
K.GetEnv >PULLW FORPNT value
* >PULLW TXTPTR name
*
* ldy #S.PS.hENV
* lda (pPS),y
* jmp K.SYSCALL.JMPX
*/--------------------------------------
* # PutEnv
* Change or add an environment variable, string is 'NAME=VALUE'
@ -53,31 +45,31 @@ K.GetEnv >PULLW FORPNT value
* `>SYSCALL putenv`
* ## RETURN VALUE
*\--------------------------------------
K.PutEnv >PULLW TXTPTR NAME=VALUE
K.PutEnv
* >PULLW TXTPTR name=value
*/--------------------------------------
* # UnsetEnv
* Remove an environment variable
* ## C / CSH
* `int unsetenv(const char *name);`
* ## ASM
* **In:**
* `>PUSHW name`
* `>SYSCALL unsetenv`
* ## RETURN VALUE
*\--------------------------------------
K.UnsetEnv
* >PULLW TXTPTR name
K.UnsetEnv >PULLW TXTPTR name
ldy #S.PS.hENV
K.GetEnv.I ldy #S.PS.hENV FROM STDLIB:EXPAND
lda (pPS),y
pha
ldy #S.PS.hSession
lda (pPS),y
tay
lda S.Table.hSID-1,y
tay
pla
jmp K.SYSCALL.JMPX

View File

@ -30,6 +30,7 @@ ENVX.PutEnv tax save hEnv
sta FORPNT+1
txa get back hEnv
ldy ENVX.hSID
*--------------------------------------
ENVX.SetEnv jsr ENVX.UnsetEnv
@ -117,9 +118,9 @@ ENVX.SetEnv jsr ENVX.UnsetEnv
.9 rts
*--------------------------------------
ENVX.GetEnv sty ENVX.hSID
sta ENVX.hEnv
ENVX.GetEnv sta ENVX.hEnv
sty ENVX.hSID
ldy TXTPTR+1
bne .10
@ -327,7 +328,7 @@ ENVX.SIDVarsGID ldx #S.SESSION.GID
jsr MATH.A2STR10NP
>LDYA A2osX.NumStrBuf
>LDYAI A2osX.NumStrBuf
clc
rts
@ -361,7 +362,7 @@ ENVX.InitEnvP3 lda ENVX.hEnv
bra ENVX.InitP3
*--------------------------------------
ENVX.InitSIDP3 lda ENVX.hSID
>DEBUG
ENVX.InitP3 jsr K.GetMemPtr
>STYA ZPPtr3
rts

View File

@ -1008,6 +1008,21 @@ TskMgrInit >LDYAI MSG.TSK
sta CLRWRITEAUX
>PUSHWI 0
>PUSHWI 0
>SYSCALL OpenSession
bcs .99
sta S.Table.hSID
ldy #S.PS.hStdIn
lda (pPS),y
sta S.Table.hFile
lda #1
ldy #S.PS.hSession
sta (pPS),y
>LDYAI $2E0 Get ROOT from QC
>SYSCALL2 strdup
bcs .9
@ -1019,7 +1034,7 @@ TskMgrInit >LDYAI MSG.TSK
>PUSHWI I.ENV.BOOT
>PUSHWI $2C0 Get BOOT from QC
>SYSCALL2 SetEnv
bcs .9
.99 bcs .9
>PUSHWI I.ENV.ROOT
>PUSHWI $2E0 Get ROOT from QC
@ -1055,21 +1070,7 @@ PwdMgrInit >LDYAI MSG.PWD
stx PWD.hGrpDB
>STYA PWD.GrpDBSize
.1 >PUSHWI 0
>PUSHWI 0
>SYSCALL OpenSession
bcs .9
sta S.Table.hSID
ldy #S.PS.hStdIn
lda (pPS),y
sta S.Table.hFile
lda #1
ldy #S.PS.hSession
sta (pPS),y
.1
* clc
.9 rts
*--------------------------------------
@ -1121,9 +1122,7 @@ MSG.KCREAD.KO .AZ "\nError While Reading Kernel Config File, Using Default.\n"
MSG.PRODOSFX .AZ "!!!Running under ProDOS.FX!!! Enabling lowercase mode.\n"
MSG.Init2.OK .AZ "A2osX[Stage2]:Complete.\n"
*--------------------------------------
SYSSCREEN.TOP .AZ "A2osX 0.94 Console"
MSG.Init3 .AS "A2osX[Stage3]:Init"
.AZ "\r\n*** Press Ctrl-R for ROOT Mode ***\r\n"
MSG.Init3 .AZ "A2osX[Stage3]:Init *** Press Ctrl-R for entering ROOT Mode ***\r\n"
MSG.DEV .AZ "Device Manager..."
*--------------------------------------
MSG.BLKDEV .AZ " Adding Device: /dev/%s, Addr:%H, Type: %s\r\n"

View File

@ -178,10 +178,10 @@ PS.CreateChild ldx #0
lda (ZPPtr1),y
sta (PS.NewPSPtr),y
tax
lda S.Table.hSID-1,x
jsr MEM.GetMemByID
jsr MEM.IncRefCnt
* tax
* lda S.Table.hSID-1,x
* jsr MEM.GetMemByID
* jsr MEM.IncRefCnt
lda #S.PS.F.HOLD
bit PS.Flags

View File

@ -198,8 +198,7 @@ PWDX.OpenSession
sta (ZPPtr1),y
dey
bpl .2
>DEBUG
txa
clc
rts

View File

@ -319,7 +319,7 @@ K.RealPath.RemoveAtX
*\--------------------------------------
.DUMMY
.OR ZPDRV
ENV.BufLen .BS 1
ENV.BufPtr .BS 1
ENV.VarEndChar .BS 1
ENV.bNoExp .BS 1
ENV.bExp .BS 1
@ -340,7 +340,7 @@ K.Expand ldy #2
.1 phx Save temp string...
>STYA TXTPTR
stz ENV.BufLen init Expanded String len=0
stz ENV.BufPtr init Expanded String len=0
stz ENV.bExp No var found yet
stz ENV.bNoExp Reset no expand flag
@ -393,25 +393,22 @@ K.Expand ldy #2
.40 jsr ENV.ExpandStrVar
bcc .70
.50 ldy ENV.BufLen
.50 ldy ENV.BufPtr
lda /K.Buf256
>STYA FORPNT
ldy #S.PS.hENV
lda (pPS),y
ldx #SYS.GetEnv
jsr K.SYSCALL.JMPX
jsr K.GetEnv.I
bcs .70
ldx ENV.BufLen
ldx ENV.BufPtr
.51 lda K.Buf256,x
beq .52
inx
bra .51
.52 stx ENV.BufLen
.52 stx ENV.BufPtr
.70 lda (TXTPTR)
beq .72
@ -426,7 +423,7 @@ K.Expand ldy #2
bra .10
.80 ldx ENV.BufLen
.80 ldx ENV.BufPtr
stz K.Buf256,x
pla discard temp string
@ -552,7 +549,7 @@ ENV.StrVarsPWD ldy #S.PS.hCWD
*--------------------------------------
ENV.AddYAToBuf >STYA ZPPtr3
*--------------------------------------
ENV.AddP3ToBuf ldx ENV.BufLen
ENV.AddP3ToBuf ldx ENV.BufPtr
ldy #$ff
dex
@ -563,12 +560,12 @@ ENV.AddP3ToBuf ldx ENV.BufLen
sta K.Buf256,x
bne .1
stx ENV.BufLen
stx ENV.BufPtr
rts
*--------------------------------------
ENV.AddAToBuf ldx ENV.BufLen
ENV.AddAToBuf ldx ENV.BufPtr
sta K.Buf256,x
inc ENV.BufLen
inc ENV.BufPtr
rts
*--------------------------------------
ENV.NextEnvP3 jsr ENV.GetP3LenY

View File

@ -43,7 +43,7 @@ UNISTD.Open ldx #5 /DEV/
*--------------------------------------
>LDYAI K.MLI.PATH+6 skip $/DEV/
>SYSCALL2 GetDevByName
jsr K.GetDevByName
bcc .7
ldx #2
@ -52,13 +52,18 @@ UNISTD.Open ldx #5 /DEV/
jsr K.GetMemPtr
>STYA ZPPtr1
ldy #0
.2 lda (ZPPtr1),y
iny
cmp K.MLI.PATH,y
bne .3
cmp #0 end of string ?
bne .2
lda Nod.Table.hFD-2,x return hFD
jsr UNISTD.GetPFD
bra .71
@ -89,10 +94,12 @@ UNISTD.Open ldx #5 /DEV/
*--------------------------------------
IO.OPEN.REG >MLICALL MLIGETFILEINFO
bcc IO.OPEN.REG.E Already Exists
bit IO.Open.FLAGS Create if not exists ?
bpl IO.OPEN.RTS No, return MLI error
ldx #2 Yes, Create...
.1 lda IO.Open.TYPE,x
sta K.MLI.PARAMS+4,x File type,Aux type
dex

View File

@ -1,25 +0,0 @@
NEW
PREFIX
AUTO 4,1
echo \fBuilding A2OSX.BOOT Media...
format S6D1 A2OSX.BOOT
echo Copying Files...
cp ProDOS /A2OSX.BOOT
md /A2OSX.BOOT/SYS
cp SYS/* /A2OSX.BOOT/SYS
md /A2OSX.BOOT/DRV
cp DRV/* /A2OSX.BOOT/DRV
md /A2OSX.BOOT/LIB
cp LIB/* /A2OSX.BOOT/LIB
md /A2OSX.BOOT/SBIN
cp SBIN/* /A2OSX.BOOT/SBIN
md /A2OSX.BOOT/BIN
cp BIN/* /A2OSX.BOOT/BIN
md /A2OSX.BOOT/ETC
echo Done!
cp A2OSX.SYSTEM /A2OSX.BOOT
chtyp /A2OSX.BOOT/A2OSX.SYSTEM SYS
cp A2OSX.STARTUP /A2OSX.BOOT
MAN
TEXT MAKEBOOT

View File

@ -1,13 +0,0 @@
NEW
PREFIX
AUTO 4,1
echo \fBuilding A2OSX.DEV Media...
format S6D2 A2OSX.DEV
echo Copying Files...
md /A2OSX.DEV/BIN
cp -q BIN/DEV/* /A2OSX.DEV/BIN
md /A2OSX.DEV/INC
cp -q INC/* /A2OSX.DEV/INC
echo Done!
MAN
TEXT MAKEDEV

View File

@ -1,6 +0,0 @@
NEW
PREFIX
AUTO 4,1
-A2OSX.SYSTEM
MAN
TEXT RUN