Kernel 0.9.1 : README.md

This commit is contained in:
Rémy GIBERT 2017-08-23 13:33:51 +02:00
parent 5aa61b6153
commit f8697c333a
10 changed files with 119 additions and 114 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
# A2osX (0.9.1) Multi-Tasking OS for Apple II
# A2osX (0.9.1) Multi-Tasking OS for Apple II
0.9 has been archived, next Kernel Version is 0.9.1
Target :
+ More Standard C API compliance
+ API Cleanup, many functions still use shared space
+ Per process Stack Segment

View File

@ -65,91 +65,91 @@ Cmd.ExecYA stz bStartProc
Cmd.ExecYA.1 >SYSCALL ExpandPStrYA
>STYA ZPPtr1
phx
>STYA ZPPtr2
stx Cmd.ExecYA.Exit.1+1
ldy #1
ldx #0 ARGS len
ldy #0 CMD len
lda (ZPPtr1),y
lda (ZPPtr2)
tax ARGS len=Total Len
.10 sta CMD,y Store Cmd in Buffer
sty CMD update CMD len
.1 inc ZPPtr2 Next Cmd Char
bne .2
inc ZPPtr2+1
tya
cmp (ZPPtr1)
beq .13 end of string
.2 lda (ZPPtr2)
cmp #" " we reached blank between CMD ARGS
beq .3
iny
lda (ZPPtr1),y
cmp #' '
bne .10
iny CMD+1
dex Total=0
bne .1
.12 tya
cmp (ZPPtr1)
beq .13 end of string
iny
lda (ZPPtr1),y
inx
sta ARGS,x
bra .12
.13 stx ARGS update ARGS len
pla
>SYSCALL FreeMemA
.3 tya
sta (ZPPtr1) Cut CMD
txa
sta (ZPPtr2) Cut ARGS
>LDYA L.INTCMDS
>STYA ZPPtr2
>STYA ZPPtr3
ldx #0
.1 lda (ZPPtr2)
.4 lda (ZPPtr3)
beq Cmd.Exec.EXT Ending 0, must be an external Cmd....
cmp CMD Same Len ?
bne .4
cmp (ZPPtr1) Same Len ?
bne .8
tay
.2 lda CMD,y
.5 lda (ZPPtr1),y
cmp #'a' To Uppercase
bcc .21
bcc .6
cmp #'z'+1
bcs .21
bcs .6
eor #$20
.21 cmp (ZPPtr2),y
bne .4
.6 cmp (ZPPtr3),y
bne .8
dey
bne .2
bne .6
jsr .5 Found an internal Cmd...
jsr Cmd.Exec.INT Found an internal Cmd...
bcs .3
bcs .7
lda #0
.3 ldy #S.PS.RC
.7 ldy #S.PS.RC
sta (pPS),y
rts
bra Cmd.ExecYA.Exit
.5 jmp (J.INTCMDS,x)
.4 inx
.8 inx
inx
lda ZPPtr2
lda ZPPtr3
sec
adc (ZPPtr2)
sta ZPPtr2
bcc .1
inc ZPPtr2+1
bra .1
adc (ZPPtr3)
sta ZPPtr3
bcc .4
inc ZPPtr3+1
bra .4
*--------------------------------------
Cmd.ExecYA.Exit php
pha
Cmd.ExecYA.Exit.1
lda #$ff
>SYSCALL FreeMemA
pla
plp
rts
*--------------------------------------
Cmd.Exec.INT jmp (J.INTCMDS,x)
*--------------------------------------
Cmd.Exec.EXT ldy #1
lda CMD,y
lda (ZPPtr1),y
cmp #'/' Command line is already full path, no search
beq .3
@ -159,7 +159,7 @@ Cmd.Exec.EXT ldy #1
>PUSHYA push search list
>PUSHW L.CMD
>PUSHW ZPPtr1
>SYSCALL FileSearch
bcc .2
@ -167,7 +167,7 @@ Cmd.Exec.EXT ldy #1
lda (pPs),y
>SYSCALL GetMemPtrA
>PUSHYA push search list
>PUSHW L.CMD
>PUSHW ZPPtr1
>SYSCALL FileSearch
bcs .99
@ -198,7 +198,7 @@ Cmd.Exec.EXT ldy #1
.9 lda #SYSMGR.ERRSYN
sec
.99 rts
.99 jmp Cmd.ExecYA.Exit
*--------------------------------------
* TXT : Launch "/PATH/SHELL /PATH/CMD ARGS"
*--------------------------------------
@ -238,10 +238,10 @@ Cmd.Exec.EXT.BIN
bmi .2 startproc
>SYSCALL ExecProcessNewEnvYA
rts
jmp Cmd.ExecYA.Exit
.2 >SYSCALL CreateProcessYA
rts
jmp Cmd.ExecYA.Exit
*--------------------------------------
* Internal Commands
*--------------------------------------

