Kernel 0.9.1 : KERNEL, Preemtive mode, Working.

This commit is contained in:
Rémy GIBERT 2018-04-26 17:38:02 +02:00
parent 4ad03e1391
commit 5f215b75ad
14 changed files with 239 additions and 183 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -32,6 +32,7 @@ CS.START cld
.DA CS.DOEVENT .DA CS.DOEVENT
.DA CS.QUIT .DA CS.QUIT
L.MSG0 .DA MSG0 L.MSG0 .DA MSG0
L.MSGK .DA MSGK
L.MSG1 .DA MSG1 L.MSG1 .DA MSG1
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
@ -44,11 +45,17 @@ CS.RUN >LDYA pData
>LDYA L.MSG0 >LDYA L.MSG0
>SYSCALL PrintF.YA >SYSCALL PrintF.YA
>PUSHB.G PS.KCPU
>LDYA L.MSGK
>SYSCALL PrintF.YA
>LDA.G PS.Count >LDA.G PS.Count
beq .8 beq .8
.1 >INC.G PS.Index >INC.G PS.Index
.1 >INC.G PS.Index
tay tay
lda (pData),y PID lda (pData),y PID
@ -72,8 +79,10 @@ CS.RUN >LDYA pData
>PUSHEA.G PS.FLAGS >PUSHEA.G PS.FLAGS
ldy #S.PS.STATS >INC.G PS.Index
lda (ZPPtr),y tay
lda (pData),y
>PUSHA CPU% >PUSHA CPU%
ldy #S.PS.PID ldy #S.PS.PID
@ -117,14 +126,16 @@ CS.QUIT clc
*-------------------------------------- *--------------------------------------
CS.END CS.END
MSG0 .AZ "ID CPU\% Flags UID PID Command Line\r\n" MSG0 .AZ "ID CPU\% Flags UID PID Command Line\r\n"
MSGK .AZ "000 %03d\% -------- *KERNEL*\r\n"
MSG1 .AZ "%03d %03d\% %s %03d %03d %s\r\n" MSG1 .AZ "%03d %03d\% %s %03d %03d %s\r\n"
MSG.FLAGS .AS "IRDQHSE2" MSG.FLAGS .AS "IRQDHSed"
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
PS.COUNT .BS 1 PS.COUNT .BS 1
PS.DATA .BS K.PS.MAX PS.KCPU .BS 1
PS.DATA .BS K.PS.MAX*2
PS.Index .BS 1 PS.Index .BS 1
PS.FLAGS .BS 9 PS.FLAGS .BS 9
DS.END DS.END

View File

@ -363,8 +363,8 @@ S.DSTAT .EQ 25
S.PS.F .EQ 0 S.PS.F .EQ 0
S.PS.F.INIT .EQ %10000000 S.PS.F.INIT .EQ %10000000
S.PS.F.RUN .EQ %01000000 S.PS.F.RUN .EQ %01000000
S.PS.F.DOEVENT .EQ %00100000 S.PS.F.QUIT .EQ %00100000
S.PS.F.QUIT .EQ %00010000 S.PS.F.DOEVENT .EQ %00010000
S.PS.F.HOLD .EQ %00001000 S.PS.F.HOLD .EQ %00001000
S.PS.F.SLEEP .EQ %00000100 S.PS.F.SLEEP .EQ %00000100
S.PS.F.EVENT .EQ %00000010 S.PS.F.EVENT .EQ %00000010
@ -423,7 +423,7 @@ S.EVT.F.T1SEC .EQ %01000000
S.EVT.F.hMEM2 .EQ %00100000 Indicates That S.EVT.B2 is a hMem S.EVT.F.hMEM2 .EQ %00100000 Indicates That S.EVT.B2 is a hMem
S.EVT.F.hMEM1 .EQ %00010000 Indicates That S.EVT.B1 is a hMem S.EVT.F.hMEM1 .EQ %00010000 Indicates That S.EVT.B1 is a hMem
S.EVT.hDEV .EQ 1 *S.EVT.hDEV .EQ 1
S.EVT.B1 .EQ 2 S.EVT.B1 .EQ 2
S.EVT.B2 .EQ 3 S.EVT.B2 .EQ 3
S.EVT.W1 .EQ 4 S.EVT.W1 .EQ 4

