Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-07-19 17:35:19 +02:00
parent fdc45a02f9
commit 1df9d5e505
3 changed files with 83 additions and 81 deletions

View File

@ -527,7 +527,7 @@ S.PS.X .EQ 18
S.PS.Y .EQ 19
S.PS.P .EQ 20
S.PS.PC .EQ 21 WORD
S.PS.ZP.SIZE .EQ 23
*S.PS.ZP.SIZE .EQ 23
S.PS.ZP.SESSION .EQ 24
S.PS.ZP.CODE .EQ 26

View File

@ -482,76 +482,6 @@ CORE.PSResume sei
inc IRQ.InKernel
rti
*--------------------------------------
* CORE.PSFree
* In : A = PID to free
*--------------------------------------
CORE.PSFree sta .10+1 Save PS ID
jsr CORE.GetPSByID S.PS in ZPPtr1
bcs .9
>STYA ZPPtr1
ldy #S.PS.hSID
lda (ZPPtr1),y
tax
lda S.Table.hSession-1,x
jsr K.FreeMem
ldy #S.PS.hSS
jsr .8
ldy #S.PS.hDS
jsr .8
ldy #S.PS.hCS
jsr .8
ldy #S.PS.hARGV
jsr .8
ldy #S.PS.hENV
jsr .8
ldy #S.PS.hPREFIX
jsr .8
ldy #S.PS.hStdOut
lda (ZPPtr1),y
tax
lda OF.Table.hPath-1,x
beq .10 hDEV
lda OF.Table.hFD-1,x hNod
jsr K.GetMemPtr get FD
>STYA pFD
lda (pFD)
cmp #S.FD.T.PIPE
bne .10
txa
ldx #SYS.fclose
jsr K.SYSCALL2.BANK
.10 lda #$ff Self Modified
ldx #0
.2 cmp PS.Table.PID,x
beq .3
inx
cpx CORE.PSCount
bne .2
.3 stz PS.Table.PID,x
lda PS.TABLE.hPS,x
stz PS.TABLE.hPS,x
.4 jmp K.FreeMem
.8 lda (ZPPtr1),y
bne .4
.9 rts
*--------------------------------------
CORE.EvtIndex .BS 1
CORE.EvtCount .BS 1
*--------------------------------------

View File

@ -383,10 +383,12 @@ PS.LoadBIN >LDYAI K.Buf256
tay
bne .3 SS.SIZE.LO=0, set as default $100
beq .3 SS.SIZE.LO=0, set as default $100
lda #1 SS.SIZE.HI
.HS 2C bit abs
.3 lda #0
.3 lda #1
ldx #S.MEM.F.ALIGN+S.MEM.F.STACK
jsr MEM.GetMem.YAX
@ -404,14 +406,14 @@ PS.LoadBIN >LDYAI K.Buf256
jsr Mem.SetOwner Set Ownership
ldy #H.BIN.ZP.SIZE
lda (ZPPtr4),y
clc
adc #8 Add room for 4 saved PTR
ldy #S.PS.ZP.SIZE
sta (PS.NewPSPtr),y
* ldy #H.BIN.ZP.SIZE
* lda (ZPPtr4),y
* clc
* adc #10 Add room for 5 saved PTR
* ldy #S.PS.ZP.SIZE
* sta (PS.NewPSPtr),y
clc
* clc
.9 rts
*--------------------------------------
PS.LoadGetHeader
@ -561,7 +563,7 @@ PS.AddYAp12ArgSize
sta PS.ArgSize+1
rts
*/--------------------------------------
* # ExecL
* # Kill
* ## C
* `int kill(short int pid, short int sig);`
* ## ASM
@ -604,6 +606,76 @@ K.Kill.0
clc
rts
*--------------------------------------
* CORE.PSFree
* In : A = PID to free
*--------------------------------------
CORE.PSFree sta .10+1 Save PS ID
jsr CORE.GetPSByID S.PS in ZPPtr1
bcs .9
>STYA ZPPtr1
ldy #S.PS.hSID
lda (ZPPtr1),y
tax
lda S.Table.hSession-1,x
jsr K.FreeMem
ldy #S.PS.hSS
jsr .8
ldy #S.PS.hDS
jsr .8
ldy #S.PS.hCS
jsr .8
ldy #S.PS.hARGV
jsr .8
ldy #S.PS.hENV
jsr .8
ldy #S.PS.hPREFIX
jsr .8
ldy #S.PS.hStdOut
lda (ZPPtr1),y
tax
lda OF.Table.hPath-1,x
beq .10 hDEV
lda OF.Table.hFD-1,x hNod
jsr K.GetMemPtr get FD
>STYA pFD
lda (pFD)
cmp #S.FD.T.PIPE
bne .10
txa
ldx #SYS.fclose
jsr K.SYSCALL2.BANK
.10 lda #$ff Self Modified
ldx #0
.2 cmp PS.Table.PID,x
beq .3
inx
cpx CORE.PSCount
bne .2
.3 stz PS.Table.PID,x
lda PS.TABLE.hPS,x
stz PS.TABLE.hPS,x
.4 jmp K.FreeMem
.8 lda (ZPPtr1),y
bne .4
.9 rts
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.PS
LOAD USR/SRC/SYS/KERNEL.S