mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-13 08:29:46 +00:00
Kernel 0.9.2
This commit is contained in:
parent
e0c4bab81f
commit
846ce0f76e
@ -91,7 +91,7 @@ CC: A = hSOCKET
|
||||
CS: A = EC
|
||||
|
||||
# Connect
|
||||
Iinitiate a connection on a socket
|
||||
Initiate a connection on a socket
|
||||
|
||||
## C
|
||||
`int connect(hFD fd, const struct sockaddr *addr);`
|
||||
|
Binary file not shown.
Binary file not shown.
@ -20,7 +20,7 @@ CS.START cld
|
||||
jmp (.1,x)
|
||||
.DA #$61 6502,Level 1 (65c02)
|
||||
.DA #1 BIN Layout Version 1
|
||||
.DA #S.PS.F.EVENT S.PS.F
|
||||
.DA #0 S.PS.F
|
||||
.DA #0
|
||||
.DA CS.END-CS.START CS
|
||||
.DA DS.END-DS.START DS
|
||||
@ -36,6 +36,7 @@ CS.START cld
|
||||
.DA CS.QUIT
|
||||
L.MSG.USAGE .DA MSG.USAGE
|
||||
L.MSG.LINENUM .DA MSG.LINENUM
|
||||
L.MSG.Pause .DA MSG.Pause
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CS.INIT clc
|
||||
@ -77,9 +78,9 @@ CS.RUN
|
||||
.4 >LDA.G hFile
|
||||
bne .99
|
||||
|
||||
>LDYA ZPPtr1
|
||||
jsr CS.RUN.OPEN
|
||||
bcs .9
|
||||
>STA.G hFile
|
||||
|
||||
bra .1 scan for any other args
|
||||
|
||||
@ -100,17 +101,25 @@ CS.RUN
|
||||
CS.RUN.LOOP >SLEEP
|
||||
|
||||
>LDA.G hFILE
|
||||
beq .11
|
||||
|
||||
>SYSCALL GetChar
|
||||
bcs .10 no char
|
||||
|
||||
cmp #$03 Ctrl-C
|
||||
beq .9 Abort....
|
||||
|
||||
cmp #$13 Ctrl-S
|
||||
bne .10
|
||||
bne .1
|
||||
|
||||
ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>SYSCALL GetC
|
||||
bra .2
|
||||
|
||||
.1 >SYSCALL GetChar
|
||||
.2 bcs .10 no char
|
||||
|
||||
cmp #$03 Ctrl-C
|
||||
bne .3
|
||||
|
||||
sec Abort....
|
||||
rts
|
||||
|
||||
.3 cmp #C.SPACE
|
||||
bne .10
|
||||
|
||||
>LDA.G bPause
|
||||
eor #$ff
|
||||
sta (pData),y
|
||||
@ -131,20 +140,31 @@ CS.RUN.LOOP >SLEEP
|
||||
>PUSHW ZPBufPtr
|
||||
pla
|
||||
>SYSCALL fgets
|
||||
>DEBUG
|
||||
bcs .13
|
||||
|
||||
>LDYA ZPBufPtr
|
||||
>LDA.G LineCount
|
||||
bne .22
|
||||
>LDA.G bPage
|
||||
beq .22
|
||||
|
||||
lda #C.FF
|
||||
>SYSCALL putchar
|
||||
|
||||
.22 >LDYA ZPBufPtr
|
||||
>SYSCALL puts
|
||||
|
||||
>INC.G LineCount
|
||||
cmp #20
|
||||
cmp #23
|
||||
bne .8
|
||||
lda #0
|
||||
sta (pData),y
|
||||
|
||||
dec
|
||||
>STA.G bPause
|
||||
|
||||
>PUSHBI 0
|
||||
>LDYA L.MSG.Pause
|
||||
>SYSCALL printf
|
||||
|
||||
.8 jmp CS.RUN.LOOP
|
||||
|
||||
@ -157,29 +177,21 @@ CS.RUN.LOOP >SLEEP
|
||||
*--------------------------------------
|
||||
CS.RUN.OPEN >SYSCALL RealPath
|
||||
bcs .9
|
||||
phx save hMem
|
||||
phy
|
||||
pha
|
||||
txa
|
||||
>STA.G hFullPath
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.RDONLY+O.TEXT
|
||||
|
||||
pla
|
||||
|
||||
ply
|
||||
>SYSCALL FOpen
|
||||
plx
|
||||
bcs .99
|
||||
pha
|
||||
jsr .99
|
||||
pla
|
||||
clc
|
||||
rts
|
||||
bcs .9
|
||||
>STA.G hFile
|
||||
|
||||
.99 pha
|
||||
txa
|
||||
>SYSCALL FreeMem
|
||||
pla
|
||||
sec
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CS.RUN.PRINTNUM clc
|
||||
@ -199,10 +211,15 @@ CS.QUIT >LDA.G hBuf
|
||||
>SYSCALL FreeMem
|
||||
|
||||
.1 >LDA.G hFILE
|
||||
beq .8
|
||||
beq .2
|
||||
|
||||
>SYSCALL FClose
|
||||
|
||||
.2 >LDA.G hFullPath
|
||||
beq .8
|
||||
|
||||
>SYSCALL FreeMem
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -211,23 +228,27 @@ CS.DOEVENT sec
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
*--------------------------------------
|
||||
OptionList >PSTR "NnHh"
|
||||
OptionVars .DA #bLineNum,#bLineNum,#bHelp,#bHelp
|
||||
OptionList >PSTR "NnHhPp"
|
||||
OptionVars .DA #bLineNum,#bLineNum,#bHelp,#bHelp,#bPage,#bPage
|
||||
*--------------------------------------
|
||||
MSG.USAGE .AS "Usage : MORE <File>\r\n"
|
||||
.AS " -H : This Help Screen\r\n"
|
||||
.AZ " -N : Number all output lines\r\n"
|
||||
.AS " -H : This help screen\r\n"
|
||||
.AS " -N : Number all output lines\r\n"
|
||||
.AZ " -P : Page mode, no scroll\r\n"
|
||||
MSG.LINENUM .AZ "%5D:"
|
||||
MSG.Pause .AZ "\e[7m --- More --- \e[0m\r"
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
DS.START
|
||||
ArgCount .BS 1
|
||||
hFullPath .BS 1
|
||||
hFile .BS 1
|
||||
LineCount .BS 1
|
||||
LineNum .BS 2
|
||||
bPause .BS 1
|
||||
bLineNum .BS 1
|
||||
bPage .BS 1
|
||||
bHelp .BS 1
|
||||
ArgIndex .BS 1
|
||||
hBuf .BS 1
|
||||
|
@ -283,9 +283,9 @@ WRITE.COUT bit bEscMode
|
||||
.1 pha
|
||||
jsr CUROFF
|
||||
pla
|
||||
cmp #$7f
|
||||
cmp #C.DEL
|
||||
beq DEL
|
||||
cmp #32
|
||||
cmp #C.SPACE
|
||||
bcc COUT.Ctrl
|
||||
|
||||
ora INVFLG
|
||||
@ -776,9 +776,9 @@ Esc.Query ldx EscSeqParamCnt
|
||||
cmp #6
|
||||
bne .8
|
||||
|
||||
lda #$1B
|
||||
lda #C.ESC
|
||||
jsr Char.Out.Put
|
||||
lda #$5B
|
||||
lda #'['
|
||||
jsr Char.Out.Put
|
||||
lda CV
|
||||
inc
|
||||
|
@ -5,11 +5,19 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
S.ETH.DSTMAC .EQ 0
|
||||
S.ETH.SRCMAC .EQ 6
|
||||
S.ETH.ETHERTYPE .EQ 12
|
||||
S.ETH.ETHERTYPE.IP .EQ $800
|
||||
S.ETH.ETHERTYPE.ARP .EQ $806
|
||||
S.ETH.EII.TYPE .EQ 12
|
||||
S.ETH.EII.TYPE.IP .EQ $800
|
||||
S.ETH.EII.TYPE.ARP .EQ $806
|
||||
*
|
||||
S.ETH .EQ 6+6+2
|
||||
S.ETH.EII .EQ 14
|
||||
*
|
||||
S.ETH.802.3.LENGTH .EQ 12
|
||||
S.ETH.802.2.DSTSAP .EQ 14
|
||||
S.ETH.802.2.SRCSAP .EQ 15
|
||||
S.ETH.802.2.CTRL .EQ 16
|
||||
S.ETH.SNAP.PROTO .EQ 17
|
||||
*
|
||||
S.ETH.SNAP .EQ 22
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE INC/ETH.I
|
||||
|
@ -144,6 +144,7 @@ S.SOCKET.REM.PORT .EQ S.FD.DSOCK+14
|
||||
* Listen type Queue
|
||||
* Raw Type Queue
|
||||
* Datagram type Queue
|
||||
* Seq Packet type Queue
|
||||
S.SOCKET.HQ.HEAD .EQ S.FD.DSOCK+16
|
||||
S.SOCKET.HQ.TAIL .EQ S.FD.DSOCK+17
|
||||
S.SOCKET.HQ .EQ S.FD.DSOCK+18
|
||||
@ -189,34 +190,34 @@ S.SOCKET.TCP.OUTACKNUM .EQ S.SOCKET+34 Send:ACK to send to remote
|
||||
*
|
||||
S.SOCKET.TCP .EQ S.SOCKET+38
|
||||
*--------------------------------------
|
||||
S.ARP.HTYPE .EQ S.ETH+0 $0001
|
||||
S.ARP.PTYPE .EQ S.ETH+2 $0800
|
||||
S.ARP.HLEN .EQ S.ETH+4 $06
|
||||
S.ARP.PLEN .EQ S.ETH+5 $04
|
||||
S.ARP.OPERATION .EQ S.ETH+6 REQ=$0001,REPLY=$0002
|
||||
S.ARP.HTYPE .EQ S.ETH.EII+0 $0001
|
||||
S.ARP.PTYPE .EQ S.ETH.EII+2 $0800
|
||||
S.ARP.HLEN .EQ S.ETH.EII+4 $06
|
||||
S.ARP.PLEN .EQ S.ETH.EII+5 $04
|
||||
S.ARP.OPERATION .EQ S.ETH.EII+6 REQ=$0001,REPLY=$0002
|
||||
S.ARP.OPERATION.REQ .EQ 1
|
||||
S.ARP.OPERATION.REP .EQ 2
|
||||
S.ARP.SHA .EQ S.ETH+8 Sender MAC
|
||||
S.ARP.SPA .EQ S.ETH+14 Sender IP
|
||||
S.ARP.THA .EQ S.ETH+18 Target MAC
|
||||
S.ARP.TPA .EQ S.ETH+24 Target IP
|
||||
S.ARP.SHA .EQ S.ETH.EII+8 Sender MAC
|
||||
S.ARP.SPA .EQ S.ETH.EII+14 Sender IP
|
||||
S.ARP.THA .EQ S.ETH.EII+18 Target MAC
|
||||
S.ARP.TPA .EQ S.ETH.EII+24 Target IP
|
||||
*
|
||||
S.ARP .EQ S.ETH+28
|
||||
S.ARP .EQ S.ETH.EII+28
|
||||
*--------------------------------------
|
||||
S.IP.V.IHL.DSCP.ECN .EQ S.ETH+0 $0045, IPV4,HDR=5DWORDs
|
||||
S.IP.TOTAL.LENGTH .EQ S.ETH+2
|
||||
S.IP.IDENTIFICATION .EQ S.ETH+4
|
||||
S.IP.FRAGMENT.FLAGS .EQ S.ETH+6
|
||||
S.IP.TTL .EQ S.ETH+8
|
||||
S.IP.PROTOCOL .EQ S.ETH+9
|
||||
S.IP.V.IHL.DSCP.ECN .EQ S.ETH.EII+0 $0045, IPV4,HDR=5DWORDs
|
||||
S.IP.TOTAL.LENGTH .EQ S.ETH.EII+2
|
||||
S.IP.IDENTIFICATION .EQ S.ETH.EII+4
|
||||
S.IP.FRAGMENT.FLAGS .EQ S.ETH.EII+6
|
||||
S.IP.TTL .EQ S.ETH.EII+8
|
||||
S.IP.PROTOCOL .EQ S.ETH.EII+9
|
||||
S.IP.PROTOCOL.ICMP .EQ 1
|
||||
S.IP.PROTOCOL.TCP .EQ 6
|
||||
S.IP.PROTOCOL.UDP .EQ 17
|
||||
S.IP.HDR.CHECKSUM .EQ S.ETH+10
|
||||
S.IP.SRC .EQ S.ETH+12
|
||||
S.IP.DST .EQ S.ETH+16
|
||||
S.IP.HDR.CHECKSUM .EQ S.ETH.EII+10
|
||||
S.IP.SRC .EQ S.ETH.EII+12
|
||||
S.IP.DST .EQ S.ETH.EII+16
|
||||
*
|
||||
S.IP .EQ S.ETH+20
|
||||
S.IP .EQ S.ETH.EII+20
|
||||
*--------------------------------------
|
||||
S.ICMP.TYPE .EQ S.IP+0
|
||||
S.ICMP.TYPE.ECHOREP .EQ 0
|
||||
|
@ -102,11 +102,11 @@ FRM.NewIP stx .8+1
|
||||
and #S.DCB.NIC.FLAGS.IPOFFLOAD
|
||||
bne .7
|
||||
|
||||
ldy #S.ETH.ETHERTYPE
|
||||
lda /S.ETH.ETHERTYPE.IP
|
||||
ldy #S.ETH.EII.TYPE
|
||||
lda /S.ETH.EII.TYPE.IP
|
||||
sta (ZPFrameOutPtr),y
|
||||
iny
|
||||
lda #S.ETH.ETHERTYPE.IP
|
||||
lda #S.ETH.EII.TYPE.IP
|
||||
sta (ZPFrameOutPtr),y
|
||||
|
||||
ldy #S.IP.V.IHL.DSCP.ECN
|
||||
@ -165,11 +165,11 @@ FRM.SendIP ldx #3 Copy SRC.IP even if IP offload
|
||||
ldy #S.IP.TOTAL.LENGTH+1
|
||||
lda ZPFrameOutLen
|
||||
sec
|
||||
sbc #S.ETH
|
||||
sbc #S.ETH.EII
|
||||
sta (ZPFrameOutPtr),y
|
||||
dey
|
||||
lda ZPFrameOutLen+1
|
||||
sbc /S.ETH
|
||||
sbc /S.ETH.EII
|
||||
sta (ZPFrameOutPtr),y
|
||||
|
||||
lda #0
|
||||
|
@ -1,7 +1,7 @@
|
||||
NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
.LIST OFF
|
||||
.LIST OFF
|
||||
*/--------------------------------------
|
||||
* # Socket
|
||||
* Create a new socket
|
||||
@ -16,7 +16,7 @@ AUTO 4,1
|
||||
* CC: A = hSOCKET
|
||||
* CS: A = EC
|
||||
*\--------------------------------------
|
||||
SKT.Socket tax
|
||||
SKT.Socket tax
|
||||
>PULLA get protocol (RAW)
|
||||
SKT.Socket.I jmp (J.SKT.Socket,x)
|
||||
|
||||
@ -76,7 +76,7 @@ SKT.Socket.STREAM
|
||||
|
||||
txa
|
||||
clc
|
||||
.9 rts
|
||||
.9 rts
|
||||
|
||||
SKT.Socket.FindFree
|
||||
ldy #0
|
||||
@ -128,10 +128,7 @@ SKT.bind >SYSCALL GetMemPtr
|
||||
.1 jsr SKT.FindMatchingLoc
|
||||
bcc .9
|
||||
|
||||
jsr SKT.SetLocAddr
|
||||
|
||||
clc
|
||||
rts
|
||||
jmp SKT.SetLocAddr
|
||||
|
||||
.9 lda #ERR.SKT.BUSY
|
||||
sec
|
||||
@ -161,9 +158,7 @@ SKT.connect >SYSCALL GetMemPtr
|
||||
jmp (J.SKT.connect,x)
|
||||
SKT.connect.RAW
|
||||
SKT.connect.DGRAM
|
||||
jsr SKT.SetRemAddr
|
||||
clc
|
||||
rts
|
||||
jmp SKT.SetRemAddr
|
||||
SKT.connect.STREAM
|
||||
SKT.connect.SEQPACKET
|
||||
jsr SKT.SetRemAddr
|
||||
@ -218,7 +213,7 @@ SKT.listen >SYSCALL GetMemPtr
|
||||
|
||||
.9 lda #ERR.SKT.BAD
|
||||
sec
|
||||
rts
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # Accept
|
||||
* Accept a connection on a socket
|
||||
@ -276,22 +271,30 @@ SKT.Accept >SYSCALL GetMemPtr
|
||||
* `>LIBCALL hLIBTCPIP,LIBTCPIP.shutdown`
|
||||
* ## RETURN VALUE
|
||||
*\--------------------------------------
|
||||
SKT.shutdown >SYSCALL GetMemPtr
|
||||
SKT.shutdown pha
|
||||
>SYSCALL GetMemPtr
|
||||
>STYA ZPPtrSKT
|
||||
|
||||
ldy #S.SOCKET.O
|
||||
lda (ZPPtrSKT),y
|
||||
and #S.SOCKET.O.ACCEPTCONN
|
||||
bne SKT.shutdown.LISTEN
|
||||
|
||||
ldy #S.SOCKET.T
|
||||
lda (ZPPtrSKT),y
|
||||
|
||||
cmp #S.SOCKET.T.STREAM
|
||||
beq .10 TCP
|
||||
cmp #S.SOCKET.T.RAW+1
|
||||
bcs .9 no #S.SOCKET.T.DGRAM, nor #S.SOCKET.T.RAW
|
||||
tax
|
||||
jmp (J.SKT.shutdown,x)
|
||||
|
||||
SKT.shutdown.LISTEN
|
||||
SKT.shutdown.RAW
|
||||
SKT.shutdown.DGRAM
|
||||
SKT.shutdown.SEQPACKET
|
||||
|
||||
.1 ldy #S.SOCKET.HQ.TAIL
|
||||
lda (ZPPtrSKT),y
|
||||
ldy #S.SOCKET.HQ.HEAD
|
||||
cmp (ZPPtrSKT),y
|
||||
beq .8 No frame in Queue, close..
|
||||
beq .3 No frame in Queue, close..
|
||||
|
||||
pha save tail...
|
||||
clc
|
||||
@ -313,36 +316,42 @@ SKT.shutdown >SYSCALL GetMemPtr
|
||||
>SYSCALL FreeMem
|
||||
bra .1
|
||||
|
||||
.8 clc
|
||||
.3 pla get hFD...
|
||||
|
||||
ldx #0
|
||||
|
||||
.4 cmp SKT.TABLE,x
|
||||
beq .5
|
||||
|
||||
inx
|
||||
cpx #K.SKTTABLE.SIZE
|
||||
bne .4
|
||||
|
||||
.5 stz SKT.TABLE,x
|
||||
>SYSCALL freemem
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #ERR.SKT.BAD
|
||||
sec
|
||||
.99 rts
|
||||
SKT.shutdown.STREAM
|
||||
pla
|
||||
|
||||
.10 ldy #S.SOCKET.O
|
||||
lda (ZPPtrSKT),y
|
||||
bit #S.SOCKET.O.ACCEPTCONN
|
||||
|
||||
bne * TO DO: Listening socket
|
||||
|
||||
ldy #S.SOCKET.TCP.S
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #S.SOCKET.TCP.S.CLWAIT
|
||||
bne .11
|
||||
bne .1
|
||||
|
||||
lda #S.SOCKET.TCP.S.LASTACK
|
||||
bra .12
|
||||
bra .2
|
||||
|
||||
.11 lda #S.SOCKET.TCP.S.FINWT1
|
||||
.12 sta (ZPPtrSKT),y
|
||||
.1 lda #S.SOCKET.TCP.S.FINWT1
|
||||
.2 sta (ZPPtrSKT),y
|
||||
|
||||
ldy #S.SOCKET.TCP.O
|
||||
lda (ZPPtrSKT),y
|
||||
ora #S.TCP.OPTIONS.FIN+S.TCP.OPTIONS.ACK
|
||||
sta (ZPPtrSKT),y
|
||||
|
||||
jmp TCP.OUT Try to push FIN/ACK
|
||||
jmp TCP.OUT
|
||||
*/--------------------------------------
|
||||
* # Read (STREAM)
|
||||
* ## C
|
||||
@ -651,20 +660,22 @@ SKT.PullRemAddr >PULLW ZPTmpPtr1
|
||||
bpl .1
|
||||
rts
|
||||
*--------------------------------------
|
||||
SKT.SetLocAddr ldy #S.SOCKET.LOC.ADDR
|
||||
SKT.SetLocAddr ldy #S.SOCKET.LOC.PORT+1
|
||||
.1 lda SKT.LOC.ADDR+S.SOCKADDR.ADDR-S.SOCKET.LOC.ADDR,y
|
||||
sta (ZPPtrSKT),y
|
||||
iny
|
||||
cpy #S.SOCKET.LOC.PORT+2
|
||||
bne .1
|
||||
dey
|
||||
cpy #S.SOCKET.LOC.ADDR
|
||||
bcs .1
|
||||
* clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
SKT.SetRemAddr ldy #S.SOCKET.REM.ADDR
|
||||
SKT.SetRemAddr ldy #S.SOCKET.REM.PORT+1
|
||||
.1 lda SKT.REM.ADDR+S.SOCKADDR.ADDR-S.SOCKET.REM.ADDR,y
|
||||
sta (ZPPtrSKT),y
|
||||
iny
|
||||
cpy #S.SOCKET.REM.PORT+2
|
||||
bne .1
|
||||
dey
|
||||
cpy #S.SOCKET.REM.ADDR
|
||||
bcs .1
|
||||
* clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
SKT.FindMatchingLocRem
|
||||
|
@ -278,12 +278,12 @@ TCP.IN.SetDataInPtrAndLen
|
||||
ldy #S.IP.TOTAL.LENGTH+1
|
||||
lda (ZPFrameInPtr),y
|
||||
sec
|
||||
sbc #S.IP-S.ETH
|
||||
sbc #S.IP-S.ETH.EII
|
||||
sta ZPDataInLen
|
||||
|
||||
dey
|
||||
lda (ZPFrameInPtr),y
|
||||
sbc /S.IP-S.ETH
|
||||
sbc /S.IP-S.ETH.EII
|
||||
sta ZPDataInLen+1
|
||||
|
||||
ldy #S.TCP.DATAOFFSET
|
||||
|
@ -139,6 +139,10 @@ J.SKT.connect .DA SKT.connect.RAW
|
||||
.DA SKT.connect.DGRAM
|
||||
.DA SKT.connect.SEQPACKET
|
||||
.DA SKT.connect.STREAM
|
||||
J.SKT.shutdown .DA SKT.shutdown.RAW
|
||||
.DA SKT.shutdown.DGRAM
|
||||
.DA SKT.shutdown.SEQPACKET
|
||||
.DA SKT.shutdown.STREAM
|
||||
J.SKT.send .DA SKT.send.RAW
|
||||
.DA SKT.send.DGRAM
|
||||
.DA SKT.send.SEQPACKET
|
||||
@ -190,22 +194,22 @@ POLL >PUSHW L.IOCTL
|
||||
dex
|
||||
bpl .10
|
||||
|
||||
ldy #S.ETH.ETHERTYPE
|
||||
ldy #S.ETH.EII.TYPE
|
||||
lda (ZPFrameInPtr),y
|
||||
tax
|
||||
iny
|
||||
lda (ZPFrameInPtr),y
|
||||
|
||||
cmp #S.ETH.ETHERTYPE.ARP
|
||||
cmp #S.ETH.EII.TYPE.ARP
|
||||
bne .1
|
||||
cpx /S.ETH.ETHERTYPE.ARP
|
||||
cpx /S.ETH.EII.TYPE.ARP
|
||||
bne .1
|
||||
|
||||
jmp ARP.IN
|
||||
|
||||
.1 cmp #S.ETH.ETHERTYPE.IP
|
||||
.1 cmp #S.ETH.EII.TYPE.IP
|
||||
bne .9
|
||||
cpx /S.ETH.ETHERTYPE.IP
|
||||
cpx /S.ETH.EII.TYPE.IP
|
||||
bne .9
|
||||
|
||||
jmp IP.IN
|
||||
@ -289,8 +293,6 @@ CFG.hCfgFile .BS 1
|
||||
CFG.IP .BS 4
|
||||
CFG.HOSTS.SScanF .AZ "%d.%d.%d.%d %s %s"
|
||||
*--------------------------------------
|
||||
SKT.TABLE .BS K.SKTTABLE.SIZE
|
||||
*--------------------------------------
|
||||
SA.LOCAL .DA #AF.INET S.SOCKADDR.AF
|
||||
.BS 1
|
||||
.BS 4 S.SOCKADDR.ADDR
|
||||
@ -337,8 +339,8 @@ DNS.CACHE .BS K.DNSCACHE.SIZE*S.DNSCACHE
|
||||
*--------------------------------------
|
||||
ARP.REQ .HS FFFFFFFFFFFF S.ETH.DSTMAC
|
||||
ARP.REQ.SRCMAC .BS 6
|
||||
ARP.REQ.ETYPE .DA /S.ETH.ETHERTYPE.ARP
|
||||
.DA #S.ETH.ETHERTYPE.ARP
|
||||
ARP.REQ.ETYPE .DA /S.ETH.EII.TYPE.ARP
|
||||
.DA #S.ETH.EII.TYPE.ARP
|
||||
.HS 0001.0800.06.04
|
||||
ARP.REQ.OP .DA /S.ARP.OPERATION.REQ
|
||||
.DA #S.ARP.OPERATION.REQ
|
||||
@ -350,8 +352,8 @@ ARP.REQ.TPA .BS 4
|
||||
ARP.REP .EQ *
|
||||
ARP.REP.DSTMAC .BS 6
|
||||
ARP.REP.SRCMAC .BS 6
|
||||
ARP.REP.ETYPE .DA /S.ETH.ETHERTYPE.ARP
|
||||
.DA #S.ETH.ETHERTYPE.ARP
|
||||
ARP.REP.ETYPE .DA /S.ETH.EII.TYPE.ARP
|
||||
.DA #S.ETH.EII.TYPE.ARP
|
||||
.HS 0001.0800.06.04
|
||||
ARP.REP.OP .DA /S.ARP.OPERATION.REP
|
||||
.DA #S.ARP.OPERATION.REP
|
||||
@ -383,6 +385,8 @@ DYNPORT.LAST .DA K.DYNPORT.START
|
||||
hDNSSocket .BS 1
|
||||
DNS.TmpCache .BS S.DNSCACHE
|
||||
ARP.TmpCache .BS S.ARP
|
||||
*--------------------------------------
|
||||
SKT.TABLE .BS K.SKTTABLE.SIZE
|
||||
SKT.LOC.ADDR .BS S.SOCKADDR
|
||||
SKT.REM.ADDR .BS S.SOCKADDR
|
||||
SKT.TmpCache .BS S.SOCKET.TCP
|
||||
|
@ -77,7 +77,12 @@ Cmd.Parse >STZ.G CMD.IntCmd
|
||||
|
||||
rts
|
||||
|
||||
.6 jsr CMD.AddCmdBufTokenToArgV
|
||||
.6 jsr CMD.CheckIO
|
||||
bcc .7
|
||||
tay
|
||||
bne .9
|
||||
|
||||
jsr CMD.AddCmdBufTokenToArgV
|
||||
bcs .9
|
||||
|
||||
.7 jsr CMD.NextCmdBufToken
|
||||
@ -213,7 +218,7 @@ Cmd.SearchExt pha
|
||||
>LDYA ZPCMDBuf push CMD
|
||||
>SYSCALL FileSearch
|
||||
rts
|
||||
*--------------------------------------
|
||||
*--------------------------------------
|
||||
Cmd.Exec >LDA.G CMD.IntCmd
|
||||
bmi .1
|
||||
tax
|
||||
@ -644,6 +649,55 @@ Cmd.INT.IF >STZ.G CMD.IFNOT
|
||||
|
||||
.9 jmp Cmd.Exec.ERRSYN
|
||||
*--------------------------------------
|
||||
CMD.CheckIO >LDYA L.CMD.IO
|
||||
jsr CMD.Search
|
||||
bcs .9 not a IO token...should be an arg....
|
||||
phx
|
||||
|
||||
jsr CMD.NextCmdBufToken skip this IO token
|
||||
|
||||
plx
|
||||
|
||||
jmp (J.CMD.IO,x)
|
||||
|
||||
.9 lda #0
|
||||
rts
|
||||
*--------------------------------------
|
||||
CMD.IO.AMP
|
||||
clc
|
||||
rts
|
||||
CMD.IO.PIPE
|
||||
clc
|
||||
rts
|
||||
CMD.IO.IN
|
||||
clc
|
||||
rts
|
||||
|
||||
CMD.IO.OUTA
|
||||
CMD.IO.1OUTA lda #O.WRONLY+O.APPEND+O.CREATE
|
||||
CMD.IO.OUT
|
||||
CMD.IO.1OUT lda #O.WRONLY+O.TRUNC+O.CREATE
|
||||
|
||||
lda (ZPCMDBuf)
|
||||
beq .99 no arg left....
|
||||
|
||||
>LDYA ZPCMDBuf
|
||||
>SYSCALL realpath
|
||||
bcs .9
|
||||
|
||||
jsr CMD.NextCmdBufToken skip arg
|
||||
clc
|
||||
rts
|
||||
|
||||
.99 lda #E.SYN
|
||||
sec
|
||||
.9 rts
|
||||
|
||||
CMD.IO.2OUTA lda #O.WRONLY+O.APPEND+O.CREATE
|
||||
CMD.IO.2OUT lda #O.WRONLY+O.TRUNC+O.CREATE
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CMD.NextCmdBufToken
|
||||
lda (ZPCMDBuf)
|
||||
inc ZPCMDBuf
|
||||
|
@ -78,6 +78,15 @@ J.CMD.INT .DA Cmd.INT.STARTPROC
|
||||
.DA Cmd.INT.SLEEP
|
||||
.DA Cmd.INT.TIME
|
||||
L.CMD.IO .DA CMD.IO
|
||||
J.CMD.IO .DA CMD.IO.AMP
|
||||
.DA CMD.IO.PIPE
|
||||
.DA CMD.IO.IN
|
||||
.DA CMD.IO.OUTA
|
||||
.DA CMD.IO.OUT
|
||||
.DA CMD.IO.1OUTA
|
||||
.DA CMD.IO.1OUT
|
||||
.DA CMD.IO.2OUTA
|
||||
.DA CMD.IO.2OUT
|
||||
L.CSH.BOPS .DA CSH.BOPS
|
||||
J.CSH.BOPS .DA CSH.BOPS.ADD
|
||||
.DA CSH.BOPS.SUB
|
||||
@ -381,17 +390,6 @@ ENV.HOME .AZ "HOME"
|
||||
*--------------------------------------
|
||||
* https://www.tldp.org/LDP/abs/html/io-redirection.html
|
||||
*--------------------------------------
|
||||
CMD.IO .AZ "&"
|
||||
.AZ "|"
|
||||
.AZ "<"
|
||||
.AZ ">>"
|
||||
.AZ ">"
|
||||
.AZ "1>>"
|
||||
.AZ "1>"
|
||||
.AZ "2>>"
|
||||
.AZ "2>"
|
||||
.HS 00
|
||||
*--------------------------------------
|
||||
CMD.INT .AZ "STARTPROC"
|
||||
.AZ "CD"
|
||||
.AZ "DATE"
|
||||
@ -406,6 +404,17 @@ CMD.INT .AZ "STARTPROC"
|
||||
.AZ "TIME"
|
||||
.HS 00
|
||||
*--------------------------------------
|
||||
CMD.IO .AZ "&"
|
||||
.AZ "|"
|
||||
.AZ "<"
|
||||
.AZ ">>"
|
||||
.AZ ">"
|
||||
.AZ "1>>"
|
||||
.AZ "1>"
|
||||
.AZ "2>>"
|
||||
.AZ "2>"
|
||||
.HS 00
|
||||
*--------------------------------------
|
||||
CMD.IF.Chars .AS "def"
|
||||
CMD.IF.Chars.Cnt .EQ *-CMD.IF.Chars
|
||||
*--------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user