Kernel 0.9.1 : Code reorganization & move to CSTR : External commands (PS)

This commit is contained in:
Rémy GIBERT 2017-09-21 08:35:44 +02:00
parent 832cb80c06
commit 38c8649e23
8 changed files with 50 additions and 21 deletions

Binary file not shown.

Binary file not shown.

View File

@ -12,8 +12,6 @@ AUTO 6
.INB /A2OSX.BUILD/INC/A2OSX.I
*--------------------------------------
ZPPTR1 .EQ ZPBIN
ZPPTR2 .EQ ZPBIN+2
ZPPTR3 .EQ ZPBIN+4
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -40,16 +38,24 @@ L.MSG1 .DA MSG1
CS.INIT clc
rts
*--------------------------------------
CS.RUN >LDYAI TSKMGR.TABLE+S.PS
>STYA ZPPTR1
stz PS.COUNT
CS.RUN >LDYA pData
>SYSCALL GetPSList.YA
>LDYA L.MSG0
>SYSCALL PrintF.YA
.1 lda (ZPPTR1)
bpl .4
lda (pData) PS.COUNT
beq .8
.1 dec
asl
tay
lda (pData),y PID
ldy #S.PS.hARGS
lda (ZPPTR1),y
>SYSCALL GetMemPtr.A
@ -75,12 +81,12 @@ CS.RUN >LDYAI TSKMGR.TABLE+S.PS
bcc .5
inc ZPPTR1+1
.5 inc PS.COUNT
lda PS.COUNT
cmp #K.PS.MAX
.7 lda (pData) PS.COUNT
dec
sta (pData)
bne .1
lda #0 tell TSKMGR that all done ok, but
.8 lda #0 tell Kernel that all done ok, but
sec we do not want to stay in memory
rts
*--------------------------------------
@ -91,9 +97,17 @@ CS.QUIT clc
rts
*--------------------------------------
CS.END
PS.COUNT .BS 1
MSG0 >CSTR "ID Flags PID Command Line\r\n"
MSG1 >CSTR "%03d %b %03d %S\r\n"
*--------------------------------------
.DUMMY
.OR 0
DS.START
PS.COUNT .BS 1
PS.DATA .BS K.PS.MAX+K.PS.MAX
DS.END
.ED
*--------------------------------------
MAN
SAVE /A2OSX.SRC/BIN/PS.S
ASM

View File

@ -263,7 +263,7 @@ SYS.CreateProcessYA .EQ $A6
* .EQ $A8
* .EQ $AA
* .EQ $AC
* .EQ $AE
SYS.GetPSList.YA .EQ $AE
SYS.GetArgC .EQ $B0
SYS.GetArg.A .EQ $B2

View File

@ -8,6 +8,7 @@ AUTO 6
CMD.Init >LDYAI CmdLine.MAX+1
>SYSCALL GetMem.YA
bcs .9
>STYA ZPCMDBuf
txa
>STA.G hCmdBuf
.9 rts

View File

@ -139,11 +139,7 @@ CS.RUN >LDA.G bReadMode READ Command ?
jmp CS.RUN.BATCH
*--------------------------------------
.10 >LDA.G hCmdBuf Get the buffer
>SYSCALL GetMemPtr.A
>STYA ZPCMDBuf
jsr CmdLine.RESET reset it
.10 jsr CmdLine.RESET reset CmdBuf
.12 jsr PrintPrompt
bcs CS.RUN.EXIT.RTS
@ -160,7 +156,7 @@ CS.RUN >LDA.G bReadMode READ Command ?
jsr CMD.Parse
>LDA.G CmdBuflen
beq .12 Empty line
beq .8 Empty line
jsr HIS.Add
@ -507,7 +503,6 @@ CmdLine.RESET lda #0
sta (ZPCMDBuf)
>STA.G bCmdBufexec
>STA.G CmdBuflen
>STA.G bCmdBufExec
>STA.G bSecureRead Clear password mode
rts
*--------------------------------------

View File

@ -107,7 +107,7 @@ K.SYSCALL.JMP .DA 0 $00
.DA 0
.DA 0
.DA 0
.DA 0
.DA K.GetPSList.YA
.DA K.GetArgC $B0
.DA K.GetArg.A

View File

@ -356,6 +356,25 @@ PS.DupEnv.A jsr K.GetMemPtr.A
clc
.9 rts
*--------------------------------------
K.GetPSList.YA >STYA ZPPtr1
lda CORE.PSCount
sta (ZPPtr1)
ldx #0
ldy #1
.1 lda PS.Table.PID,x
sta (ZPPtr1),y
iny
lda PS.Table.hMem,x
sta (ZPPtr1),y
iny
inx
cpx CORE.PSCount
bne .1
rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.PS
LOAD /A2OSX.SRC/SYS/KERNEL.S