diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index fe30b9af..a5dae865 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/.Floppies/A2OSX.SRC.po b/.Floppies/A2OSX.SRC.po index cfc18dbf..52d2617b 100644 Binary files a/.Floppies/A2OSX.SRC.po and b/.Floppies/A2OSX.SRC.po differ diff --git a/INC/KERNEL.I.txt b/INC/KERNEL.I.txt index e3a8424a..7172bc99 100644 --- a/INC/KERNEL.I.txt +++ b/INC/KERNEL.I.txt @@ -105,8 +105,8 @@ Dev.Table.hFD .EQ $0C20 K.Dev.MAX Nod.Table.hPath .EQ $0C40 K.NOD.MAX Nod.Table.hFD .EQ $0C60 K.NOD.MAX *-------------------------------------- -PS.Table.hMem .EQ $0C80 K.PS.MAX -PS.Table.PID .EQ $0CA0 K.PS.MAX +PS.Table.PID .EQ $0C80 K.PS.MAX +PS.Table.hPS .EQ $0CA0 K.PS.MAX PS.Table.Hits .EQ $0CC0 K.PS.MAX PS.Table.Stats .EQ $0CE0 K.PS.MAX *-------------------------------------- diff --git a/SBIN/SHELL.S.txt b/SBIN/SHELL.S.txt index f3800e00..3c4f14c9 100644 --- a/SBIN/SHELL.S.txt +++ b/SBIN/SHELL.S.txt @@ -133,7 +133,8 @@ CS.INIT jsr SetPWD ldy #S.PS.ARGC lda (pPs),y - + cmp #1 + beq .1 no arg, continue starting interactive jmp CSH.Init @@ -150,7 +151,7 @@ CS.INIT jsr SetPWD *-------------------------------------- CS.RUN >LDA.G bReadMode READ Command ? bne CS.RUN.READ - + ldy #S.PS.RC lda (pPs),y beq .11 diff --git a/SYS/KERNEL.S.CORE.txt b/SYS/KERNEL.S.CORE.txt index 5320331a..b1768905 100644 --- a/SYS/KERNEL.S.CORE.txt +++ b/SYS/KERNEL.S.CORE.txt @@ -6,7 +6,7 @@ CORE.Run stz CORE.PSIndex ldx #0 -.1 lda PS.Table.hMem,x +.1 lda PS.Table.hPS,x beq .8 jsr K.GetMemPtr @@ -217,7 +217,7 @@ CORE.Dispatch stz CORE.PSIndex ldx #0 -.1 lda PS.Table.hMem,x +.1 lda PS.Table.hPS,x beq .5 jsr K.GetMemPtr @@ -285,7 +285,7 @@ CORE.Dispatch stz CORE.PSIndex * In : A = PID to free *-------------------------------------- CORE.PSFree.A sta .1+1 Save PS ID - jsr CORE.GetPSByID PS in ZPPtr1 + jsr CORE.GetPSByID S.PS in ZPPtr1 bcs .9 >STYA ZPPtr1 @@ -302,7 +302,7 @@ CORE.PSFree.A sta .1+1 Save PS ID jsr .8 lda (ZPPtr1) get S.PS.F - and #S.PS.F.DUPENV do we have to discard duplicated env & prefix ? + and #S.PS.F.DUPENV do we have to discard duplicated env & prefix ? beq .1 ldy #S.PS.hENV @@ -314,17 +314,17 @@ CORE.PSFree.A sta .1+1 Save PS ID .1 lda #$ff Self Modified ldx #0 - + .2 cmp PS.Table.PID,x beq .3 inx cpx #K.PS.MAX bne .2 - bra * + beq * .3 stz PS.Table.PID,x - lda PS.TABLE.hMem,x - stz PS.TABLE.hMem,x + lda PS.TABLE.hPS,x + stz PS.TABLE.hPS,x .4 jmp K.FreeMem .8 lda (ZPPtr1),y @@ -337,19 +337,23 @@ CORE.GetPSByID tay beq .8 jsr CORE.GetPS - bcs .9 + bcs CORE.GetPSByID.RTS - lda PS.TABLE.hMem,y + lda PS.TABLE.hPS,y jmp K.GetMemPtr .8 >LDYAI CORE.S.PS0 Select PS0 +CORE.GetPSByID.8 clc -.9 rts +CORE.GetPSByID.RTS + rts +*-------------------------------------- +* X,A unmodified *-------------------------------------- CORE.GetPS ldy #0 .1 cmp PS.Table.PID,y - beq .8 + beq CORE.GetPSByID.8 iny cpy #K.PS.MAX bne .1 @@ -357,9 +361,6 @@ CORE.GetPS ldy #0 .9 lda #K.E.NSP * sec rts - -.8 clc - rts *-------------------------------------- *CORE.DumpEvent ldy #S.EVT-1 @@ -536,8 +537,9 @@ CORE.TickPerSec .BS 1 CORE.TickPer10t .BS 1 CORE.TickSec .BS 1 CORE.Tick10t .BS 1 -CORE.CPUStat .BS 1 -CORE.InKernelStat .BS 1 +CORE.CPUStatCnt .DA #100 +CORE.InKernelHits .BS 1 +CORE.InKernelStats .BS 1 *-------------------------------------- CORE.EvtIndex .BS 1 CORE.EvtCount .BS 1 diff --git a/SYS/KERNEL.S.INIT.txt b/SYS/KERNEL.S.INIT.txt index 0114264c..8d8030ce 100644 --- a/SYS/KERNEL.S.INIT.txt +++ b/SYS/KERNEL.S.INIT.txt @@ -146,8 +146,9 @@ Kernel.Init3 sta SETALTZP cmp #$84 CTRL-D for Maintenace mode bne .1 + >PUSHBI 0 >LDYAI MSG.MMode - >SYSCALL puts + >SYSCALL printf >LDYAI STARTUP.SHELL bra .8 @@ -166,7 +167,7 @@ Kernel.Init3 sta SETALTZP pla >SYSCALL Args2ArgV - plx + pla jsr K.FreeMem >PUSHBI 0 PS Flags @@ -528,7 +529,7 @@ MemMgrInit >LDYAI Mem.MHiMem ldx #K.PS.MAX*4-1 -.3 stz PS.Table.hMem,x +.3 stz PS.Table.PID,x dex bpl .3 diff --git a/SYS/KERNEL.S.IRQ.txt b/SYS/KERNEL.S.IRQ.txt index 71138cd2..3835b750 100644 --- a/SYS/KERNEL.S.IRQ.txt +++ b/SYS/KERNEL.S.IRQ.txt @@ -152,33 +152,35 @@ K.IrqH.VBL.MRM jsr $FFFF SELF MODIFIED,READMOUSE *-------------------------------------- K.IrqH.Switch inc IRQ.Tick - dec CORE.CPUStat + dec CORE.CPUStatCnt bne .2 lda #100 - sta CORE.CPUStat + sta CORE.CPUStatCnt - stz CORE.InKernelStat + lda CORE.InKernelHits + stz CORE.InKernelHits + stz CORE.InKernelStats ldx #K.PS.MAX-1 .1 lda PS.Table.Hits-1,x stz PS.Table.Hits-1,x - stz PS.Table.Stats-1,x + sta PS.Table.Stats-1,x dex bpl .1 .2 lda IRQ.InKernel keep V flag set bpl .3 - inc CORE.InKernelStat + inc CORE.InKernelHits .9 clv clc rts .3 ldx CORE.PSIndex - inc PS.Table.Hits-1,x + inc PS.Table.Hits,x bit A2osX.F A2osX.F.PMODE .EQ %01000000 bvc .8 diff --git a/SYS/KERNEL.S.MEM.txt b/SYS/KERNEL.S.MEM.txt index 5539896d..dde3716a 100644 --- a/SYS/KERNEL.S.MEM.txt +++ b/SYS/KERNEL.S.MEM.txt @@ -236,13 +236,22 @@ Mem.NextSlot lda ZPMemMgrSPtr * none. * (X unmodified) *\-------------------------------------- +K.FreeMem.ERR >PUSHA + >PUSHBI 1 + + >PUSHWI K.FreeMem.ERR1 + lda #DEVID.SYS + >SYSCALL fprintf + sec + rts + K.FreeMem tay - beq * Slot=0, reserved by Kernel + beq K.FreeMem.ERR Slot=0, reserved by Kernel cmp Mem.LastSlot bcc .10 - bne * + bne K.FreeMem.ERR .10 jsr K.GetMemByID X unmodified lda (ZPMemMgrSPtr) @@ -299,33 +308,21 @@ K.FreeMem tay clc rts *-------------------------------------- -.9 lda $D000 - sta .91+1 - bit RRAMWRAMBNK2 - bit RRAMWRAMBNK2 - - jsr CORE.PSSelect0 Select PS0 for proper I/O devices - - jsr DRV.SYS.Control - - pla Get PC and sub 2 for calling address - sec - sbc #2 - tay +.9 ply pla - sbc #0 + pha + phy >PUSHYA >PUSHBI 2 - >LDYAI K.FreeMem.ERR - >SYSCALL printf - -.91 ldx #$ff - bit $C000,x - bit $C000,x - bra * + >PUSHWI K.FreeMem.ERR2 + lda #DEVID.SYS + >SYSCALL fprintf + sec + rts *-------------------------------------- -K.FreeMem.ERR .AZ "FreeMem:%H:hMem already freed." +K.FreeMem.ERR1 .AZ "FreeMem:Bad hMem:%h." +K.FreeMem.ERR2 .AZ "FreeMem:hMem already freed At $%H." */-------------------------------------- * # GetMemPtr * A = hMem diff --git a/SYS/KERNEL.S.PS.txt b/SYS/KERNEL.S.PS.txt index da606792..532c4371 100644 --- a/SYS/KERNEL.S.PS.txt +++ b/SYS/KERNEL.S.PS.txt @@ -59,7 +59,7 @@ K.Exec >STYA PS.Args PS.CreateChild ldx #0 .1 lda PS.Table.PID,x - beq .2 Found an empty slot + beq .4 Found an empty slot inx cpx #K.PS.MAX bne .1 @@ -71,18 +71,15 @@ PS.CreateChild ldx #0 .99 plx rts -.2 phx save PS index - .4 inc CORE.LastPSID Get a PSID not already running beq .4 not = 0 lda CORE.LastPSID - jsr CORE.GetPSByID - bcc .4 + jsr CORE.GetPS Y=PS Index, X,A unmodified + bcc .4 running...loop - plx lda CORE.LastPSID sta PS.Table.PID,x - phx + phx save PS Index >LDYAI S.PS jsr K.GetMem0 Blank Everything in this S.PS @@ -91,7 +88,7 @@ PS.CreateChild ldx #0 >STYA ZPPtr3 txa plx - sta PS.Table.hMem,x + sta PS.Table.hPS,x jsr PS.SetMemOwner Set Ownership @@ -218,7 +215,7 @@ PS.Load jsr BIN.Load Y,A=filename full path ldy #S.PS.hDS sta (ZPPtr3),y save DS hMem in S.PS - jsr PS.SetMemOwner Set Ownership + jsr PS.SetMemOwner Set Ownership .2 ldy #H.BIN.SS.SIZE lda (ZPPtr4),y Load SS.SIZE @@ -421,7 +418,7 @@ K.GetPSStat >STYA ZPPtr1 ldx #0 ldy #1 - lda CORE.InKernelStat + lda CORE.InKernelStats sta (ZPPtr1),y iny @@ -429,7 +426,7 @@ K.GetPSStat >STYA ZPPtr1 .1 lda PS.Table.PID,x beq .2 - lda PS.Table.hMem,x + lda PS.Table.hPS,x sta (ZPPtr1),y iny