View File

@ -21,7 +21,7 @@ CS.START cld
.DA 0 .DA 0
.DA CS.END-CS.START CS .DA CS.END-CS.START CS
.DA DS.END-DS.START DS .DA DS.END-DS.START DS
.DA #16 SS .DA #64 SS
.DA #0 ZP .DA #0 ZP
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
@ -50,9 +50,9 @@ CS.INIT ldy #S.PS.ARGC
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
sta (pPs),y sta (pPs),y
ldy #S.PS.hStdOut iny #S.PS.hStdOut
sta (pPs),y sta (pPs),y
ldy #S.PS.hStdErr iny #S.PS.hStdErr
sta (pPs),y sta (pPs),y
>STA.G hNode >STA.G hNode
@ -82,12 +82,13 @@ CS.INIT ldy #S.PS.ARGC
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.RUN >SLEEP CS.RUN >SLEEP
>SYSCALL GetChar >SYSCALL GetChar
bcs CS.RUN bcs CS.RUN
.11 >SLEEP .11 >SLEEP
>SYSCALL GetChar >SYSCALL GetChar
bcc .11 bcc .11
jsr Init.Timeout jsr Init.Timeout
@ -103,7 +104,6 @@ CS.RUN >SLEEP
bne .1 bne .1
CS.RUN.LOOP CS.RUN.LOOP
.1 >SLEEP .1 >SLEEP
>SYSCALL GetChar >SYSCALL GetChar
bcs .4 bcs .4
@ -125,6 +125,7 @@ CS.RUN.LOOP
lda (pData),y lda (pData),y
>SYSCALL GetMemPtr.A >SYSCALL GetMemPtr.A
>SYSCALL ExecPS.YA >SYSCALL ExecPS.YA
.9 rts .9 rts
.8 clc .8 clc

View File

@ -24,7 +24,8 @@ CS.START cld
.DA 0 .DA 0
.DA CS.END-CS.START Code Length To Relocate .DA CS.END-CS.START Code Length To Relocate
.DA 0 Data Segment to Allocate .DA 0 Data Segment to Allocate
.DA 16 SS .DA #64 SS
.DA #6 ZP
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
* Relocation Table * Relocation Table

View File

@ -24,7 +24,7 @@ CS.START cld
.DA 0 .DA 0
.DA CS.END-CS.START CS .DA CS.END-CS.START CS
.DA DS.END-DS.START DS .DA DS.END-DS.START DS
.DA #16 SS .DA #64 SS
.DA #2 ZP SS .DA #2 ZP SS
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------

View File

@ -33,7 +33,7 @@ CS.START cld
.DA CS.END-CS.START CS .DA CS.END-CS.START CS
.DA DS.END-DS.START DS .DA DS.END-DS.START DS
.DA #64 SS .DA #64 SS
.DA #0 ZP (256) .DA #16 ZP
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
* Relocation Table * Relocation Table

View File

