Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-05-08 21:41:46 +02:00
parent 88f07d1457
commit c061f48838
10 changed files with 83 additions and 54 deletions

Binary file not shown.

View File

@ -13,7 +13,9 @@ NEW
.OR ZPBIN
ZS.START
ZPPSPtr .BS 2
ZPSessionPtr .BS 2
ZPArgV .BS 2
Index .BS 1
ZS.END
.ED
*--------------------------------------
@ -79,20 +81,18 @@ CS.RUN lda #1
>LDYA L.MSG0
>SYSCALL printf
>LDA.G PS.Index
.1 tax
beq .2 PS0
lda PS.Table.PID,x
ldx Index
.1 lda PS.Table.hPS,x
beq .7
.2 jsr CS.RUN.DUMP
jsr CS.RUN.DUMP
>SLEEP
.7 >INC.G PS.Index
cmp #K.PS.MAX
.7 inc Index
ldx Index
cpx #K.PS.MAX
bne .1
.8 lda #0 tell Kernel that all done ok, but
@ -103,33 +103,41 @@ CS.RUN lda #1
sec
rts
*--------------------------------------
CS.RUN.DUMP phx
lda PS.Table.hPS,x
>SYSCALL GetMemPtr
CS.RUN.DUMP >SYSCALL GetMemPtr
>STYA ZPPSPtr
ldy #S.PS.PPID
lda (ZPPSPtr),y
>PUSHA Parent PID
ldy #S.PS.hSID
lda (ZPPSPtr),y
tax
lda S.Table.hSession-1,x
>SYSCALL GetMemPtr
>STYA ZPSessionPtr
ldy #S.SESSION.UID
lda (ZPSessionPtr),y
>PUSHA
jsr CS.RUN.DecodeFlags
>PUSHEA.G PS.FLAGS
plx
ldx Index
lda PS.Table.Stats,x
>PUSHA CPU%
ldy #S.PS.PID
ldy #S.PS.PPID
lda (ZPPSPtr),y
>PUSHA
>PUSHBI 6
iny S.PS.PID
lda (ZPPSPtr),y
>PUSHA
lda PS.Table.hPS,x
>PUSHA
>PUSHBI 7
>LDYA L.MSG1
>SYSCALL printf
bcs .9
@ -200,8 +208,8 @@ CS.QUIT clc
rts
*--------------------------------------
CS.END
MSG0 .AZ "\e[7lID CPU\% Flags UID PID Command Line\r\n"
MSG1 .AZ "%03d %3d\% %s %03d %03d"
MSG0 .AZ "\e[7lhPS ID PID CPU\% Flags UID Command Line\r\n"
MSG1 .AZ "%3d %3d %3d %3d\% %s %3d"
MSG2 .AZ " %s"
MSG3 .AZ "\r\n"
MSG.FLAGS .AS "IRQDHSEN"
@ -209,7 +217,6 @@ MSG.FLAGS .AS "IRQDHSEN"
.DUMMY
.OR 0
DS.START
PS.Index .BS 1
PS.FLAGS .BS 9
DS.END
.ED

View File

@ -1,6 +1,5 @@
NEW
PREFIX
AUTO 4,1
AUTO 3,1
.LIST OFF
*--------------------------------------
Mem.Table .EQ $0800

View File

@ -510,7 +510,7 @@ SKT.GetDataFromSktIn
ora #S.TCP.OPTIONS.ACK
sta (ZPPtrSKT),y
* jsr TCP.OUT.I SKT.GetTCB already called, Try to ACK read DATA
jsr TCP.OUT.I SKT.GetTCB already called, Try to ACK read DATA
>LDYA ZPTmpPtr3
clc

View File

@ -214,7 +214,7 @@ TCP.IN.JMP.ESTBLSH
jsr SKT.AddDataToSktIn yes, queue data if there is room for....
bcs .2
jsr SKT.StoreTCB success, update socket
.2 ldy #S.TCP.OPTIONS
@ -402,7 +402,8 @@ TCP.IN.SetDataInPtrAndLen
.2 sta ZPDataInPtr
stx ZPDataInPtr+1
rts
TCP.IN.RTS rts
*--------------------------------------
TCP.OUT jsr SKT.GetTCB
@ -431,16 +432,18 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
>LDYAI K.TCP.MSS yes send only MSS
.2 jsr TCP.NewFrame
bcs TCP.OUT.9
bcs TCP.IN.RTS
jsr SKT.GetDataFromSktOut
ldy #S.SOCKET.TCP.O
lda (ZPPtrSKT),y
ora #S.TCP.OPTIONS.ACK+S.TCP.OPTIONS.PSH
jsr TCP.OUT.SendOptA.1
sta (ZPPtrSKT),y
bcs TCP.OUT.9
jsr TCP.OUT.Send
bcs TCP.IN.RTS
lda SKT.Cache+S.SOCKET.TCP.OUTNEXTSEQ+3
clc
@ -456,21 +459,23 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
inc SKT.Cache+S.SOCKET.TCP.OUTNEXTSEQ
.80 jmp SKT.StoreTCB exits with CC
TCP.OUT.9 rts
*--------------------------------------
TCP.OUT.SendOptA
sta .1+1
ldy #S.SOCKET.TCP.O
ora (ZPPtrSKT),y
sta (ZPPtrSKT),y
>LDYAI 0
jsr TCP.NewFrame
bcs TCP.OUT.9
bcs TCP.IN.RTS
.1 lda #$ff
TCP.OUT.SendOptA.1
TCP.OUT.Send ldy #S.SOCKET.TCP.O
lda (ZPPtrSKT),y
ldy #S.TCP.OPTIONS
sta (ZPFrameOutPtr),y
bit #S.TCP.OPTIONS.ACK
beq .10
beq .2
ldx #3
ldy #S.TCP.ACKNUM+3
@ -481,14 +486,14 @@ TCP.OUT.SendOptA.1
dex
bpl .1
.10 ldx #3
.2 ldx #3
ldy #S.TCP.SEQNUM+3
.2 lda SKT.Cache+S.SOCKET.TCP.OUTNEXTSEQ,x
.3 lda SKT.Cache+S.SOCKET.TCP.OUTNEXTSEQ,x
sta (ZPFrameOutPtr),y
dey
dex
bpl .2
bpl .3
ldy #S.TCP.WINDOW
lda SKT.Cache+S.SOCKET.TCP.INFREE+1

