Kernel 0.94

This commit is contained in:
Rémy GIBERT
2020-08-09 21:47:42 +02:00
parent 651fd664da
commit c305aee13e
10 changed files with 219 additions and 133 deletions

Binary file not shown.

View File

@@ -5,15 +5,15 @@ NEW
.OR $2000 .OR $2000
.TF bin/etconfig .TF bin/etconfig
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/KERNEL.I .INB inc/kernel.i
.INB INC/MLI.I .INB inc/mli.i
.INB INC/MLI.E.I .INB inc/mli.e.i
.INB INC/NIC.I .INB inc/nic.i
.INB INC/ETH.I .INB inc/eth.i
.INB INC/LIB.NET.I .INB inc/lib.net.i
.INB INC/LIBETALK.I .INB inc/libetalk.i
*-------------------------------------- *--------------------------------------
TIMEOUT.MAX .EQ 200 20 sec. TIMEOUT.MAX .EQ 200 20 sec.
PROBE.MAX .EQ 10 PROBE.MAX .EQ 10
@@ -581,5 +581,5 @@ TimeOut .BS 1
DS.END .ED DS.END .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/SBIN/ETCONFIG.S SAVE usr/src/bin/etconfig.s
ASM ASM

View File

@@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
DHCP.INIT lda IPCFG+S.NETCFG.STATUS DHCP.INIT lda IPCFG+S.NETCFG.STATUS
@@ -53,7 +52,9 @@ DHCP.RUN >PUSHBI 0 no protocol
>LDYA L.MSG.DHCP.CFG1 >LDYA L.MSG.DHCP.CFG1
>SYSCALL PutS >SYSCALL PutS
jsr Init.Timeout lda #TIMEOUT.MAX
sta TimeOut
DHCP.RUN.SDISC >PUSHW L.SA.DEST DHCP.RUN.SDISC >PUSHW L.SA.DEST
>PUSHWI DHCP.DISC.LEN >PUSHWI DHCP.DISC.LEN
>PUSHW L.DHCP.DISC >PUSHW L.DHCP.DISC
@@ -69,7 +70,8 @@ DHCP.RUN.SDISC >PUSHW L.SA.DEST
DHCP.RUN.ROFFER >SLEEP DHCP.RUN.ROFFER >SLEEP
jsr DHCP.RUN.SKT.RCVD jsr DHCP.RUN.SKT.RCVD
bcc .1 bcc .1
jsr Wait.Timeout
lda TimeOut
bne DHCP.RUN.ROFFER bne DHCP.RUN.ROFFER
lda #1 lda #1
@@ -98,13 +100,17 @@ DHCP.RUN.SREQ >PUSHW L.MSG.DHCP.CFG2
lda #S.IPCFG.STATUS.SREQ lda #S.IPCFG.STATUS.SREQ
sta IPCFG sta IPCFG
DHCP.RUN.RACK >SLEEP DHCP.RUN.RACK >SLEEP
jsr DHCP.RUN.SKT.RCVD jsr DHCP.RUN.SKT.RCVD
bcc .1 bcc .1
jsr Wait.Timeout
lda TimeOut
bne DHCP.RUN.RACK bne DHCP.RUN.RACK
lda #2 lda #2
bra DHCP.RUN.KO bra DHCP.RUN.KO
.1 jsr CheckDHCPAck .1 jsr CheckDHCPAck
bcs DHCP.RUN.RACK bcs DHCP.RUN.RACK
@@ -329,6 +335,6 @@ CheckDHCPXID ldy #S.DHCP.XID+3
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/SBIN/IPCONFIG.S.DHCP SAVE usr/src/bin/ipconfig.s.dhcp
LOAD USR/SRC/SBIN/IPCONFIG.S LOAD usr/src/bin/ipconfig.s
ASM ASM

View File