@ -3,17 +3,14 @@ PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*-------------------------------------- *--------------------------------------
CORE.Run lda CORE.PSCount CORE.Run lda CORE.PSCount
sta CORE.Counter sta CORE.PSIndex
* bne .1 SHOULD NEVER HAPPEN!!!
* jmp CORE.Events beq CORE.Events SHOULD NEVER HAPPEN!!!
.1 ldx CORE.Counter .1 ldx CORE.PSIndex
lda PS.Table.PID-1,x lda PS.Table.hMem-1,x
bne .11 beq .8
jmp .8
.11 lda PS.Table.hMem-1,x
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA pPs >STYA pPs
@ -30,37 +27,22 @@ CORE.Run lda CORE.PSCount
eor #S.PS.F.HOLD unmark as HOLD eor #S.PS.F.HOLD unmark as HOLD
sta (pPs) sta (pPs)
.2 jsr CORE.PSSelect Restore at least ZP & Ptrs .2 jsr CORE.PSSelect Restore ZP & Ptrs
lda (pPs) get S.PS.F again jsr CORE.PSExec INIT/RUN/QUIT/RESUME
bit #S.PS.F.SLEEP Is this PS sleeping?
beq .3 no, call INIT/RUN
eor #S.PS.F.SLEEP unmark as SLEEP
sta (pPS)
jsr CORE.Resume Restore PC....and JMP to
bra .41
.3 bit #S.PS.F.INIT
beq .4
eor #S.PS.F.INIT+S.PS.F.RUN unmark as INIT,mark as RUN
sta (pPS)
ldx #TSKMGR.INIT
.HS 2C BIT abs
.4 ldx #TSKMGR.RUN
jsr CORE.pCodeJmp Call INIT/RUN function
dec IRQ.InKernel dec IRQ.InKernel
.41 bcc .7 INIT/RUN/RESUME said CS=QUIT?
.5 tax save RC bcc .61 Error ?
.5 tax Yes, From INIT or RUN,save RC
ldy #S.PS.PPID Notify Parent Process for exit code... ldy #S.PS.PPID Notify Parent Process for exit code...
lda (pPs),y lda (pPs),y
beq .6 no parent process
jsr CORE.GetPSByID.A X unmodified jsr CORE.GetPSByID.A X unmodified
bcs .6 parent is dead.....skipping... bcs .6 parent is dead.....skipping...
>STYA ZPPtr1 >STYA ZPPtr1
lda (ZPPtr1) Parent PS is HOLD? lda (ZPPtr1) Parent PS is HOLD?
@ -75,12 +57,24 @@ CORE.Run lda CORE.PSCount
sta (ZPPtr1),y sta (ZPPtr1),y
.6 lda (pPs) .6 lda (pPs)
eor #S.PS.F.RUN+S.PS.F.QUIT and #$3F $ff^S.PS.F.INIT+S.PS.F.RUN
ora #S.PS.F.QUIT
sta (pPs) sta (pPs)
bra .7
ldx #TSKMGR.QUIT Quit this process .61 lda (pPs)
jsr CORE.pCodeJmp Call QUIT function bit #S.PS.F.SLEEP
dec IRQ.InKernel bne .7
bit #S.PS.F.INIT
beq .62
eor #S.PS.F.INIT+S.PS.F.RUN go from INIT to RUN
sta (pPs)
bra .7
.62 bit #S.PS.F.QUIT
beq .7
ldy #S.PS.PID ldy #S.PS.PID
lda (pPs),y lda (pPs),y
@ -89,9 +83,8 @@ CORE.Run lda CORE.PSCount
.7 jsr CORE.PSLeave Save ZP & Ptrs .7 jsr CORE.PSLeave Save ZP & Ptrs
.8 dec CORE.Counter .8 dec CORE.PSIndex
beq CORE.Events bne .1
jmp .1
*-------------------------------------- *--------------------------------------
CORE.Events jsr CORE.GetEvents CORE.Events jsr CORE.GetEvents
@ -110,7 +103,7 @@ CORE.Events jsr CORE.GetEvents
bmi .2 Ignore & Discard any timer event bmi .2 Ignore & Discard any timer event
jsr CORE.DumpEvent * jsr CORE.DumpEvent
.2 jsr CORE.DestroyEvent .2 jsr CORE.DestroyEvent
@ -227,19 +220,18 @@ CORE.Dispatch lda CORE.EvtCount
lda CORE.PSCount lda CORE.PSCount
beq .9 beq .9
sta CORE.Counter sta CORE.PSIndex
.1 ldx CORE.Counter .1 ldx CORE.PSIndex
lda PS.Table.PID-1,x
beq .5
lda PS.Table.hMem-1,x lda PS.Table.hMem-1,x
beq .5
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA pPS >STYA pPS
lda (pPs) get S.PS.F lda (pPs) get S.PS.F
bit #S.PS.F.INIT+S.PS.F.HOLD Init or Waiting for Another Task to Terminate? bit #S.PS.F.INIT+S.PS.F.HOLD+S.PS.F.QUIT Init or Waiting for Another Task to Terminate?
bne .5 bne .5
bit #S.PS.F.EVENT Accept Events ? bit #S.PS.F.EVENT Accept Events ?
@ -251,7 +243,7 @@ CORE.Dispatch lda CORE.EvtCount
sta pEvent Select first event in list sta pEvent Select first event in list
lda CORE.EvtCount lda CORE.EvtCount
sta TSKMGR.EVENTCNT sta CORE.EvtIndex
.2 lda (pEvent) Empty event, select next .2 lda (pEvent) Empty event, select next
beq .3 beq .3
@ -260,8 +252,7 @@ CORE.Dispatch lda CORE.EvtCount
ora #S.PS.F.DOEVENT ora #S.PS.F.DOEVENT
sta (pPs) sta (pPs)
ldx #TSKMGR.DOEVENT jsr CORE.PSDoEvent
jsr CORE.pCodeJmp Call DOEVENT function
dec IRQ.InKernel dec IRQ.InKernel
lda (pPs) lda (pPs)
@ -271,10 +262,11 @@ CORE.Dispatch lda CORE.EvtCount
bcs .3 not for this PS, try next event in list bcs .3 not for this PS, try next event in list
jsr CORE.DestroyEvent this PS handled the EVT, destroy it... jsr CORE.DestroyEvent this PS handled the EVT, destroy it...
lda CORE.EvtCount
beq .8 no more event, exit
.3 dec TSKMGR.EVENTCNT lda CORE.EvtCount
beq .4 no more event, exit
.3 dec CORE.EvtIndex
beq .4 all EVT submitted to this PS, try other PS beq .4 all EVT submitted to this PS, try other PS
lda pEvent try next EVT to this PS lda pEvent try next EVT to this PS
@ -285,7 +277,7 @@ CORE.Dispatch lda CORE.EvtCount
.4 jsr CORE.PSLeave .4 jsr CORE.PSLeave
.5 dec CORE.Counter .5 dec CORE.PSIndex
bne .1 bne .1
.9 sec .9 sec
@ -294,9 +286,6 @@ CORE.Dispatch lda CORE.EvtCount
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
CORE.Quit clc
rts
*--------------------------------------
* PS.Free.A * PS.Free.A
* In : A = PID to free * In : A = PID to free
*-------------------------------------- *--------------------------------------
@ -339,6 +328,7 @@ CORE.PSFree.A sta .1+1 Save PS ID
.3 stz PS.Table.PID-1,x .3 stz PS.Table.PID-1,x
lda PS.TABLE.hMem-1,x lda PS.TABLE.hMem-1,x
stz PS.TABLE.hMem-1,x
.4 jmp K.FreeMem.A .4 jmp K.FreeMem.A
.8 lda (ZPPtr1),y .8 lda (ZPPtr1),y
@ -351,6 +341,7 @@ CORE.GetPSByID.A
jsr CORE.GetPSStatus.A jsr CORE.GetPSStatus.A
bcs .9 bcs .9
lda PS.TABLE.hMem-1,y lda PS.TABLE.hMem-1,y
beq *
jmp K.GetMemPtr.A jmp K.GetMemPtr.A
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -370,16 +361,16 @@ CORE.GetPSStatus.A
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
CORE.DumpEvent ldy #S.EVT-1 *CORE.DumpEvent ldy #S.EVT-1
.1 >PUSHB (pEvent),y *.1 >PUSHB (pEvent),y
dey * dey
bpl .1 * bpl .1
>LDYAI .2 * >LDYAI .2
jmp K.PrintF.YA * jmp K.PrintF.YA
.2 .AZ "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n" *.2 .AZ "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n"
*-------------------------------------- *--------------------------------------
CORE.ScrSel and #$0F CORE.ScrSel and #$0F
cmp A2osX.ASCREEN Same as active screen...nothing to do cmp A2osX.ASCREEN Same as active screen...nothing to do
@ -456,77 +447,48 @@ CORE.PSLeave ldy #S.PS.ZP+ZPBIN.SIZE-1
rts rts
*-------------------------------------- *--------------------------------------
CORE.Sleep php CORE.PSExec lda (pPS)
bit #S.PS.F.SLEEP
bne CORE.PSResume
sei bit #S.PS.F.RUN
cld
phy
ldy #S.PS.A
sta (pPs),y
lda #S.PS.F.SLEEP
ora (pPs)
sta (pPs)
txa
iny #S.PS.X
sta (pPs),y
pla
iny #S.PS.Y
sta (pPs),y
pla
iny #S.PS.P
sta (pPs),y
pla get PC LO
plx get PC HI
inc Advance one byte because of return by RTI
bne .1
inx
.1 iny #S.PS.PC
sta (pPs),y
txa
iny #S.PS.PC+1
sta (pPs),y
tsx
inx
inx
inx
txa
tay Save !Byte count for later
beq .8
.2 pla
>PUSHA
inx
bne .2 bne .2
.8 tya push CPU Stack BC to restore on top of Soft Stack bit #S.PS.F.INIT
>PUSHA bne .1
clc exit to kernel with CC ldx #TSKMGR.QUIT
rts .HS 2C BIT ABS
.1 ldx #TSKMGR.INIT
.HS 2C BIT ABS
.2 ldx #TSKMGR.RUN
.HS 2C BIT ABS
CORE.PSDoEvent ldx #TSKMGR.DOEVENT
lda pCode+1
pha
lda pCode
pha
php
sei
inc IRQ.InKernel
rti
*-------------------------------------- *--------------------------------------
CORE.Resume sei CORE.PSResume sei
eor #S.PS.F.SLEEP unmark as SLEEP
sta (pPS)
>PULLA Get !BC >PULLA Get !BC
tay tax
beq .2 beq .2
.1 >PULLA .1 >PULLA
pha pha
iny
inx
bne .1 bne .1
.2 ldy #S.PS.PC+1 .2 ldy #S.PS.PC+1
@ -556,34 +518,86 @@ CORE.Resume sei
inc IRQ.InKernel inc IRQ.InKernel
rti rti
*-------------------------------------- *--------------------------------------
CORE.pCodeJmp lda pCode+1 CORE.PSSleep php
pha
lda pCode
pha
php
sei sei
inc IRQ.InKernel
rti phy
*-------------------------------------- ldy #S.PS.A
TSKMGR.EVENTCNT .BS 1 sta (pPs),y
txa
iny #S.PS.X
sta (pPs),y
pla
iny #S.PS.Y
sta (pPs),y
pla
iny #S.PS.P
sta (pPs),y
pla get PC LO
plx get PC HI
inc Advance one byte because of return by RTI
bne .1
inx
.1 iny #S.PS.PC
sta (pPs),y
txa
iny #S.PS.PC+1
sta (pPs),y
tsx
inx skip P
inx skip PC HI,LO
inx
txa
beq .8
tay Save !Byte count for later
.2 pla
>PUSHA
inx
bne .2
tya
.8 >PUSHA push CPU Stack BC to restore on top of Soft Stack
lda (pPs)
ora #S.PS.F.SLEEP
sta (pPs)
lda #0 cld,clc,cli
pha
rti exit to kernel with CC
*-------------------------------------- *--------------------------------------
DevMgr.Stat .DA DevMgr.FreeMem DevMgr.Stat .DA DevMgr.FreeMem
DevMgr.Free .DA DevMgr.FreeMem DevMgr.Free .DA DevMgr.FreeMem
.DA DevMgr.HiMem .DA DevMgr.HiMem
DevMgr.Count .DA #2 NUL,SYS DevMgr.Count .DA #2 NUL,SYS
*-------------------------------------- *--------------------------------------
CORE.EvtCount .BS 1
CORE.VBLState .BS 1 CORE.VBLState .BS 1
CORE.IRQMode .BS 1 CORE.IRQMode .BS 1
CORE.TickPerSec .BS 1 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.InKernelStat .BS 1
*-------------------------------------- *--------------------------------------
CORE.Counter .BS 1 CORE.EvtIndex .BS 1
CORE.EvtCount .BS 1
CORE.PSIndex .BS 1
CORE.PSCount .DA #0 CORE.PSCount .DA #0
CORE.LastPSID .DA #0 CORE.LastPSID .DA #0
CORE.S.PS0 .BS S.PS.hStdErr+1 CORE.S.PS0 .BS S.PS.hStdErr+1

