Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-09-24 08:24:47 +02:00
parent d0ee02a961
commit b5a45c1101
6 changed files with 123 additions and 50 deletions

View File

@ -37,14 +37,19 @@ CS.START cld
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSGPS .DA MSGPS
L.MSGDEV .DA MSGDEV
L.MSG.USAGE .DA MSG.USAGE
L.MSG.SHUTDOWN .DA MSG.SHUTDOWN
L.MSG.PS .DA MSG.PS
L.MSG.DEV .DA MSG.DEV
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN jsr CS.RUN.PS
CS.RUN >LDYA L.MSG.SHUTDOWN
>SYSCALL PutS
jsr CS.RUN.PS
jsr CS.RUN.DEV
@ -57,8 +62,7 @@ CS.RUN jsr CS.RUN.PS
sec
rts
*--------------------------------------
CS.RUN.PS
.10 stz Count
CS.RUN.PS stz Count
ldx #0
stx Index
@ -69,10 +73,16 @@ CS.RUN.PS
>SYSCALL GetMemPtr
>STYA ZPPtr1
lda (ZPPtr1)
bmi .6 HOLD
.2 lda (ZPPtr1)
bpl .4 HOLD ?
ldy #S.PS.S
ldy #S.PS.CPID
lda (ZPPtr1),y
.3 jsr CS.GetPSByID
bra .2
.4 ldy #S.PS.S
lda (ZPPtr1),y
cmp #S.PS.S.QUIT
beq .6
@ -87,7 +97,28 @@ CS.RUN.PS
cmp (pPS),y don't kill myself
beq .7
>PUSHW L.MSGPS
jsr CS.RUN.KILL
.5 ldy #S.PS.PPID
lda (ZPPtr1),y
bne .3 go kill parent if not 0
.6 inc Count
.7 >SLEEP
inc Index
ldx Index
cpx #K.PS.MAX
bne .1
lda Count
bne CS.RUN.PS
sec
rts
*--------------------------------------
CS.RUN.KILL >PUSHW L.MSG.PS
ldy #S.PS.PID
lda (ZPPtr1),y
>PUSHA
@ -105,22 +136,7 @@ CS.RUN.PS
ldy #S.PS.PID
lda (ZPPtr1),y
>SYSCALL Kill
.6 inc Count
.7 >SLEEP
inc Index
ldx Index
cpx #K.PS.MAX
bne .1
lda Count
beq .8
jmp .10
.8 rts
rts
*--------------------------------------
CS.RUN.DEV ldx #1
stx Index
@ -131,7 +147,7 @@ CS.RUN.DEV ldx #1
sta ZPPtr1+1
beq .7
>PUSHW L.MSGDEV
>PUSHW L.MSG.DEV
>PUSHB Index
lda ZPPtr1
@ -155,6 +171,36 @@ CS.RUN.DEV ldx #1
rts
*--------------------------------------
CS.GetPSByID ldx #0
.1 ldy PS.Table.hPS,x
beq .7
pha
tya
phx
>SYSCALL GetMemPtr
>STYA ZPPtr1
plx
pla
ldy #S.PS.PID
cmp (ZPPtr1),y
beq .8
.7 inx
cpx #K.PS.MAX
bne .1
* sec
rts
.8 clc
rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
@ -162,8 +208,11 @@ CS.QUIT clc
rts
*--------------------------------------
CS.END
MSGPS .AZ "SHUTDOWN:Killing process %3d, %s\r\n"
MSGDEV .AZ "SHUTDOWN:Closing device %3d, %s\r\n"
MSG.USAGE .AS "Usage : SHUTDOWN <NEXT.STSTEM>\r\n"
.AZ " -T <seconds> : \r\n"
MSG.SHUTDOWN .AZ "SHUTDOWN:System..."
MSG.PS .AZ "SHUTDOWN:Killing process %3d, %s\r\n"
MSG.DEV .AZ "SHUTDOWN:Closing device %3d, %s\r\n"
*--------------------------------------
.DUMMY
.OR 0

View File

@ -312,8 +312,11 @@ READ php
>AR.SELECT S0.RX.RSR
lda W5100.DR,x get the received size HI
nop
nop
ora W5100.DR,x LO
bne .1
jmp READWRITE.NODATA
.1 >AR.SELECT S0.RX.RD
@ -351,11 +354,9 @@ READ php
>LDYA BUF.Size
>SYSCALL2 GetMem
bcc .14
bcs READWRITE.9
jmp READWRITE.9
.14 >STYA ZPBufPtr
>STYA ZPBufPtr
phx
phy

View File