View File

@ -20,12 +20,12 @@ K.LoadDrvYA >STYA K.LoadDrv.CmdArray
>PUSHW K.LoadDrv.CmdArray (ARG[0] = DRVNAME)
jsr K.FileSearch find Driver in $DRV
jsr K.FileSearch.I find Driver in $DRV
bcs .9
stx .99+1
>LDYAI KrnBuf256
jsr K.LoadExeYA Y,A =filename full path
bcs .98
bcs .9
>STYA pDrv
stx .97+1
@ -58,12 +58,6 @@ K.LoadDrvYA >STYA K.LoadDrv.CmdArray
.97 lda #$ff
jsr K.FreeMemA
pla
.98 pha
.99 lda #$ff
jsr K.FreeMemA
pla
sec
rts
*--------------------------------------
K.LoadDrv.CmdArray .BS 2

View File

@ -364,7 +364,7 @@ K.Rename jsr PFT.CheckPathSTK
*\--------------------------------------
K.Stat jsr PFT.CheckPathSTK
>PULLW K.MLI.PARAMS+1
>PULLW ZPPtr2
>PULLW K.Stat.StoreY+1
>MLICALL MLIGETFILEINFO
bcs .9
@ -381,41 +381,44 @@ K.Stat jsr PFT.CheckPathSTK
lda #0
.2 ldy #S.STAT.MODE
sta (ZPPtr2),y
jsr K.Stat.StoreY
ldx #K.Stat.DST-K.Stat.SRC
.3 ldy K.Stat.SRC-1,x
lda K.MLI.PARAMS,y
ldy K.Stat.DST-1,x
sta (ZPPtr2),y
jsr K.Stat.StoreY
dex
bne .3
ldy #S.STAT.SIZE
lda #0
sta (ZPPtr2),y
jsr K.Stat.StoreY
iny
lda K.MLI.PARAMS+S.FILEINFO.BLOCKSUSED
asl
sta (ZPPtr2),y
jsr K.Stat.StoreY
iny
lda K.MLI.PARAMS+S.FILEINFO.BLOCKSUSED+1
rol
sta (ZPPtr2),y
jsr K.Stat.StoreY
iny
lda #0
rol
sta (ZPPtr2),y
jsr K.Stat.StoreY
clc
.9 rts
K.Stat.StoreY sta $ffff,y
rts
*--------------------------------------
K.Stat.SRC .DA #S.FILEINFO.TYPE
.DA #S.FILEINFO.AUXTYPE,#S.FILEINFO.AUXTYPE+1
@ -424,7 +427,7 @@ K.Stat.SRC .DA #S.FILEINFO.TYPE
K.Stat.DST .DA #S.STAT.P.TYPE
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
.DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1
.DA #S.STAT.SIZE+1,#S.STAT.SIZE+2
* .DA #S.STAT.SIZE+1,#S.STAT.SIZE+2
*--------------------------------------
FILE.SetIOBUF >PUSHWI 1024 get a ProDOS IOBUF

View File