View File

@ -42,7 +42,7 @@ AUTO 4,1
*-------------------------------------- *--------------------------------------
* SLEEP * SLEEP
*-------------------------------------- *--------------------------------------
jmp CORE.Sleep jmp CORE.PSSleep
*-------------------------------------- *--------------------------------------
* *** MUST BE REINTRANT *** * *** MUST BE REINTRANT ***
*-------------------------------------- *--------------------------------------

View File

@ -1074,10 +1074,10 @@ MSG.Init2.OK .AZ "A2osX[Stage2]:Complete.\n"
*-------------------------------------- *--------------------------------------
MSG.Init3 .AZ "A2osX[Stage3]:Init\r\n" MSG.Init3 .AZ "A2osX[Stage3]:Init\r\n"
MSG.DEV .AZ "-Device Manager...\r\n" MSG.DEV .AZ "-Device Manager...\r\n"
MSG.IRQ .AZ "-Interrupt Manager...\r\n" MSG.IRQ .AZ "-Interrupt Manager..."
MSG.IRQ.VBL .AZ " (Mouse VBL IRQ Activated)\r\n" MSG.IRQ.VBL .AZ "Mouse VBL IRQ Activated.\r\n"
MSG.IRQ.CLOCK .AZ " (Clock Card IRQ Activated)\r\n" MSG.IRQ.CLOCK .AZ "Clock Card IRQ Activated.\r\n"
MSG.IRQ.POLL .AZ " (Polling Mode)\r\n" MSG.IRQ.POLL .AZ "Polling Mode.\r\n"
MSG.EVT .AZ "-Event Manager...\r\n" MSG.EVT .AZ "-Event Manager...\r\n"
MSG.FLT .AZ "-Path Filter...\r\n" MSG.FLT .AZ "-Path Filter...\r\n"
MSG.TSK .AZ "-Task Manager...\r\n" MSG.TSK .AZ "-Task Manager...\r\n"