@ -2,7 +2,7 @@ NEW
AUTO 3,1
*--------------------------------------
IO.D2.SeekTimeR .EQ 160 LIBBLKDEV Recalibration
IO.D2.SeekTimeF .EQ 85 LIBBLKDEV Track Formatter
IO.D2.SeekTimeF .EQ 115 LIBBLKDEV Track Formatter
IO.D2.SeekTimeB .EQ 85 LIBBLKDEV Boot Block
IO.D2.SeekTimeP .EQ 60 ProDOS.FX initial
IO.D2.SeekTimeI .EQ 20 ProDOS.FX increment -> until > 128

View File

@ -204,11 +204,7 @@ CS.RUN.ERRMSG tax
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT lda #MLIQUIT
sta .1
jsr $BF00
.1 lda MLI.PARAMS
bcs *
CS.QUIT clc
rts
*--------------------------------------
CS.END

View File

@ -1,11 +1,19 @@
NEW
AUTO 3,1
*--------------------------------------
CORE.Run stz CORE.PSIndex
CORE.Quit ldx #5
bra .8 Skip PS0
.1 stz K.MLI.PARAMS,x
dex
bpl .1
>MLICALL MLIQUIT
*--------------------------------------
CORE.Run ldx #1 Skip PS0
.1 lda PS.Table.hPS,x
.1 stx CORE.PSIndex
lda PS.Table.hPS,x
beq .8
jsr K.GetMemPtr
@ -24,6 +32,7 @@ CORE.Run stz CORE.PSIndex
lda (pPS) get S.PS.F again
eor #S.PS.F.HOLD unmark as HOLD
sta (pPS)
.2 jsr CORE.PSSelect Restore ZP & Ptrs
.3 jsr CORE.PSExec INIT/RUN/QUIT/RESUME
@ -55,13 +64,16 @@ CORE.Run stz CORE.PSIndex
>PUSHBI 2
ldy #S.PS.PID
lda (pPS),y
>SYSCALL2 Kill
* cmp #1 INITD ?
* beq CORE.Quit
.6 >SYSCALL2 Kill
bra .8
.7 jsr CORE.PSLeave Save ZP & Ptrs
.8 inc CORE.PSIndex
ldx CORE.PSIndex
.8 ldx CORE.PSIndex
inx
cpx CORE.PSCount
bne .1
*--------------------------------------
@ -80,7 +92,9 @@ CORE.Events jsr CORE.GetEvents
sta pEvent
.1 lda (pEvent)
beq .3
bmi .2 Ignore & Discard any timer event
* jsr CORE.DumpEvent
.2 jsr CORE.DestroyEvent
@ -124,6 +138,7 @@ CORE.UpdateParentPS
ldy #S.PS.PPID Notify Parent Process for exit code...
lda (pPS),y
beq .8 no parent process
jsr CORE.GetPSByID X unmodified
bcs .8 parent is dead.....skipping...
@ -137,13 +152,16 @@ CORE.UpdateParentPS
dey #S.PS.PID
cmp (pPS),y
bne .8 Hold, but not waiting this PS
txa waiting for this PS to terminate....
ldy #S.PS.RC give it RC
sta (ZPPtr1),y
lda (ZPPtr1)
eor #S.PS.F.HOLD release Parent PS HOLD...
sta (ZPPtr1)
* clc
.8 rts
*--------------------------------------
* CORE.GetEvents :
@ -224,10 +242,13 @@ CORE.GetEvents lda #Evt.Table
* CS: Not Dispatched
* CC: Event Cleared
*--------------------------------------
CORE.Dispatch stz CORE.PSIndex
bra .5 skip PS0
.1 lda PS.Table.hPS,x
CORE.Dispatch ldx #1 skip PS0
.1 stx CORE.PSIndex
lda PS.Table.hPS,x
beq .5
jsr K.GetMemPtr
>STYA pPS
@ -272,8 +293,9 @@ CORE.Dispatch stz CORE.PSIndex
lda #S.PS.S.RUN
sta (pPS),y
jsr CORE.PSLeave
.5 inc CORE.PSIndex
ldx CORE.PSIndex
.5 ldx CORE.PSIndex
inx
cpx CORE.PSCount
bne .1
* sec

View File

@ -670,6 +670,7 @@ K.Kill cmp #0
asl
tax
jmp (.1,x)
.1 .DA K.Kill.0
.DA K.Kill.1
.DA K.Kill.2
@ -679,7 +680,11 @@ K.Kill cmp #0
rts
.99 >RET 1
*--------------------------------------
K.Kill.1 ldy #S.PS.S
K.Kill.1 lda (ZPPtr1)
and #S.PS.F.SLEEP^$FF
sta (ZPPtr1)
ldy #S.PS.S
lda #S.PS.S.QUIT
sta (ZPPtr1),y