@ -10,26 +10,42 @@ AUTO 6
* ## In:
* PUSHW = Ptr to Search Path (PSTR) %LIB%;/SYS/SLIB
* PUSHW = Ptr to File Name (PSTR)
* PUSHW = Ptr to DstBuf
* ## Out:
* CC : success
* Y,A = PSTR to FilePath (PSTR)
* X = hMem to FilePath
* DstBuf = FilePath
* CS : not found
*\--------------------------------------
K.FileSearch >PULLW ZPPtr4 ZPPtr1 trashed by ExpandPStrYA
K.FileSearch >PULLW ZPPtr2 DstBuf
jsr K.FileSearch.I
bcs .9
lda KrnBuf256
sta (ZPPtr2)
tay
.1 lda KrnBuf256,y
sta (ZPPtr2),y
dey
bne .1
.9 rts
K.FileSearch.I >PULLW ZPPtr4 ZPPtr1 trashed by ExpandPStrYA
>PULLYA Get Search list
>SYSCALL ExpandPStrYA Expand it (SYSCALL to BNK1)
bcs .99
stx .98+1
>STYA ZPPtr3 ZPPtr2 trashed by K.STAT !!! expanded search list ;
>STYA ZPPtr3 expanded search list ;
stz K.FileSearch.Index
stz .11+1
.1 stz KrnBuf256 reset String
ldx #0
ldy K.FileSearch.Index
.11 ldy #$ff Self Modified
.2 tya
cmp (ZPPtr3) end of src string ?
@ -45,7 +61,7 @@ K.FileSearch >PULLW ZPPtr4 ZPPtr1 trashed by ExpandPStrYA
.3 txa
beq .98 String is empty....nothing to try
sty K.FileSearch.Index save current index
sty .11+1 save current index
ldy #0
@ -66,15 +82,14 @@ K.FileSearch >PULLW ZPPtr4 ZPPtr1 trashed by ExpandPStrYA
jsr .98 Discard Expanded hSrch list
bra K.GetFullPathYA.NewStr
clc
rts
.98 lda #$ff SELF MODIFIED : Discard Expanded hSrch list
jsr K.FreeMemA
lda #MLI.ERR.FNOTFND
sec
.99 rts
*--------------------------------------
K.FileSearch.Index .BS 1
*/--------------------------------------
* # GetFullPathYA
* ## In :

View File

@ -4,11 +4,6 @@ LOMEM $A00
INC 1
AUTO 6
*--------------------------------------
ZPPtr1 .EQ ZPKERNEL
ZPPtr2 .EQ ZPKERNEL+2
ZPPtr3 .EQ ZPKERNEL+4
ZPPtr4 .EQ ZPKERNEL+6
*--------------------------------------
Kernel.Init sei
ldx #$FF
txs

View File

@ -13,19 +13,18 @@ AUTO 6
K.LoadLibYA >STYA K.LoadLib.Name SAVE LIBname for K.FileSearch
>LDYAI ENV.LIB push ENVNAME=LIB
>SYSCALL GetEnvYA get value for ENV=LIB
bcs .99
bcs .9
>PUSHYA Push $LIB value
>PUSHW K.LoadLib.Name
jsr K.FileSearch find libname in $LIB
bcs .99
stx .9+1
jsr K.FileSearch.I find libname in $LIB
bcs .9
>LDYAI KrnBuf256
jsr K.LoadExeYA Y,A=filename full path
bcs .98
bcs .9
stx .8+1
>STYA LIB.Jump+1
@ -34,26 +33,19 @@ K.LoadLibYA >STYA K.LoadLib.Name SAVE LIBname for K.FileSearch
ldx #LIBMGR.LOAD
jsr LIB.Jump Call LIB.LOAD function
bcs .97
jsr .98 Cleanup...
bcs .99
.8 lda #$ff hLib
clc
rts
.9 rts
.97 pha
.99 pha
lda .8+1
jsr K.FreeMemA
pla
.98 pha
.9 lda #$ff
jsr K.FreeMemA
pla
sec
.99 rts
rts
*--------------------------------------
K.LoadLib.Name .BS 2
*--------------------------------------

View File

@ -14,6 +14,12 @@ AUTO 6
.INB INC/PRODOS.I
.INB INC/MLI.ERR.I
ZPPtr1 .EQ ZPKERNEL
ZPPtr2 .EQ ZPKERNEL+2
ZPPtr3 .EQ ZPKERNEL+4
ZPPtr4 .EQ ZPKERNEL+6
ZPPStr1 .EQ ZPKERNEL+8
.INB /A2OSX.SRC/SYS/KERNEL.S.INIT
.INB /A2OSX.SRC/X.PRINTF.S