View File

@ -21,8 +21,7 @@ K.IrqHAuxLC cld
pla pla
pha pha
and #$10 BRK? and #$10 BRK?
bne * bne K.IrqHAuxLC.6
* bne K.IrqHAuxLC.6
stx K.IrqHAuxLC.5+1 stx K.IrqHAuxLC.5+1
sty K.IrqHAuxLC.4+1 sty K.IrqHAuxLC.4+1
@ -68,7 +67,13 @@ K.IrqHAuxLC.3 pla
sta $ff sta $ff
pla pla
sta $fe sta $fe
bvc K.IrqHAuxLC.4 no task switching
bvc K.IrqHAuxLC.4 if V, skip task switching
tsx
txa
eor #$FC Only LO,HI & P on stack
beq K.IrqHAuxLC.4 we are in kernel CORE.Run
php php
php make room for 2 additional bytes php make room for 2 additional bytes
@ -84,11 +89,15 @@ K.IrqHAuxLC.3 pla
lda $103,x get IRQ pushed P lda $103,x get IRQ pushed P
sta $101,x down 2 bytes sta $101,x down 2 bytes
lda #CORE.Sleep make a RTI like "jsr CORE.Sleep" lda #CORE.PSSleep make a RTI like "jsr CORE.Sleep"
sta $102,x sta $102,x
lda /CORE.Sleep with RTS=PC IRQ-1 lda /CORE.PSSleep with RTS=PC IRQ-1
sta $103,x sta $103,x
lda #$A0+'S
eor SYS.BASL0+37
sta SYS.BASL0+37
K.IrqHAuxLC.4 ldy #$ff Self Modified K.IrqHAuxLC.4 ldy #$ff Self Modified
K.IrqHAuxLC.5 ldx #$ff Self Modified K.IrqHAuxLC.5 ldx #$ff Self Modified
K.IrqHAuxLC.6 lda #$ff Self Modified K.IrqHAuxLC.6 lda #$ff Self Modified
@ -127,32 +136,41 @@ K.IrqH.VBL jsr IRQ.VBL.MSM SERVEMOUSE
*-------------------------------------- *--------------------------------------
K.IrqH.Switch inc IRQ.Tick K.IrqH.Switch inc IRQ.Tick
dec CORE.CPUStat
bne .2
lda #100
sta CORE.CPUStat
stz CORE.InKernelStat
ldx CORE.PSCount
.1 stz PS.Table.Stat-1,x
dex
bne .1
.2 lda IRQ.InKernel keep V flag set
bpl .3
inc CORE.InKernelStat
.9 clv
clc
rts
.3 ldx CORE.PSIndex
inc PS.Table.Stat-1,x
bit A2osX.F A2osX.F.PMODE .EQ %01000000 bit A2osX.F A2osX.F.PMODE .EQ %01000000
bvc .8 bvc .8
lda IRQ.InKernel keep V flag set
bmi .9
lda (pPs) lda (pPs)
and #S.PS.F.DOEVENT and #S.PS.F.DOEVENT
bne .9 bne .9
lda #$A0+'S
eor SYS.BASL0+37
sta SYS.BASL0+37
* ldy #S.PS.STATS
* lda (pPs),y
* inc
* sta (pPs),y
bvc *
.8 clc exit with V flag set .8 clc exit with V flag set
rts rts
.9 clv
clc
rts
*-------------------------------------- *--------------------------------------
K.IrqH.DEV >LDYAI Dev.Table K.IrqH.DEV >LDYAI Dev.Table
>STYA $fe >STYA $fe

