From b52ac88d2b8590708cbabb200cdff9f45b72cd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Tue, 29 Aug 2017 17:19:09 +0200 Subject: [PATCH] Kernel 0.9.1 : Code reorganization & move to CSTR (ARGS) --- .Floppies/A2OSX.BUILD.po | Bin 819200 -> 819200 bytes .Floppies/A2OSX.SRC.po | Bin 819200 -> 819200 bytes SYS/KERNEL.S.CORE.txt | 379 +++++++++++++++++++++++++++++++++++++++ SYS/KERNEL.S.EVT.txt | 105 ----------- SYS/KERNEL.S.GP.txt | 2 +- SYS/KERNEL.S.INIT.txt | 2 +- SYS/KERNEL.S.PS.txt | 124 ++++++------- SYS/KERNEL.S.RUN.txt | 104 ----------- SYS/KERNEL.S.TSK.txt | 193 -------------------- SYS/KERNEL.S.txt | 4 +- 10 files changed, 444 insertions(+), 469 deletions(-) create mode 100644 SYS/KERNEL.S.CORE.txt delete mode 100644 SYS/KERNEL.S.EVT.txt delete mode 100644 SYS/KERNEL.S.RUN.txt delete mode 100644 SYS/KERNEL.S.TSK.txt diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index 76bc8eda1742318b6466a86e2fbe4860a2c4b8ca..b65ce80cf55d1011072d7514aeb634c220b5f64d 100644 GIT binary patch delta 3605 zcmZWL3v?6Lm7{t3`h$nR>|l5hJ6Mj7m!+wz(j+)+LIfC0vCYS!VbYd!ls0s?r`C*fFR4?Ag>q7fnZGb2kv8jmrXH1r&6 z@3W!po*n7Ed*8kH-S7Ja0$T%tt#Ydkl|IOfylQ*PZu!c{V+EGp<)u_%4fWEd%4H8y z(-bD$`XPrMg~U7EN8a4E@}&55(9%i?lsFMYt+enhac<)KvGoZ?TriZVP?; z%yxPiU$mXphJX753w=ZD{^2`STf&*=sKpQMYpSDSKf07*?~NOdG*HfyQZ6^RkmJhr zjxt@)MQ!BTJ5R5F;$@wCMfVhO0X+{su0U72`d0QP$s(0TS5(G zgDpDF<>ZB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K0|qKhwPaX;`!wh;tn^i0{U4gd4)i# zNW}(}?8RpuGx;B1$|_UtuvKVK(QIr;CO}h*gRHEizd2Llrk%^s^jD2yB{lMqm$~AK zc~hC@Qzq>Kx(Q1K`KyX|>j7!AK3eozmP!w|!0Zd^^-w<*QC| z)r?I(c#m0?-I$X|ZS z37VCRT=E%L8ef%+E$XEgUXR^1Jt_)`WFI~D+G!+`)n+&pQu2J+7Er(V({Ma*9kZ)m2r~+m*sdK3B`qU&2=xnn(i>fDP zaX@F+V!M1E(|ZdeuRPDq)wmhC=R7xC)5^%Voag3w+Z1V15?ee673Hx(pBNP*`0EhK zU&_x)*b#u?N}608Zr=u9bHHU^w-L111t_l!?KH=gcYu7&DclVa!NMudv=o6pNj&(N z*}63%1cL3o;sPs{W$jiqyLG3s8-KN$$!t)t4RhfsPCt!+dE0jR%r?G2p8g6~YC+si ze;31t1<1oU=G42v0&H9mp({lXv2_F`OQRrP_6k=_UYHS@0>1+nqrjL&Kn{9*Nye)| z9+Am2t$&jr3dp-MemLxIH+}ykPsjr(M>9mhwP{NV-Tqi-a|rVGP%r1IuN_7N>M6UB yNxtxbhFgNbUCF^oruby0Sf?uz!B%%Nmv(Uc;x3-KBO?;rK9-w}zd`0@hyMXV9Bn=T diff --git a/SYS/KERNEL.S.CORE.txt b/SYS/KERNEL.S.CORE.txt new file mode 100644 index 00000000..0a0aee94 --- /dev/null +++ b/SYS/KERNEL.S.CORE.txt @@ -0,0 +1,379 @@ +PR#3 +PREFIX /A2OSX.BUILD +LOMEM $A00 +INC 1 +AUTO 6 +*-------------------------------------- +SYS.BASL0 .EQ $800 +*-------------------------------------- +CORE.Run jsr CORE.TskMgrRun + stx A2osX.RANDOM16 + jsr CORE.GetEvents + txa + eor KBD + sta A2osX.RANDOM16+1 + bcs .4 CS=no event + + jsr CORE.DispatchEvents + bcc .4 CC=All Events Dispatched + + >LDYAI TskMgr.Table Select PS0 + >STYA pPs + + lda #EvtMgr.Table + sta pEvent + +.1 lda (pEvent) + beq .3 + + bmi .2 Ignore & Discard any timer event + + jsr RUN.DumpEvent + +.2 jsr CORE.DestroyEvent + +.3 lda pEvent + clc + adc #S.EVT + sta pEvent + lda EVTMGR.COUNT + bne .1 + +.4 lda A2osX.ASCREEN + cmp #2 is SYS active? + bne .6 + + ldx SYS.CPULOADI + lda SYS.CPULOADC,x + sta SYS.BASL0+38 + dex + bpl .5 + ldx #3 +.5 stx SYS.CPULOADI + +.6 bit OPENAPPLE + bpl CORE.Run + + lda KBD + + bpl CORE.Run + + cmp #"1" + bcc CORE.Run + cmp #"5" + bcs CORE.Run + + sta KBDSTROBE + + and #$0F + cmp A2osX.ASCREEN Same as active screen...nothing to do + beq CORE.Run + + tax + + lda A2osX.SCRNDEVS-1,x + beq CORE.Run No device claimed this screen + + jsr K.GetDevByID.A x unmodified..... + bcs CORE.Run ??? + + stx A2osX.ASCREEN + + >STYA pDev + + ldx #DEVMGR.CONTROL + jsr pDevJmp + jmp CORE.Run +*-------------------------------------- +RUN.DumpEvent ldy #S.EVT-1 + +.1 >PUSHB (pEvent),y + dey + bpl .1 + + >LDYAI .2 + jmp K.PrintF.YA + +.2 >CSTR "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n" +*-------------------------------------- +SYS.CPULOADI .BS 1 +SYS.CPULOADC .AS "|/-\" +*-------------------------------------- +CORE.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0 + >STYA pPs + + lda TskMgr.Count + sta TskMgr.Idx + +.1 dec TskMgr.Idx skip PS 0 + beq .8 + + lda (pPs) get S.PS.F + bit #S.PS.F.INUSE In use ? + beq .7 + + bit #S.PS.F.HOLD Waiting for Another Task to Terminate? + beq .2 + + ldy #S.PS.CPID + lda (pPs),y + jsr K.GetPSByID.A + bcc .7 yes, running.... + + lda (pPs) get S.PS.F + and #$FF^S.PS.F.HOLD unmark as HOLD + sta (pPs) + +.2 jsr PS.Select + + lda (pPS) + bit #S.PS.F.INIT + bne .30 + + bit #S.PS.F.SLEEP Is this PS sleeping? + beq .3 no, call TSKMGR.RUN + + jsr CORE.PSWakeUp + bra .4 + +.30 and #$FF^S.PS.F.INIT unmark as INIT + sta (pPS) + + ldx #TSKMGR.INIT + .HS 2C BIT abs +.3 ldx #TSKMGR.RUN + +.31 jsr pCodeJmp Call INIT/RUN function + +.4 bcc .7 INIT/RUN said CS=QUIT? + + pha save RC + ldy #S.PS.PPID Notify Parent Process for exit code... + lda (pPs),y + jsr K.GetPSByID.A will set ZPPtr1 if success + bcs .5 parent is dead.....skipping... + + lda (ZPPtr1) Parent PS is HOLD? + bit #S.PS.F.HOLD + beq .5 no... + + eor #S.PS.F.HOLD yes, release hold... + sta (ZPPtr1) + + pla ...probably waiting for this PS to terminate.... + ldy #S.PS.RC give it RC + sta (ZPPtr1),y + + .HS B0 BCS +.5 pla + +.6 ldx #TSKMGR.QUIT yes, quit this process + jsr pCodeJmp Call QUIT function + + ldy #S.PS.PID + lda (pPs),y + jsr PS.Free.A + +.7 lda pPs + clc + adc #S.PS + sta pPs + bcc .1 + inc pPs+1 + bcs .1 Always + +.8 clc + rts +*-------------------------------------- +CORE.PSWakeUp and #$FF^S.PS.F.SLEEP unmark as SLEEP + sta (pPS) + + ldy #S.PS.PC + lda (pPs),y + sec Advance PC by one as it was saved by a JSR + adc pCode setup by PS.Select + sta .1+1 + iny + lda (pPs),y + adc pCode+1 + sta .1+2 + +.1 jmp $FFFF +*-------------------------------------- +* CORE.DispatchEvents +* IN: +* OUT: +* CS: Not Dispatched +* CC: Event Cleared +*-------------------------------------- +CORE.DispatchEvents + >LDYAI TskMgr.Table+S.PS + >STYA pPs + + lda TskMgr.Count Number of actual processes... + sta TskMgr.Idx ...to give event list + +.1 dec TskMgr.Idx skip PS 0 + beq .9 + + lda (pPs) get S.PS.F + bpl .4 + +* bit #S.PS.F.INUSE In use ? +* beq .4 + + bit #S.PS.F.INIT+S.PS.F.HOLD Init or Waiting for Another Task to Terminate? + bne .4 + + bit #S.PS.F.EVENT Accept Events ? + beq .4 + + jsr PS.Select + + lda #EvtMgr.Table + sta pEvent Select first event in list + + lda EVTMGR.COUNT + sta TSKMGR.EVENTCNT + +.2 lda (pEvent) Empty event, select next + beq .3 + + lda (pCode) + cmp #H.BIN.HEADER.BIN65 + bne * + + ldx #TSKMGR.DOEVENT + jsr pCodeJmp Call DOEVENT function + bcs .3 not for this PS, try next event in list + + jsr CORE.DestroyEvent this PS handled the EVT, destroy it... + lda EVTMGR.COUNT + beq .8 no more event, exit + +.3 dec TSKMGR.EVENTCNT + beq .4 all EVT submitted to this PS, try other PS + + lda pEvent try next EVT to this PS + clc + adc #S.EVT + sta pEvent + bra .2 + +.4 lda pPs go to next PS in PS list + clc + adc #S.PS + sta pPs + bcc .1 + inc pPs+1 + bne .1 always + +.8 clc + rts + +.9 sec + rts +*-------------------------------------- +CORE.TskMgrQuit clc + rts +*-------------------------------------- +TskMgr.Idx .BS 1 +TSKMGR.EVENTCNT .BS 1 +*-------------------------------------- +* CORE.GetEvents : +* IN : +* OUT : +* CS = no event, A = ERROR +* CC * event in YA +* (pEvent) +*-------------------------------------- +CORE.GetEvents lda #EvtMgr.Table + sta pEvent point to start of event list + + stz EvtMgr.Count reset Size + + lda K.IrkMgr.VBL do we have IRQ enabled for VBL ? + bpl .10 no, regular poll + + lda K.IrkMgr.VBLINT + beq .3 no + + dec K.IrkMgr.VBLINT + bra .11 + +.10 lda VBL get VLINE status + tax + eor EvtMgr.VBLState + bpl .3 no change,no tick + txa + sta EvtMgr.VBLState save new + bpl .3 Up2down transition,no tick + +.11 inc A2osX.TIMER16 + bne .1 + inc A2osX.TIMER16+1 + +.1 dec EvtMgr.HZ.CNT + bne .3 not yet 100ms + + ldx A2osX.HZ + stx EvtMgr.HZ.CNT + + lda #S.EVT.F.T10TH + + dec EvtMgr.10TH.CNT + bne .2 + + ldx #10 + stx EvtMgr.10TH.CNT + + ora #S.EVT.F.T1SEC + +.2 sta (pEvent) + jsr CORE.GetEvents.Add +.3 + sec + lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event" + beq .9 + +.8 clc +.9 rts +*-------------------------------------- +CORE.GetEvents.Add + inc EvtMgr.Count Add one event to Queue + + lda pEvent + clc + adc #S.EVT + sta pEvent + rts if CS, EVT queue full!!! ($100) +*-------------------------------------- +CORE.DestroyEvent + lda (pEvent) + beq .9 + + bit #S.EVT.F.hMEM1 + beq .1 + + pha + ldy #S.EVT.DATALO + lda (pEvent),y + jsr K.FreeMem.A + pla + +.1 bit #S.EVT.F.hMEM2 + beq .2 + + ldy #S.EVT.DATAHI + lda (pEvent),y + jsr K.FreeMem.A + +.2 lda #0 + sta (pEvent) + dec EvtMgr.Count +.9 rts +*-------------------------------------- +MAN +SAVE /A2OSX.SRC/SYS/KERNEL.S.CORE +LOAD /A2OSX.SRC/SYS/KERNEL.S +ASM diff --git a/SYS/KERNEL.S.EVT.txt b/SYS/KERNEL.S.EVT.txt deleted file mode 100644 index 93b58493..00000000 --- a/SYS/KERNEL.S.EVT.txt +++ /dev/null @@ -1,105 +0,0 @@ -PR#3 -PREFIX /A2OSX.BUILD -LOMEM $A00 -INC 1 -AUTO 6 -*-------------------------------------- -* EVT.GetEvents : -* IN : -* OUT : -* CS = no event, A = ERROR -* CC * event in YA -* (pEvent) -*-------------------------------------- -EVT.GetEvents lda #EvtMgr.Table - sta pEvent point to start of event list - - stz EvtMgr.Count reset Size - - lda K.IrkMgr.VBL do we have IRQ enabled for VBL ? - bpl .10 no, regular poll - - lda K.IrkMgr.VBLINT - beq .3 no - - dec K.IrkMgr.VBLINT - bra .11 - -.10 lda VBL get VLINE status - tax - eor EvtMgr.VBLState - bpl .3 no change,no tick - txa - sta EvtMgr.VBLState save new - bpl .3 Up2down transition,no tick - -.11 inc A2osX.TIMER16 - bne .1 - inc A2osX.TIMER16+1 - -.1 dec EvtMgr.HZ.CNT - bne .3 not yet 100ms - - ldx A2osX.HZ - stx EvtMgr.HZ.CNT - - lda #S.EVT.F.T10TH - - dec EvtMgr.10TH.CNT - bne .2 - - ldx #10 - stx EvtMgr.10TH.CNT - - ora #S.EVT.F.T1SEC - -.2 sta (pEvent) - jsr EVT.GetEvents.Add -.3 - sec - lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event" - beq .9 - -.8 clc -.9 rts -*-------------------------------------- -EVT.GetEvents.Add - inc EvtMgr.Count Add one event to Queue - - lda pEvent - clc - adc #S.EVT - sta pEvent - rts if CS, EVT queue full!!! ($100) -*-------------------------------------- -EVT.DestroyEvent - lda (pEvent) - beq .9 - - bit #S.EVT.F.hMEM1 - beq .1 - - pha - ldy #S.EVT.DATALO - lda (pEvent),y - jsr K.FreeMem.A - pla - -.1 bit #S.EVT.F.hMEM2 - beq .2 - - ldy #S.EVT.DATAHI - lda (pEvent),y - jsr K.FreeMem.A - -.2 lda #0 - sta (pEvent) - dec EvtMgr.Count -.9 rts -*-------------------------------------- -EvtMgr.Idx .BS 1 -*-------------------------------------- -MAN -SAVE /A2OSX.SRC/SYS/KERNEL.S.EVT -LOAD /A2OSX.SRC/SYS/KERNEL.S -ASM diff --git a/SYS/KERNEL.S.GP.txt b/SYS/KERNEL.S.GP.txt index d0ec0f77..80b551c3 100644 --- a/SYS/KERNEL.S.GP.txt +++ b/SYS/KERNEL.S.GP.txt @@ -44,7 +44,7 @@ AUTO 6 .BS $BD20-* *-------------------------------------- GO.Reset jsr GO.A2osX - jmp K.KernelRun + jmp CORE.Run *-------------------------------------- * *** MUST BE REINTRANT *** *-------------------------------------- diff --git a/SYS/KERNEL.S.INIT.txt b/SYS/KERNEL.S.INIT.txt index 53299093..fc17a367 100644 --- a/SYS/KERNEL.S.INIT.txt +++ b/SYS/KERNEL.S.INIT.txt @@ -163,7 +163,7 @@ Kernel.Init3 sta SETALTZP bit RRAMWRAMBNK2 bit RRAMWRAMBNK2 - jmp K.KernelRun + jmp CORE.Run .9 >PUSHA >LDYAI MSG.StartupErr diff --git a/SYS/KERNEL.S.PS.txt b/SYS/KERNEL.S.PS.txt index a5518d24..49b11695 100644 --- a/SYS/KERNEL.S.PS.txt +++ b/SYS/KERNEL.S.PS.txt @@ -235,7 +235,7 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS .9 rts *-------------------------------------- PS.Init >LDYA K.CreateProcess.CmdLine - jsr PS.CmdLine2Args.YA + jsr PS.CmdLine2Args bcs .9 phy save PTR to Args[0]... @@ -313,7 +313,10 @@ PS.Free.A jsr K.GetPSByID.A PS in ZPPtr1 ldy #S.PS.hPREFIX jsr PS.Free.A.PsY -.1 ldy #S.PS.hDS +.1 ldy #S.PS.hSS + jsr PS.Free.A.PsY + + ldy #S.PS.hDS jsr PS.Free.A.PsY ldy #S.PS.hCS @@ -334,12 +337,19 @@ PS.Select ldy #S.PS.hCS jsr K.GetMemPtr.A >STYA pCode - ldy #S.PS.hDS + iny +* ldy #S.PS.hDS lda (pPs),y - beq .8 + beq .1 jsr K.GetMemPtr.A >STYA pData + +.1 iny +* ldy #S.PS.hSS + lda (pPs),y + jsr K.GetMemPtr.A + >STYA pStack .8 clc rts @@ -372,75 +382,63 @@ PS.DupEnv.A jsr K.GetMemPtr.A .8 txa clc .9 rts -*/-------------------------------------- -* # CmdLine2Args.YA -* Convert a CSTR (e.g. : command Line) to Args[] -* ## In: -* Y,A = PTR to String -* ## Out: -* CC : success -* Y,A = PTR to StrArray -* X = hMem -* CS : error -* A = SYS error code -*\-------------------------------------- -PS.CmdLine2Args.YA - >STYA ZPPtr1 - lda (ZPPtr1) Get mem size STRLEN+1 - inc +*-------------------------------------- +PS.CmdLine2Args >STYA ZPPtr1 + + ldy #0 + +.1 lda (ZPPtr1),y compute strlen in Y,X + beq .2 + cmp #'"' skip "" in computation.... + beq .1 + iny + bne .1 max 255 + +.2 tya +2 for ending 0 for last string, and endig 0 for array + clc + adc #2 tay - lda #0 + bcc .3 + inc - jsr K.GetMem.YA +.3 jsr K.GetMem.YA bcs .9 phx save hMem phy save PTR.LO pha save PTR.HI >STYA ZPPtr2 - lda (ZPPtr1) - tax count in src string + stz PS.CmdLine2Args.bInQuote + + ldy #0 + ldx #0 Arg Count + +.4 lda (ZPPtr1),y beq .8 - ldy #0 reset index in dst token - -.3 inc ZPPtr1 get... + cmp #'"' found a quote ? + bne .5 + lda PS.CmdLine2Args.bInQuote + eor #$ff + sta PS.CmdLine2Args.bInQuote + bra .71 + +.5 cmp #' ' + bne .70 + + bit PS.CmdLine2Args.bInQuote + bmi .70 + + inx Found one arg !!! + lda #0 + +.70 sta (ZPPtr2) yes, set this token len +.71 inc ZPPtr2 + bne .72 + inc ZPPtr2+1 +.72 iny bne .4 - inc ZPPtr1+1 -.4 lda (ZPPtr1) ...next char - - cmp #' ' found a space ? - bne .6 - - tya in a token ? - beq .7 no, skip & go to next char - - sta (ZPPtr2) yes, set this token len - sec - adc ZPPtr2 advance to next token - sta ZPPtr2 - bcc .5 - inc ZPPtr2+1 - -.5 ldy #0 reset index in dst token - bra .7 - -.6 iny add char to token - sta (ZPPtr2),y - -.7 dex end of src string? - bne .3 no...next char... - - tya yes, are we in a token ? - beq .8 - - sta (ZPPtr2) yes, set last token len - sec - adc ZPPtr2 advance to next token - sta ZPPtr2 - bcc .8 - inc ZPPtr2+1 .8 lda #0 sta (ZPPtr2) set Array Ending 0 @@ -449,7 +447,9 @@ PS.CmdLine2Args.YA ply get back PTR.LO plx get back hMem clc -.9 rts +.9 rts + +PS.CmdLine2Args.bInQuote *-------------------------------------- MAN SAVE /A2OSX.SRC/SYS/KERNEL.S.PS diff --git a/SYS/KERNEL.S.RUN.txt b/SYS/KERNEL.S.RUN.txt deleted file mode 100644 index d8458ac2..00000000 --- a/SYS/KERNEL.S.RUN.txt +++ /dev/null @@ -1,104 +0,0 @@ -PR#3 -PREFIX /A2OSX.BUILD -LOMEM $A00 -INC 1 -AUTO 6 -*-------------------------------------- -SYS.BASL0 .EQ $800 -*-------------------------------------- -K.KernelRun jsr TSK.TskMgrRun - stx A2osX.RANDOM16 - jsr EVT.GetEvents - txa - eor KBD - sta A2osX.RANDOM16+1 - bcs .4 CS=no event - - jsr TSK.DispatchEvents - bcc .4 CC=All Events Dispatched - - >LDYAI TskMgr.Table Select PS0 - >STYA pPs - - lda #EvtMgr.Table - sta pEvent - -.1 lda (pEvent) - beq .3 - - bmi .2 Ignore & Discard any timer event - - jsr RUN.DumpEvent - -.2 jsr EVT.DestroyEvent - -.3 lda pEvent - clc - adc #S.EVT - sta pEvent - lda EVTMGR.COUNT - bne .1 - -.4 lda A2osX.ASCREEN - cmp #2 is SYS active? - bne .6 - - ldx SYS.CPULOADI - lda SYS.CPULOADC,x - sta SYS.BASL0+38 - dex - bpl .5 - ldx #3 -.5 stx SYS.CPULOADI - -.6 bit OPENAPPLE - bpl K.KernelRun - - lda KBD - - bpl K.KernelRun - - cmp #"1" - bcc K.KernelRun - cmp #"5" - bcs K.KernelRun - - sta KBDSTROBE - - and #$0F - cmp A2osX.ASCREEN Same as active screen...nothing to do - beq K.KernelRun - - tax - - lda A2osX.SCRNDEVS-1,x - beq K.KernelRun No device claimed this screen - - jsr K.GetDevByID.A x unmodified..... - bcs K.KernelRun ??? - - stx A2osX.ASCREEN - - >STYA pDev - - ldx #DEVMGR.CONTROL - jsr pDevJmp - jmp K.KernelRun -*-------------------------------------- -RUN.DumpEvent ldy #S.EVT-1 - -.1 >PUSHB (pEvent),y - dey - bpl .1 - - >LDYAI MSG.DumpEvent - jmp K.PrintF.YA -*-------------------------------------- -MSG.DumpEvent >CSTR "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n" -SYS.CPULOADI .BS 1 -SYS.CPULOADC .AS "|/-\" -*-------------------------------------- -MAN -SAVE /A2OSX.SRC/SYS/KERNEL.S.RUN -LOAD /A2OSX.SRC/SYS/KERNEL.S -ASM diff --git a/SYS/KERNEL.S.TSK.txt b/SYS/KERNEL.S.TSK.txt deleted file mode 100644 index 2b287f40..00000000 --- a/SYS/KERNEL.S.TSK.txt +++ /dev/null @@ -1,193 +0,0 @@ -PR#3 -PREFIX /A2OSX.BUILD -LOMEM $A00 -INC 1 -AUTO 6 -*-------------------------------------- -* TSK.TskMgrRun -*-------------------------------------- -TSK.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0 - >STYA pPs - - lda TskMgr.Count - sta TskMgr.Idx - -.1 dec TskMgr.Idx skip PS 0 - beq .8 - - lda (pPs) get S.PS.F - bit #S.PS.F.INUSE In use ? - beq .7 - - bit #S.PS.F.HOLD Waiting for Another Task to Terminate? - beq .2 - - ldy #S.PS.CPID - lda (pPs),y - jsr K.GetPSByID.A - bcc .7 yes, running.... - - lda (pPs) get S.PS.F - and #$FF^S.PS.F.HOLD unmark as HOLD - sta (pPs) - -.2 jsr PS.Select - - lda (pPS) - bit #S.PS.F.INIT - bne .30 - - bit #S.PS.F.SLEEP Is this PS sleeping? - beq .3 no, call TSKMGR.RUN - - jsr TSK.PSWakeUp - bra .4 - -.30 and #$FF^S.PS.F.INIT unmark as INIT - sta (pPS) - - ldx #TSKMGR.INIT - .HS 2C BIT abs -.3 ldx #TSKMGR.RUN - -.31 jsr pCodeJmp Call INIT/RUN function - -.4 bcc .7 INIT/RUN said CS=QUIT? - - pha save RC - ldy #S.PS.PPID Notify Parent Process for exit code... - lda (pPs),y - jsr K.GetPSByID.A will set ZPPtr1 if success - bcs .5 parent is dead.....skipping... - - lda (ZPPtr1) Parent PS is HOLD? - bit #S.PS.F.HOLD - beq .5 no... - - eor #S.PS.F.HOLD yes, release hold... - sta (ZPPtr1) - - pla ...probably waiting for this PS to terminate.... - ldy #S.PS.RC give it RC - sta (ZPPtr1),y - - .HS B0 BCS -.5 pla - -.6 ldx #TSKMGR.QUIT yes, quit this process - jsr pCodeJmp Call QUIT function - - ldy #S.PS.PID - lda (pPs),y - jsr PS.Free.A - -.7 lda pPs - clc - adc #S.PS - sta pPs - bcc .1 - inc pPs+1 - bcs .1 Always - -.8 clc - rts -*-------------------------------------- -TSK.PSWakeUp and #$FF^S.PS.F.SLEEP unmark as SLEEP - sta (pPS) - - ldy #S.PS.PC - lda (pPs),y - sec Advance PC by one as it was saved by a JSR - adc pCode setup by PS.Select - sta .1+1 - iny - lda (pPs),y - adc pCode+1 - sta .1+2 - -.1 jmp $FFFF -*-------------------------------------- -* TSK.DispatchEvents -* IN: -* OUT: -* CS: Not Dispatched -* CC: Event Cleared -*-------------------------------------- -TSK.DispatchEvents - >LDYAI TskMgr.Table+S.PS - >STYA pPs - - lda TskMgr.Count Number of actual processes... - sta TskMgr.Idx ...to give event list - -.1 dec TskMgr.Idx skip PS 0 - beq .9 - - lda (pPs) get S.PS.F - bpl .4 - -* bit #S.PS.F.INUSE In use ? -* beq .4 - - bit #S.PS.F.INIT+S.PS.F.HOLD Init or Waiting for Another Task to Terminate? - bne .4 - - bit #S.PS.F.EVENT Accept Events ? - beq .4 - - jsr PS.Select - - lda #EvtMgr.Table - sta pEvent Select first event in list - - lda EVTMGR.COUNT - sta TSKMGR.EVENTCNT - -.2 lda (pEvent) Empty event, select next - beq .3 - - lda (pCode) - cmp #H.BIN.HEADER.BIN65 - bne * - - ldx #TSKMGR.DOEVENT - jsr pCodeJmp Call DOEVENT function - bcs .3 not for this PS, try next event in list - - jsr EVT.DestroyEvent this PS handled the EVT, destroy it... - lda EVTMGR.COUNT - beq .8 no more event, exit - -.3 dec TSKMGR.EVENTCNT - beq .4 all EVT submitted to this PS, try other PS - - lda pEvent try next EVT to this PS - clc - adc #S.EVT - sta pEvent - bra .2 - -.4 lda pPs go to next PS in PS list - clc - adc #S.PS - sta pPs - bcc .1 - inc pPs+1 - bne .1 always - -.8 clc - rts - -.9 sec - rts -*-------------------------------------- -TSK.TskMgrQuit clc - rts -*-------------------------------------- -TskMgr.Idx .BS 1 -TSKMGR.EVENTCNT .BS 1 -*-------------------------------------- -MAN -SAVE /A2OSX.SRC/SYS/KERNEL.S.TSK -LOAD /A2OSX.SRC/SYS/KERNEL.S -ASM diff --git a/SYS/KERNEL.S.txt b/SYS/KERNEL.S.txt index 1e6f4029..964c620e 100644 --- a/SYS/KERNEL.S.txt +++ b/SYS/KERNEL.S.txt @@ -43,12 +43,10 @@ A2osX.D2 .PH $D000 .INB /A2OSX.SRC/SYS/KERNEL.S.PS .INB /A2OSX.SRC/SYS/KERNEL.S.ARG .INB /A2OSX.SRC/SYS/KERNEL.S.ENV - .INB /A2OSX.SRC/SYS/KERNEL.S.EVT - .INB /A2OSX.SRC/SYS/KERNEL.S.TSK - .INB /A2OSX.SRC/SYS/KERNEL.S.RUN .EP A2osX.E0 .PH $E000 .INB /A2OSX.SRC/SYS/KERNEL.S.JMP + .INB /A2OSX.SRC/SYS/KERNEL.S.CORE .INB /A2OSX.SRC/SYS/KERNEL.S.DAT .INB /A2OSX.SRC/SYS/KERNEL.S.IRQ .INB /A2OSX.SRC/SYS/KERNEL.S.MEM