mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-19 07:30:41 +00:00
Kernel 0.94
This commit is contained in:
parent
d0ee02a961
commit
b5a45c1101
@ -37,14 +37,19 @@ CS.START cld
|
|||||||
.DA CS.RUN
|
.DA CS.RUN
|
||||||
.DA CS.DOEVENT
|
.DA CS.DOEVENT
|
||||||
.DA CS.QUIT
|
.DA CS.QUIT
|
||||||
L.MSGPS .DA MSGPS
|
L.MSG.USAGE .DA MSG.USAGE
|
||||||
L.MSGDEV .DA MSGDEV
|
L.MSG.SHUTDOWN .DA MSG.SHUTDOWN
|
||||||
|
L.MSG.PS .DA MSG.PS
|
||||||
|
L.MSG.DEV .DA MSG.DEV
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT clc
|
CS.INIT clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN jsr CS.RUN.PS
|
CS.RUN >LDYA L.MSG.SHUTDOWN
|
||||||
|
>SYSCALL PutS
|
||||||
|
|
||||||
|
jsr CS.RUN.PS
|
||||||
|
|
||||||
jsr CS.RUN.DEV
|
jsr CS.RUN.DEV
|
||||||
|
|
||||||
@ -57,8 +62,7 @@ CS.RUN jsr CS.RUN.PS
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.PS
|
CS.RUN.PS stz Count
|
||||||
.10 stz Count
|
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
stx Index
|
stx Index
|
||||||
@ -69,10 +73,16 @@ CS.RUN.PS
|
|||||||
>SYSCALL GetMemPtr
|
>SYSCALL GetMemPtr
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
lda (ZPPtr1)
|
.2 lda (ZPPtr1)
|
||||||
bmi .6 HOLD
|
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
|
lda (ZPPtr1),y
|
||||||
cmp #S.PS.S.QUIT
|
cmp #S.PS.S.QUIT
|
||||||
beq .6
|
beq .6
|
||||||
@ -87,7 +97,28 @@ CS.RUN.PS
|
|||||||
cmp (pPS),y don't kill myself
|
cmp (pPS),y don't kill myself
|
||||||
beq .7
|
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
|
ldy #S.PS.PID
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
>PUSHA
|
>PUSHA
|
||||||
@ -105,22 +136,7 @@ CS.RUN.PS
|
|||||||
ldy #S.PS.PID
|
ldy #S.PS.PID
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
>SYSCALL Kill
|
>SYSCALL Kill
|
||||||
|
rts
|
||||||
.6 inc Count
|
|
||||||
|
|
||||||
.7 >SLEEP
|
|
||||||
|
|
||||||
inc Index
|
|
||||||
ldx Index
|
|
||||||
cpx #K.PS.MAX
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
lda Count
|
|
||||||
beq .8
|
|
||||||
|
|
||||||
jmp .10
|
|
||||||
|
|
||||||
.8 rts
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.DEV ldx #1
|
CS.RUN.DEV ldx #1
|
||||||
stx Index
|
stx Index
|
||||||
@ -131,7 +147,7 @@ CS.RUN.DEV ldx #1
|
|||||||
sta ZPPtr1+1
|
sta ZPPtr1+1
|
||||||
beq .7
|
beq .7
|
||||||
|
|
||||||
>PUSHW L.MSGDEV
|
>PUSHW L.MSG.DEV
|
||||||
>PUSHB Index
|
>PUSHB Index
|
||||||
|
|
||||||
lda ZPPtr1
|
lda ZPPtr1
|
||||||
@ -155,6 +171,36 @@ CS.RUN.DEV ldx #1
|
|||||||
|
|
||||||
rts
|
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
|
CS.DOEVENT sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -162,8 +208,11 @@ CS.QUIT clc
|
|||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.END
|
CS.END
|
||||||
MSGPS .AZ "SHUTDOWN:Killing process %3d, %s\r\n"
|
MSG.USAGE .AS "Usage : SHUTDOWN <NEXT.STSTEM>\r\n"
|
||||||
MSGDEV .AZ "SHUTDOWN:Closing device %3d, %s\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
|
.DUMMY
|
||||||
.OR 0
|
.OR 0
|
||||||
|
@ -312,8 +312,11 @@ READ php
|
|||||||
|
|
||||||
>AR.SELECT S0.RX.RSR
|
>AR.SELECT S0.RX.RSR
|
||||||
lda W5100.DR,x get the received size HI
|
lda W5100.DR,x get the received size HI
|
||||||
|
nop
|
||||||
|
nop
|
||||||
ora W5100.DR,x LO
|
ora W5100.DR,x LO
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
jmp READWRITE.NODATA
|
jmp READWRITE.NODATA
|
||||||
|
|
||||||
.1 >AR.SELECT S0.RX.RD
|
.1 >AR.SELECT S0.RX.RD
|
||||||
@ -351,11 +354,9 @@ READ php
|
|||||||
|
|
||||||
>LDYA BUF.Size
|
>LDYA BUF.Size
|
||||||
>SYSCALL2 GetMem
|
>SYSCALL2 GetMem
|
||||||
bcc .14
|
bcs READWRITE.9
|
||||||
|
|
||||||
jmp READWRITE.9
|
>STYA ZPBufPtr
|
||||||
|
|
||||||
.14 >STYA ZPBufPtr
|
|
||||||
phx
|
phx
|
||||||
|
|
||||||
phy
|
phy
|
||||||
|
@ -2,7 +2,7 @@ NEW
|
|||||||
AUTO 3,1
|
AUTO 3,1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.D2.SeekTimeR .EQ 160 LIBBLKDEV Recalibration
|
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.SeekTimeB .EQ 85 LIBBLKDEV Boot Block
|
||||||
IO.D2.SeekTimeP .EQ 60 ProDOS.FX initial
|
IO.D2.SeekTimeP .EQ 60 ProDOS.FX initial
|
||||||
IO.D2.SeekTimeI .EQ 20 ProDOS.FX increment -> until > 128
|
IO.D2.SeekTimeI .EQ 20 ProDOS.FX increment -> until > 128
|
||||||
|
@ -204,11 +204,7 @@ CS.RUN.ERRMSG tax
|
|||||||
CS.DOEVENT sec
|
CS.DOEVENT sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.QUIT lda #MLIQUIT
|
CS.QUIT clc
|
||||||
sta .1
|
|
||||||
jsr $BF00
|
|
||||||
.1 lda MLI.PARAMS
|
|
||||||
bcs *
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.END
|
CS.END
|
||||||
|
@ -1,11 +1,19 @@
|
|||||||
NEW
|
NEW
|
||||||
AUTO 3,1
|
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
|
beq .8
|
||||||
|
|
||||||
jsr K.GetMemPtr
|
jsr K.GetMemPtr
|
||||||
@ -24,6 +32,7 @@ CORE.Run stz CORE.PSIndex
|
|||||||
lda (pPS) get S.PS.F again
|
lda (pPS) get S.PS.F again
|
||||||
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 ZP & Ptrs
|
.2 jsr CORE.PSSelect Restore ZP & Ptrs
|
||||||
|
|
||||||
.3 jsr CORE.PSExec INIT/RUN/QUIT/RESUME
|
.3 jsr CORE.PSExec INIT/RUN/QUIT/RESUME
|
||||||
@ -55,13 +64,16 @@ CORE.Run stz CORE.PSIndex
|
|||||||
>PUSHBI 2
|
>PUSHBI 2
|
||||||
ldy #S.PS.PID
|
ldy #S.PS.PID
|
||||||
lda (pPS),y
|
lda (pPS),y
|
||||||
>SYSCALL2 Kill
|
* cmp #1 INITD ?
|
||||||
|
* beq CORE.Quit
|
||||||
|
|
||||||
|
.6 >SYSCALL2 Kill
|
||||||
bra .8
|
bra .8
|
||||||
|
|
||||||
.7 jsr CORE.PSLeave Save ZP & Ptrs
|
.7 jsr CORE.PSLeave Save ZP & Ptrs
|
||||||
|
|
||||||
.8 inc CORE.PSIndex
|
.8 ldx CORE.PSIndex
|
||||||
ldx CORE.PSIndex
|
inx
|
||||||
cpx CORE.PSCount
|
cpx CORE.PSCount
|
||||||
bne .1
|
bne .1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -80,7 +92,9 @@ CORE.Events jsr CORE.GetEvents
|
|||||||
sta pEvent
|
sta pEvent
|
||||||
.1 lda (pEvent)
|
.1 lda (pEvent)
|
||||||
beq .3
|
beq .3
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@ -124,6 +138,7 @@ CORE.UpdateParentPS
|
|||||||
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 .8 no parent process
|
beq .8 no parent process
|
||||||
|
|
||||||
jsr CORE.GetPSByID X unmodified
|
jsr CORE.GetPSByID X unmodified
|
||||||
bcs .8 parent is dead.....skipping...
|
bcs .8 parent is dead.....skipping...
|
||||||
|
|
||||||
@ -137,13 +152,16 @@ CORE.UpdateParentPS
|
|||||||
dey #S.PS.PID
|
dey #S.PS.PID
|
||||||
cmp (pPS),y
|
cmp (pPS),y
|
||||||
bne .8 Hold, but not waiting this PS
|
bne .8 Hold, but not waiting this PS
|
||||||
|
|
||||||
txa waiting for this PS to terminate....
|
txa waiting for this PS to terminate....
|
||||||
ldy #S.PS.RC give it RC
|
ldy #S.PS.RC give it RC
|
||||||
sta (ZPPtr1),y
|
sta (ZPPtr1),y
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
eor #S.PS.F.HOLD release Parent PS HOLD...
|
eor #S.PS.F.HOLD release Parent PS HOLD...
|
||||||
sta (ZPPtr1)
|
sta (ZPPtr1)
|
||||||
|
|
||||||
* clc
|
* clc
|
||||||
|
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* CORE.GetEvents :
|
* CORE.GetEvents :
|
||||||
@ -224,10 +242,13 @@ CORE.GetEvents lda #Evt.Table
|
|||||||
* CS: Not Dispatched
|
* CS: Not Dispatched
|
||||||
* CC: Event Cleared
|
* CC: Event Cleared
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.Dispatch stz CORE.PSIndex
|
CORE.Dispatch ldx #1 skip PS0
|
||||||
bra .5 skip PS0
|
|
||||||
.1 lda PS.Table.hPS,x
|
.1 stx CORE.PSIndex
|
||||||
|
|
||||||
|
lda PS.Table.hPS,x
|
||||||
beq .5
|
beq .5
|
||||||
|
|
||||||
jsr K.GetMemPtr
|
jsr K.GetMemPtr
|
||||||
>STYA pPS
|
>STYA pPS
|
||||||
|
|
||||||
@ -272,8 +293,9 @@ CORE.Dispatch stz CORE.PSIndex
|
|||||||
lda #S.PS.S.RUN
|
lda #S.PS.S.RUN
|
||||||
sta (pPS),y
|
sta (pPS),y
|
||||||
jsr CORE.PSLeave
|
jsr CORE.PSLeave
|
||||||
.5 inc CORE.PSIndex
|
|
||||||
ldx CORE.PSIndex
|
.5 ldx CORE.PSIndex
|
||||||
|
inx
|
||||||
cpx CORE.PSCount
|
cpx CORE.PSCount
|
||||||
bne .1
|
bne .1
|
||||||
* sec
|
* sec
|
||||||
|
@ -670,6 +670,7 @@ K.Kill cmp #0
|
|||||||
asl
|
asl
|
||||||
tax
|
tax
|
||||||
jmp (.1,x)
|
jmp (.1,x)
|
||||||
|
|
||||||
.1 .DA K.Kill.0
|
.1 .DA K.Kill.0
|
||||||
.DA K.Kill.1
|
.DA K.Kill.1
|
||||||
.DA K.Kill.2
|
.DA K.Kill.2
|
||||||
@ -679,7 +680,11 @@ K.Kill cmp #0
|
|||||||
rts
|
rts
|
||||||
.99 >RET 1
|
.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
|
lda #S.PS.S.QUIT
|
||||||
sta (ZPPtr1),y
|
sta (ZPPtr1),y
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user