View File

@ -303,6 +303,7 @@ PS.Init jsr BIN.Load.YA Y,A=filename full path
.2 ldy #H.BIN.EXE.SS.SIZE .2 ldy #H.BIN.EXE.SS.SIZE
lda (ZPPtr4),y Load SS.SIZE lda (ZPPtr4),y Load SS.SIZE
ldy #S.PS.ZP.STACK ldy #S.PS.ZP.STACK
sta (ZPPtr3),y save pStack LO... sta (ZPPtr3),y save pStack LO...
@ -393,7 +394,11 @@ K.GetPSStatus.A jsr CORE.GetPSByID.A
K.GetPSList.YA >STYA ZPPtr1 K.GetPSList.YA >STYA ZPPtr1
ldx #0 ldx #0
ldy #0
ldy #1
lda CORE.InKernelStat
sta (ZPPtr1),y
iny
.1 lda PS.Table.PID,x .1 lda PS.Table.PID,x
beq .2 beq .2
@ -402,11 +407,17 @@ K.GetPSList.YA >STYA ZPPtr1
iny iny
sta (ZPPtr1),y sta (ZPPtr1),y
lda PS.Table.Stat,x
iny
sta (ZPPtr1),y
.2 inx .2 inx
cpx CORE.PSCount cpx CORE.PSCount
bne .1 bne .1
.9 tya .9 tya
lsr
dec
sta (ZPPtr1) sta (ZPPtr1)
rts rts
*-------------------------------------- *--------------------------------------