View File

@ -368,7 +368,7 @@ FD.DSOCK .DA #S.FD.T.DSOCK
.DA #0 S.FD.HANDLER
.BS 1 S.FD.DSOCK.IOHANDLER
.DA #0 S.FD.DSOCK.OPEN
.DA #0 S.FD.DSOCK.CLOSE
.DA #LIBTCPIP.shutdown
.DA #LIBTCPIP.Recv
.DA #LIBTCPIP.Send
.DA #0 S.FD.DSOCK.STATUS
@ -382,7 +382,7 @@ FD.SSOCK .DA #S.FD.T.SSOCK
.DA #0 S.FD.HANDLER
.BS 1 S.FD.SSOCK.IOHANDLER
.DA #0 S.FD.SSOCK.OPEN
.DA #0 S.FD.SSOCK.CLOSE
.DA #LIBTCPIP.shutdown
.DA #LIBTCPIP.Read
.DA #LIBTCPIP.Write
.DA #LIBTCPIP.EOF

View File

@ -1,6 +1,5 @@
NEW
PREFIX
AUTO 4,1
AUTO 3,1
*--------------------------------------
CORE.Run stz CORE.PSIndex
@ -201,7 +200,7 @@ CORE.GetEvents lda #Evt.Table
sta IRQ.Mode
ldx A2osX.ASCREEN
cpx #1 /DEV/CONSOLE
dex devID 1 is /DEV/CONSOLE
bne .22
sta SYS.BASL0+38
@ -538,10 +537,10 @@ CORE.PSFree sta .10+1 Save PS ID
.2 cmp PS.Table.PID,x
beq .3
inx
cpx CORE.PSCount
bne .2
beq *
.3 stz PS.Table.PID,x
lda PS.TABLE.hPS,x

View File

@ -1057,7 +1057,6 @@ PwdMgrInit >LDYAI MSG.PWD
PwdMgr.ROOT .DA #S.SESSION.P.ROOT
.DA #0 UID
.DA #0 GID
.BS 17 PASSWD
.AZ "ROOT" NAME
.AZ "Root User" GECOS
.AZ "${ROOT}ROOT/" DIR

View File

@ -247,12 +247,26 @@ IO.CLOSE.DIR ldy #S.FD.REG.REF
*--------------------------------------
IO.CLOSE.CDEV
IO.CLOSE.BDEV
clc
rts
*--------------------------------------
IO.CLOSE.DSOCK
IO.CLOSE.SSOCK
ldy #S.FD.SSOCK.CLOSE
lda (pFD),y
tax Function Offset in LIB
clc
rts
ldy #S.FD.SSOCK.IOHANDLER
lda (pFD),y
jsr K.GetMemPtr
>STYA .1+1
lda IO.hFD
.1 jsr $FFFF SELF MODIFIED
lda IO.hFD
jmp K.FreeMem
*--------------------------------------
IO.CLOSE.PIPE ldy #S.FD.PIPE.S

View File

@ -175,11 +175,13 @@ PS.CreateChild ldx #0
cpy #S.PS.hStdErr+1
bne .81
ldy #S.PS.hSID
lda (pPs),y
sta (PS.NewPSPtr),y
ldy #S.PS.PID
lda (pPs),y
ldy #S.PS.PPID
sta (PS.NewPSPtr),y
bra .5
.80 lda #1 /DEV/CONSOLE
@ -191,10 +193,14 @@ PS.CreateChild ldx #0
cpy #S.PS.hStdErr+1
bne .83
.5 ldy #S.PS.hSID
lda (pPs),y
dec SID = PPID = 0, KERNEL
ldy #S.PS.hSID
sta (PS.NewPSPtr),y
.5 ldy #S.PS.PPID
sta (PS.NewPSPtr),y
lda #S.PS.F.HOLD
bit PS.Flags
beq .82