mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-09 00:54:29 +00:00
Kernel 0.9.2
This commit is contained in:
parent
929e47b612
commit
98617e93dc
Binary file not shown.
Binary file not shown.
@ -105,8 +105,8 @@ Dev.Table.hFD .EQ $0C20 K.Dev.MAX
|
|||||||
Nod.Table.hPath .EQ $0C40 K.NOD.MAX
|
Nod.Table.hPath .EQ $0C40 K.NOD.MAX
|
||||||
Nod.Table.hFD .EQ $0C60 K.NOD.MAX
|
Nod.Table.hFD .EQ $0C60 K.NOD.MAX
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PS.Table.hMem .EQ $0C80 K.PS.MAX
|
PS.Table.PID .EQ $0C80 K.PS.MAX
|
||||||
PS.Table.PID .EQ $0CA0 K.PS.MAX
|
PS.Table.hPS .EQ $0CA0 K.PS.MAX
|
||||||
PS.Table.Hits .EQ $0CC0 K.PS.MAX
|
PS.Table.Hits .EQ $0CC0 K.PS.MAX
|
||||||
PS.Table.Stats .EQ $0CE0 K.PS.MAX
|
PS.Table.Stats .EQ $0CE0 K.PS.MAX
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -133,6 +133,7 @@ CS.INIT jsr SetPWD
|
|||||||
|
|
||||||
ldy #S.PS.ARGC
|
ldy #S.PS.ARGC
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
|
cmp #1
|
||||||
|
|
||||||
beq .1 no arg, continue starting interactive
|
beq .1 no arg, continue starting interactive
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ CORE.Run stz CORE.PSIndex
|
|||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 lda PS.Table.hMem,x
|
.1 lda PS.Table.hPS,x
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
jsr K.GetMemPtr
|
jsr K.GetMemPtr
|
||||||
@ -217,7 +217,7 @@ CORE.Dispatch stz CORE.PSIndex
|
|||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 lda PS.Table.hMem,x
|
.1 lda PS.Table.hPS,x
|
||||||
beq .5
|
beq .5
|
||||||
|
|
||||||
jsr K.GetMemPtr
|
jsr K.GetMemPtr
|
||||||
@ -285,7 +285,7 @@ CORE.Dispatch stz CORE.PSIndex
|
|||||||
* In : A = PID to free
|
* In : A = PID to free
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.PSFree.A sta .1+1 Save PS ID
|
CORE.PSFree.A sta .1+1 Save PS ID
|
||||||
jsr CORE.GetPSByID PS in ZPPtr1
|
jsr CORE.GetPSByID S.PS in ZPPtr1
|
||||||
bcs .9
|
bcs .9
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ CORE.PSFree.A sta .1+1 Save PS ID
|
|||||||
jsr .8
|
jsr .8
|
||||||
|
|
||||||
lda (ZPPtr1) get S.PS.F
|
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
|
beq .1
|
||||||
|
|
||||||
ldy #S.PS.hENV
|
ldy #S.PS.hENV
|
||||||
@ -320,11 +320,11 @@ CORE.PSFree.A sta .1+1 Save PS ID
|
|||||||
inx
|
inx
|
||||||
cpx #K.PS.MAX
|
cpx #K.PS.MAX
|
||||||
bne .2
|
bne .2
|
||||||
bra *
|
beq *
|
||||||
|
|
||||||
.3 stz PS.Table.PID,x
|
.3 stz PS.Table.PID,x
|
||||||
lda PS.TABLE.hMem,x
|
lda PS.TABLE.hPS,x
|
||||||
stz PS.TABLE.hMem,x
|
stz PS.TABLE.hPS,x
|
||||||
.4 jmp K.FreeMem
|
.4 jmp K.FreeMem
|
||||||
|
|
||||||
.8 lda (ZPPtr1),y
|
.8 lda (ZPPtr1),y
|
||||||
@ -337,19 +337,23 @@ CORE.GetPSByID tay
|
|||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
jsr CORE.GetPS
|
jsr CORE.GetPS
|
||||||
bcs .9
|
bcs CORE.GetPSByID.RTS
|
||||||
|
|
||||||
lda PS.TABLE.hMem,y
|
lda PS.TABLE.hPS,y
|
||||||
jmp K.GetMemPtr
|
jmp K.GetMemPtr
|
||||||
|
|
||||||
.8 >LDYAI CORE.S.PS0 Select PS0
|
.8 >LDYAI CORE.S.PS0 Select PS0
|
||||||
|
CORE.GetPSByID.8
|
||||||
clc
|
clc
|
||||||
.9 rts
|
CORE.GetPSByID.RTS
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
* X,A unmodified
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.GetPS ldy #0
|
CORE.GetPS ldy #0
|
||||||
|
|
||||||
.1 cmp PS.Table.PID,y
|
.1 cmp PS.Table.PID,y
|
||||||
beq .8
|
beq CORE.GetPSByID.8
|
||||||
iny
|
iny
|
||||||
cpy #K.PS.MAX
|
cpy #K.PS.MAX
|
||||||
bne .1
|
bne .1
|
||||||
@ -357,9 +361,6 @@ CORE.GetPS ldy #0
|
|||||||
.9 lda #K.E.NSP
|
.9 lda #K.E.NSP
|
||||||
* sec
|
* sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 clc
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
*CORE.DumpEvent ldy #S.EVT-1
|
*CORE.DumpEvent ldy #S.EVT-1
|
||||||
|
|
||||||
@ -536,8 +537,9 @@ CORE.TickPerSec .BS 1
|
|||||||
CORE.TickPer10t .BS 1
|
CORE.TickPer10t .BS 1
|
||||||
CORE.TickSec .BS 1
|
CORE.TickSec .BS 1
|
||||||
CORE.Tick10t .BS 1
|
CORE.Tick10t .BS 1
|
||||||
CORE.CPUStat .BS 1
|
CORE.CPUStatCnt .DA #100
|
||||||
CORE.InKernelStat .BS 1
|
CORE.InKernelHits .BS 1
|
||||||
|
CORE.InKernelStats .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.EvtIndex .BS 1
|
CORE.EvtIndex .BS 1
|
||||||
CORE.EvtCount .BS 1
|
CORE.EvtCount .BS 1
|
||||||
|
@ -146,8 +146,9 @@ Kernel.Init3 sta SETALTZP
|
|||||||
cmp #$84 CTRL-D for Maintenace mode
|
cmp #$84 CTRL-D for Maintenace mode
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
|
>PUSHBI 0
|
||||||
>LDYAI MSG.MMode
|
>LDYAI MSG.MMode
|
||||||
>SYSCALL puts
|
>SYSCALL printf
|
||||||
|
|
||||||
>LDYAI STARTUP.SHELL
|
>LDYAI STARTUP.SHELL
|
||||||
bra .8
|
bra .8
|
||||||
@ -166,7 +167,7 @@ Kernel.Init3 sta SETALTZP
|
|||||||
pla
|
pla
|
||||||
>SYSCALL Args2ArgV
|
>SYSCALL Args2ArgV
|
||||||
|
|
||||||
plx
|
pla
|
||||||
jsr K.FreeMem
|
jsr K.FreeMem
|
||||||
|
|
||||||
>PUSHBI 0 PS Flags
|
>PUSHBI 0 PS Flags
|
||||||
@ -528,7 +529,7 @@ MemMgrInit >LDYAI Mem.MHiMem
|
|||||||
|
|
||||||
ldx #K.PS.MAX*4-1
|
ldx #K.PS.MAX*4-1
|
||||||
|
|
||||||
.3 stz PS.Table.hMem,x
|
.3 stz PS.Table.PID,x
|
||||||
dex
|
dex
|
||||||
bpl .3
|
bpl .3
|
||||||
|
|
||||||
|
@ -152,33 +152,35 @@ K.IrqH.VBL.MRM jsr $FFFF SELF MODIFIED,READMOUSE
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.IrqH.Switch inc IRQ.Tick
|
K.IrqH.Switch inc IRQ.Tick
|
||||||
|
|
||||||
dec CORE.CPUStat
|
dec CORE.CPUStatCnt
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
lda #100
|
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
|
ldx #K.PS.MAX-1
|
||||||
|
|
||||||
.1 lda PS.Table.Hits-1,x
|
.1 lda PS.Table.Hits-1,x
|
||||||
stz PS.Table.Hits-1,x
|
stz PS.Table.Hits-1,x
|
||||||
stz PS.Table.Stats-1,x
|
sta PS.Table.Stats-1,x
|
||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
.2 lda IRQ.InKernel keep V flag set
|
.2 lda IRQ.InKernel keep V flag set
|
||||||
bpl .3
|
bpl .3
|
||||||
|
|
||||||
inc CORE.InKernelStat
|
inc CORE.InKernelHits
|
||||||
|
|
||||||
.9 clv
|
.9 clv
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.3 ldx CORE.PSIndex
|
.3 ldx CORE.PSIndex
|
||||||
inc PS.Table.Hits-1,x
|
inc PS.Table.Hits,x
|
||||||
|
|
||||||
bit A2osX.F A2osX.F.PMODE .EQ %01000000
|
bit A2osX.F A2osX.F.PMODE .EQ %01000000
|
||||||
bvc .8
|
bvc .8
|
||||||
|
@ -236,13 +236,22 @@ Mem.NextSlot lda ZPMemMgrSPtr
|
|||||||
* none.
|
* none.
|
||||||
* (X unmodified)
|
* (X unmodified)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
|
K.FreeMem.ERR >PUSHA
|
||||||
|
>PUSHBI 1
|
||||||
|
|
||||||
|
>PUSHWI K.FreeMem.ERR1
|
||||||
|
lda #DEVID.SYS
|
||||||
|
>SYSCALL fprintf
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
K.FreeMem tay
|
K.FreeMem tay
|
||||||
|
|
||||||
beq * Slot=0, reserved by Kernel
|
beq K.FreeMem.ERR Slot=0, reserved by Kernel
|
||||||
|
|
||||||
cmp Mem.LastSlot
|
cmp Mem.LastSlot
|
||||||
bcc .10
|
bcc .10
|
||||||
bne *
|
bne K.FreeMem.ERR
|
||||||
|
|
||||||
.10 jsr K.GetMemByID X unmodified
|
.10 jsr K.GetMemByID X unmodified
|
||||||
lda (ZPMemMgrSPtr)
|
lda (ZPMemMgrSPtr)
|
||||||
@ -299,33 +308,21 @@ K.FreeMem tay
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.9 lda $D000
|
.9 ply
|
||||||
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
|
|
||||||
pla
|
pla
|
||||||
sbc #0
|
pha
|
||||||
|
phy
|
||||||
|
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>PUSHBI 2
|
>PUSHBI 2
|
||||||
>LDYAI K.FreeMem.ERR
|
>PUSHWI K.FreeMem.ERR2
|
||||||
>SYSCALL printf
|
lda #DEVID.SYS
|
||||||
|
>SYSCALL fprintf
|
||||||
.91 ldx #$ff
|
sec
|
||||||
bit $C000,x
|
rts
|
||||||
bit $C000,x
|
|
||||||
bra *
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
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
|
* # GetMemPtr
|
||||||
* A = hMem
|
* A = hMem
|
||||||
|
@ -59,7 +59,7 @@ K.Exec >STYA PS.Args
|
|||||||
PS.CreateChild ldx #0
|
PS.CreateChild ldx #0
|
||||||
|
|
||||||
.1 lda PS.Table.PID,x
|
.1 lda PS.Table.PID,x
|
||||||
beq .2 Found an empty slot
|
beq .4 Found an empty slot
|
||||||
inx
|
inx
|
||||||
cpx #K.PS.MAX
|
cpx #K.PS.MAX
|
||||||
bne .1
|
bne .1
|
||||||
@ -71,18 +71,15 @@ PS.CreateChild ldx #0
|
|||||||
.99 plx
|
.99 plx
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.2 phx save PS index
|
|
||||||
|
|
||||||
.4 inc CORE.LastPSID Get a PSID not already running
|
.4 inc CORE.LastPSID Get a PSID not already running
|
||||||
beq .4 not = 0
|
beq .4 not = 0
|
||||||
lda CORE.LastPSID
|
lda CORE.LastPSID
|
||||||
jsr CORE.GetPSByID
|
jsr CORE.GetPS Y=PS Index, X,A unmodified
|
||||||
bcc .4
|
bcc .4 running...loop
|
||||||
|
|
||||||
plx
|
|
||||||
lda CORE.LastPSID
|
lda CORE.LastPSID
|
||||||
sta PS.Table.PID,x
|
sta PS.Table.PID,x
|
||||||
phx
|
phx save PS Index
|
||||||
|
|
||||||
>LDYAI S.PS
|
>LDYAI S.PS
|
||||||
jsr K.GetMem0 Blank Everything in this S.PS
|
jsr K.GetMem0 Blank Everything in this S.PS
|
||||||
@ -91,7 +88,7 @@ PS.CreateChild ldx #0
|
|||||||
>STYA ZPPtr3
|
>STYA ZPPtr3
|
||||||
txa
|
txa
|
||||||
plx
|
plx
|
||||||
sta PS.Table.hMem,x
|
sta PS.Table.hPS,x
|
||||||
|
|
||||||
jsr PS.SetMemOwner Set Ownership
|
jsr PS.SetMemOwner Set Ownership
|
||||||
|
|
||||||
@ -218,7 +215,7 @@ PS.Load jsr BIN.Load Y,A=filename full path
|
|||||||
ldy #S.PS.hDS
|
ldy #S.PS.hDS
|
||||||
sta (ZPPtr3),y save DS hMem in S.PS
|
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
|
.2 ldy #H.BIN.SS.SIZE
|
||||||
lda (ZPPtr4),y Load SS.SIZE
|
lda (ZPPtr4),y Load SS.SIZE
|
||||||
@ -421,7 +418,7 @@ K.GetPSStat >STYA ZPPtr1
|
|||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
lda CORE.InKernelStat
|
lda CORE.InKernelStats
|
||||||
sta (ZPPtr1),y
|
sta (ZPPtr1),y
|
||||||
|
|
||||||
iny
|
iny
|
||||||
@ -429,7 +426,7 @@ K.GetPSStat >STYA ZPPtr1
|
|||||||
.1 lda PS.Table.PID,x
|
.1 lda PS.Table.PID,x
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
lda PS.Table.hMem,x
|
lda PS.Table.hPS,x
|
||||||
sta (ZPPtr1),y
|
sta (ZPPtr1),y
|
||||||
iny
|
iny
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user