@@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
CFG.EtcFiles >LDYAI 256 CFG.EtcFiles >LDYAI 256
@@ -227,22 +226,29 @@ CFG.Read.HOSTS stz CFG.hBuf2
>STYA ZPTmpPtr2 >STYA ZPTmpPtr2
stx CFG.hBuf2 stx CFG.hBuf2
>LDYAI 256 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA ZPTmpPtr3 >STYA ZPTmpPtr3
stx CFG.hBuf3 stx CFG.hBuf3
.1 jsr CFG.Read.GetS .1 jsr CFG.Read.GetS
bcs .8 bcs .8
lda (ZPTmpPtr1) lda (ZPTmpPtr1)
beq .1 empty line... beq .1 empty line...
cmp #'# cmp #'#
beq .1 comment... beq .1 comment...
jsr CFG.Read.HOSTS.Scan jsr CFG.Read.HOSTS.Scan
bcs .1 bcs .1
cmp #5 cmp #5
bcc .1 less than 5 parameters, ignore bcc .1 less than 5 parameters, ignore
beq .2 no alias beq .2 no alias
>LDYA ZPTmpPtr3 >LDYA ZPTmpPtr3
jsr CFG.DNS.Add jsr CFG.DNS.Add
@@ -341,6 +347,6 @@ CFG.Read.GetS >PUSHWI 255
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/SBIN/IPCONFIG.S.ETC SAVE usr/src/bin/ipconfig.s.etc
LOAD USR/SRC/SBIN/IPCONFIG.S LOAD usr/src/bin/ipconfig.s
ASM ASM

View File

@@ -5,16 +5,16 @@ NEW
.OR $2000 .OR $2000
.TF bin/ipconfig .TF bin/ipconfig
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/KERNEL.I .INB inc/kernel.i
.INB INC/MLI.I .INB inc/mli.i
.INB INC/MLI.E.I .INB inc/mli.e.i
.INB INC/NIC.I .INB inc/nic.i
.INB INC/ETH.I .INB inc/eth.i
.INB INC/LIB.NET.I .INB inc/lib.net.i
.INB INC/LIBTCPIP.I .INB inc/libtcpip.i
.INB INC/NET.DHCP.I .INB inc/net.dhcp.i
*-------------------------------------- *--------------------------------------
TIMEOUT.MAX .EQ 200 20 sec. TIMEOUT.MAX .EQ 200 20 sec.
*-------------------------------------- *--------------------------------------
@@ -22,14 +22,27 @@ TIMEOUT.MAX .EQ 200 20 sec.
.OR ZPBIN .OR ZPBIN
ZS.START ZS.START
pIPCFG .BS 2 pIPCFG .BS 2
ZPFrameBase .BS 2
ZPFramePtr .BS 2
ZPTmpPtr1 .BS 2 ZPTmpPtr1 .BS 2
ZPTmpPtr2 .BS 2 ZPTmpPtr2 .BS 2
ZPTmpPtr3 .BS 2 ZPTmpPtr3 .BS 2
*--------------------------------------
ZS.END ArgIndex .BS 1
.ED TimeOut .BS 1
hSocket .BS 1
hFrame .BS 1
ZPFrameBase .BS 2
ZPFramePtr .BS 2
bDHCP .BS 1
bETC .BS 1
bSET .BS 1
CFG.hBuf1 .BS 1
CFG.hBuf2 .BS 1
CFG.hBuf3 .BS 1
CFG.hCfgFile .BS 1
ZS.END .ED
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
*-------------------------------------- *--------------------------------------
@@ -128,7 +141,8 @@ CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG
sec sec
rts rts
CS.RUN.SETUP CS.RUN.SETUP
.1 >INC.G ArgIndex .1 inc ArgIndex
lda ArgIndex
>SYSCALL ArgV >SYSCALL ArgV
bcs .4 bcs .4
@@ -156,29 +170,29 @@ CS.RUN.SETUP
rts rts
.3 ldy OptionVars,x .3 ldy OptionVars,x
lda #$80 lda #$ff
sta (pData),y sta $0,y
bra .1 bra .1
*-------------------------------------- *--------------------------------------
.4 >LDA.G bSET .4 lda bSET
bne .41 Force ... bne .41 Force ...
lda IPCFG+S.NETCFG.STATUS lda IPCFG+S.NETCFG.STATUS
bne .5 bne .5
.41 lda #$ff no config, force all .41 lda #$ff no config, force all
>STA.G bETC sta bETC
>STA.G bDHCP sta bDHCP
.5 >LDA.G bETC .5 lda bETC
>ORA.G bDHCP ora bDHCP
beq CS.RUN.DUMP beq CS.RUN.DUMP
>LDA.G bETC lda bETC
bpl .6 bpl .6
jsr CFG.EtcFiles jsr CFG.EtcFiles
.6 >LDA.G bDHCP .6 lda bDHCP
bpl .8 bpl .8
jsr DHCP.INIT jsr DHCP.INIT
@@ -358,30 +372,25 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
*-------------------------------------- *--------------------------------------
CS.DOEVENT lda (pEvent) CS.DOEVENT lda (pEvent)
bpl .9 is it a TIMER event? bpl .9 is it a TIMER event?
>LDA.G TimeOut
lda TimeOut
beq .9 beq .9
dec
sta (pData),y dec TimeOut
.9 sec do not discard TIMER event .9 sec do not discard TIMER event
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hLIBTCPIP CS.QUIT lda hLIBTCPIP
beq .8 beq .8
>SYSCALL UnloadLib >SYSCALL UnloadLib
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
Init.Timeout ldy #TimeOut .INB usr/src/bin/ipconfig.s.dhcp
lda #TIMEOUT.MAX .INB usr/src/bin/ipconfig.s.etc
sta (pData),y
rts
*--------------------------------------
Wait.TimeOut ldy #TimeOut
lda (pData),y
rts
*--------------------------------------
.INB USR/SRC/SBIN/IPCONFIG.S.DHCP
.INB USR/SRC/SBIN/IPCONFIG.S.ETC
*-------------------------------------- *--------------------------------------
CS.END CS.END
LIBTCPIP .AZ "libtcpip" LIBTCPIP .AZ "libtcpip"
@@ -446,10 +455,6 @@ MSG.DHCP.OK .AZ "IPCONFIG:Success:[IP=%d.%d.%d.%d/%d.%d.%d.%d]\r\n"
MSG.DHCP.NA .AZ "IPCONFIG:TCPIP Already configured, exiting." MSG.DHCP.NA .AZ "IPCONFIG:TCPIP Already configured, exiting."
*-------------------------------------- *--------------------------------------
IPCFG .BS S.IPCFG IPCFG .BS S.IPCFG
CFG.hBuf1 .BS 1
CFG.hBuf2 .BS 1
CFG.hBuf3 .BS 1
CFG.hCfgFile .BS 1
CFG.IP .BS 4 CFG.IP .BS 4
*-------------------------------------- *--------------------------------------
SA.LOCAL .DA #AF.INET S.SOCKADDR.AF SA.LOCAL .DA #AF.INET S.SOCKADDR.AF
@@ -508,18 +513,11 @@ DHCP.REQ.LEN .EQ *-DHCP.REQ
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
ArgIndex .BS 1
bDHCP .BS 1
bETC .BS 1
bSET .BS 1
DIB .BS S.DIB DIB .BS S.DIB
IOCTL .BS S.IOCTL IOCTL .BS S.IOCTL
DCB.NIC .BS S.DCB.NIC DCB.NIC .BS S.DCB.NIC
TimeOut .BS 1
hSocket .BS 1
hFrame .BS 1
DS.END .ED DS.END .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/SBIN/IPCONFIG.S SAVE usr/src/bin/ipconfig.s
ASM ASM

View File

@@ -720,5 +720,5 @@ IO.FIFO .BS 12 /DEV/FIFOxx\0
DS.END .ED DS.END .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/SH.S SAVE usr/src/bin/sh.s
ASM ASM

View File

@@ -646,5 +646,5 @@ DS.END
.ED .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sbin/cifsd SAVE usr/src/sbin/cifsd.s
ASM ASM

View File

@@ -37,6 +37,12 @@ ZPnRequestLen .BS 2
ZPLinePtr .BS 2 ZPLinePtr .BS 2
ZPRepPtr .BS 2 ZPRepPtr .BS 2
CLN.hSocket .BS 1
REP.hBuf .BS 1
REQ.hFile .BS 1
REQ.KeepAlive .BS 1
REQ.MimeType .BS 1
REQ.hReq .BS 1
ZS.END .ED ZS.END .ED
*-------------------------------------- *--------------------------------------
@@ -313,13 +319,13 @@ CS.RUN.SERVER lda hSrvSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.accept >LIBCALL hLIBTCPIP,LIBTCPIP.accept
bcs .8 bcs .8
>STA.G CLN.hSocket sta CLN.hSocket
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPSktPtr >STYA ZPSktPtr
>PUSHW L.MSG.INCOMING >PUSHW L.MSG.INCOMING
>PUSHB.G CLN.hSocket >PUSHB CLN.hSocket
ldx #3 ldx #3
ldy #S.SOCKET.REM.ADDR ldy #S.SOCKET.REM.ADDR
@@ -335,11 +341,11 @@ CS.RUN.SERVER lda hSrvSocket
jsr CS.RUN.CLIENT jsr CS.RUN.CLIENT
>PUSHW L.MSG.SKTCLOSE >PUSHW L.MSG.SKTCLOSE
>PUSHB.G CLN.hSocket >PUSHB CLN.hSocket
>PUSHBI 1 >PUSHBI 1
>SYSCALL printf >SYSCALL printf
>LDA.G CLN.hSocket lda CLN.hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown >LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown
.8 clc .8 clc
@@ -352,17 +358,16 @@ CS.RUN.CLIENT >LDYAI 1024
bcs CS.RUN.SERVER.RTS bcs CS.RUN.SERVER.RTS
>STYA ZPRepPtr >STYA ZPRepPtr
txa stx REP.hBuf
>STA.G REP.hBuf
.10 >STZ.G REQ.FullPath .10 >STZ.G REQ.FullPath
>STA.G REQ.hReq stz REQ.hReq
>STA.G REQ.KeepAlive stz REQ.KeepAlive
>STA.G REQ.hFile stz REQ.hFile
.1 >SLEEP .1 >SLEEP
>LDA.G CLN.hSocket lda CLN.hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Recv >LIBCALL hLIBTCPIP,LIBTCPIP.Recv
bcc .2 bcc .2
@@ -386,10 +391,10 @@ CS.RUN.CLIENT >LDYAI 1024
bcc .3 bcc .3
bcs .98 bcs .98
.4 >LDA.G REQ.hReq .4 lda REQ.hReq
>SYSCALL FreeMem >SYSCALL FreeMem
>STZ.G REQ.hReq stz REQ.hReq
>LDA.G REQ.FullPath >LDA.G REQ.FullPath
beq .9 beq .9
@@ -404,31 +409,31 @@ CS.RUN.CLIENT >LDYAI 1024
.9 >PUSHWI HTTP.404.len .9 >PUSHWI HTTP.404.len
>PUSHW L.HTTP.404 >PUSHW L.HTTP.404
>LDA.G CLN.hSocket lda CLN.hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Send >LIBCALL hLIBTCPIP,LIBTCPIP.Send
.8 >LDA.G REQ.KeepAlive .8 bit REQ.KeepAlive
beq .99 bpl .99
jmp .10 jmp .10
.98 >LDA.G REQ.hReq .98 lda REQ.hReq
beq .99 beq .99
>SYSCALL FreeMem >SYSCALL FreeMem
.99 >LDA.G REP.hBuf .99 lda REP.hBuf
>SYSCALL freemem >SYSCALL freemem
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.REQ.GetReq CS.RUN.REQ.GetReq
>STA.G REQ.hReq sta REQ.hReq
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPRequestPtr >STYA ZPRequestPtr
>PUSHW L.MSG.REQ >PUSHW L.MSG.REQ
>PUSHB.G REQ.hReq >PUSHB REQ.hReq
>PUSHB.G CLN.hSocket >PUSHB CLN.hSocket
>PUSHBI 2 >PUSHBI 2
>SYSCALL printf >SYSCALL printf
@@ -496,7 +501,7 @@ CS.RUN.REQ.GetLine
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.OpenFile >PUSHW L.MSG.FILE CS.RUN.OpenFile >PUSHW L.MSG.FILE
>PUSHB.G CLN.hSocket >PUSHB CLN.hSocket
>PUSHEA.G REQ.FullPath >PUSHEA.G REQ.FullPath
>PUSHBI 3 >PUSHBI 3
>SYSCALL printf >SYSCALL printf
@@ -508,8 +513,7 @@ CS.RUN.OpenFile >PUSHW L.MSG.FILE
>SYSCALL FOpen >SYSCALL FOpen
bcs .9 bcs .9
txa stx REQ.hFile
>STA.G REQ.hFile
>PUSHA >PUSHA
>PUSHEA.G REQ.Stat >PUSHEA.G REQ.Stat
@@ -551,15 +555,15 @@ CS.RUN.OpenFile >PUSHW L.MSG.FILE
txa txa
.8 >STA.G REQ.MimeType .8 sta REQ.MimeType
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.RUN.SendFile >PUSHW ZPRepPtr CS.RUN.SendFile >PUSHW ZPRepPtr
>PUSHW L.HTTP.200 >PUSHW L.HTTP.200
>LDA.G REQ.MimeType
tax ldx REQ.MimeType
>PUSHW T.MIME,x >PUSHW T.MIME,x
>PUSHL.G REQ.Stat+S.STAT.SIZE >PUSHL.G REQ.Stat+S.STAT.SIZE
>PUSHBI 6 >PUSHBI 6
@@ -571,7 +575,7 @@ CS.RUN.SendFile >PUSHW ZPRepPtr
.1 >PUSHWI 1024 .1 >PUSHWI 1024
>PUSHW ZPRepPtr >PUSHW ZPRepPtr
>LDA.G REQ.hFile lda REQ.hFile
>SYSCALL fread >SYSCALL fread
bcs .8 bcs .8
@@ -587,7 +591,7 @@ CS.RUN.SendFile >PUSHW ZPRepPtr
.9 php .9 php
pha pha
>LDA.G REQ.hFile lda REQ.hFile
>SYSCALL FClose >SYSCALL FClose
pla pla
plp plp
@@ -595,7 +599,7 @@ CS.RUN.SendFile >PUSHW ZPRepPtr
*-------------------------------------- *--------------------------------------
CS.RUN.SendBuf >PUSHYA CS.RUN.SendBuf >PUSHYA
>PUSHW ZPRepPtr >PUSHW ZPRepPtr
>LDA.G CLN.hSocket lda CLN.hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Send >LIBCALL hLIBTCPIP,LIBTCPIP.Send
rts rts
*-------------------------------------- *--------------------------------------
@@ -647,7 +651,7 @@ CS.RUN.REQ.Connection
lda #$ff lda #$ff
.1 >STA.G REQ.KeepAlive .1 sta REQ.KeepAlive
clc clc
rts rts
@@ -809,12 +813,6 @@ SA.LOCAL .DA #AF.INET S.SOCKADDR.AF
DS.START DS.START
REQ.FullPath .BS MLI.MAXPATH+1 REQ.FullPath .BS MLI.MAXPATH+1
REQ.Stat .BS S.STAT REQ.Stat .BS S.STAT
CLN.hSocket .BS 1
REQ.hReq .BS 1
REQ.hFile .BS 1
REQ.MimeType .BS 1
REQ.KeepAlive .BS 1
REP.hBuf .BS 1
DS.END DS.END
.ED .ED
*-------------------------------------- *--------------------------------------

View File

@@ -343,7 +343,7 @@ K.FreeMem.ERR >PUSHWI K.FreeMem.MSG
>PUSHBI 2 >PUSHBI 2
.1 >SYSCALL2 printf .1 >SYSCALL2 printf
>DEBUG
lda #E.INVH lda #E.INVH
sec sec
rts rts

View File

@@ -74,7 +74,8 @@ PS.Exec jsr PS.CreateChild A=PID,Child S.PS at PS.NewPSPtr,PS.Load.hMem
.8 lda #$ff SELF MODIFIED .8 lda #$ff SELF MODIFIED
* clc * clc
.9 rts .9
PS.Exec.RTS rts
*/-------------------------------------- */--------------------------------------
* # Fork * # Fork
* ## C * ## C
@@ -85,7 +86,7 @@ PS.Exec jsr PS.CreateChild A=PID,Child S.PS at PS.NewPSPtr,PS.Load.hMem
* A = Child PSID * A = Child PSID
*\-------------------------------------- *\--------------------------------------
K.Fork jsr PS.CreateChild A=PID,Child S.PS at PS.NewPSPtr,PS.Load.hMem K.Fork jsr PS.CreateChild A=PID,Child S.PS at PS.NewPSPtr,PS.Load.hMem
bcs .9 bcs PS.Exec.RTS
sta .8+1 sta .8+1
ldy #S.PS.S ldy #S.PS.S
@@ -93,7 +94,87 @@ K.Fork jsr PS.CreateChild A=PID,Child S.PS at PS.NewPSPtr,PS.Load.hMem
sta (PS.NewPSPtr),y sta (PS.NewPSPtr),y
ldy #S.PS.hCS ldy #S.PS.hCS
lda (pPS),y
sta (PS.NewPSPtr),y
jsr MEM.GetMemByID
jsr Mem.IncRefCnt
ldy #S.MEM.PTR+1
lda (ZPMemMgrSPtr),y
pha
dey
lda (ZPMemMgrSPtr),y
ldy #S.PS.ZP.CODE+1
sta (PS.NewPSPtr),y
dey
pla
sta (PS.NewPSPtr),y
ldy #S.PS.hDS
lda (pPS),y
jsr MEM.Dup
bcs .9
ldy #S.PS.hDS
sta (PS.NewPSPtr),y
jsr K.GetMemPtr
phy
ldy #S.PS.ZP.DATA+1
sta (PS.NewPSPtr),y
dey
pla
sta (PS.NewPSPtr),y
ldy #S.PS.hSS
lda (pPS),y
jsr MEM.Dup
bcs .9
ldy #S.PS.hSS
sta (PS.NewPSPtr),y
jsr K.GetMemPtr
phy
ldy #S.PS.ZP.STACK+1
sta (PS.NewPSPtr),y
dey
pla
sta (PS.NewPSPtr),y
ldy #S.PS.hARGV
lda (pPS),y
jsr MEM.Dup
bcs .9
ldy #S.PS.hARGV
sta (PS.NewPSPtr),y
dey
lda (pPS),y S.PS.ARGC
sta (PS.NewPSPtr),y
ldy #S.PS.ARGC
sta (PS.NewPSPtr),y
iny S.PS.hARGV
txa
sta (PS.NewPSPtr),y
ldy #S.PS.A
lda #0
sta (PS.NewPSPtr),y Forked PS will get A=PSID=0
iny
.1 lda (pPS),y
sta (PS.NewPSPtr),y
iny
cpy #S.PS.hSession
bne .1
ldy #S.PS.ZP.LOCAL
.2 lda (pPS),y
sta (PS.NewPSPtr),y
iny
cpy #S.PS
bne .2
.8 lda #$ff SELF MODIFIED .8 lda #$ff SELF MODIFIED
* clc * clc
@@ -153,24 +234,20 @@ PS.CreateChild ldx #0
lda CORE.LastPSID lda CORE.LastPSID
ldy #S.PS.PID ldy #S.PS.PID
sta (PS.NewPSPtr),y sta (PS.NewPSPtr),y
ldy #S.PS.PPID
lda #S.PS.F.NOHUP lda #S.PS.F.NOHUP
bit PS.Flags and PS.Flags
beq .5 beq .5 set PPID = 0
lda PS.Table.hPS Select PS0 iny #S.PS.PID
jsr K.GetMemPtr lda (pPS),y
bra .6
.5 >LDYA pPs
.6 >STYA ZPPtr1
ldy #S.PS.PID
lda (ZPPtr1),y
dey #S.PS.PPID dey #S.PS.PPID
sta (PS.NewPSPtr),y
ldy #S.PS.hCWD copy hPREFIX... .5 sta (PS.NewPSPtr),y
lda (ZPPtr1),y
ldy #S.PS.hCWD copy hPREFIX...
lda (pPS),y
jsr K.GetMemPtr jsr K.GetMemPtr
jsr K.StrDup jsr K.StrDup
@@ -183,7 +260,7 @@ PS.CreateChild ldx #0
sta (PS.NewPSPtr),y sta (PS.NewPSPtr),y
ldy #S.PS.hENV ldy #S.PS.hENV
lda (ZPPtr1),y lda (pPS),y
jsr MEM.DupX dup hENV from parent PS jsr MEM.DupX dup hENV from parent PS
bcs .9 bcs .9
@@ -193,14 +270,14 @@ PS.CreateChild ldx #0
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
.7 lda (ZPPtr1),y .7 lda (pPS),y
sta (PS.NewPSPtr),y sta (PS.NewPSPtr),y
iny iny
cpy #S.PS.hStdErr+1 cpy #S.PS.hStdErr+1
bne .7 bne .7
ldy #S.PS.hSession ldy #S.PS.hSession
lda (ZPPtr1),y lda (pPS),y
sta (PS.NewPSPtr),y sta (PS.NewPSPtr),y
* tax * tax
@@ -211,11 +288,12 @@ PS.CreateChild ldx #0
lda #S.PS.F.HOLD lda #S.PS.F.HOLD
bit PS.Flags bit PS.Flags
beq .8 beq .8
ora (ZPPtr1)
sta (ZPPtr1) HOLD parent PS ora (pPS)
sta (pPS) HOLD parent PS
lda CORE.LastPSID lda CORE.LastPSID
ldy #S.PS.CPID ldy #S.PS.CPID
sta (ZPPtr1),y sta (pPS),y
.8 .8
* lda #S.PS.S.INIT * lda #S.PS.S.INIT
* ldy #S.PS.S * ldy #S.PS.S