mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-20 11:29:29 +00:00
Kernel 0.9.2
This commit is contained in:
parent
132294a2b0
commit
16d0c31b3e
|
@ -94,21 +94,34 @@
|
||||||
A = hFile
|
A = hFile
|
||||||
|
|
||||||
# SKT.Read (STREAM)
|
# SKT.Read (STREAM)
|
||||||
Read data in pBuf
|
|
||||||
**In:**
|
## C
|
||||||
PUSHB = hSocket
|
`int skt.read(hFD fd, void *buf, int count);`
|
||||||
PUSHW = pBuf
|
|
||||||
PUSHW = len
|
## ASM
|
||||||
|
**In:**
|
||||||
|
`>PUSHWI count`
|
||||||
|
`>PUSHW buf`
|
||||||
|
`lda fd`
|
||||||
|
`>SYSCALL read`
|
||||||
**Out:**
|
**Out:**
|
||||||
Y,A = bytes transfered
|
CC: Y,A = bytes read
|
||||||
|
CS: A = EC
|
||||||
|
|
||||||
# SKT.Write (STREAM)
|
# SKT.Write (STREAM)
|
||||||
Send block of data
|
|
||||||
**In:**
|
## C
|
||||||
PUSHB = hSocket
|
`int skt.write(hFD fd, const void *buf, int count);`
|
||||||
PUSHW = pBuf
|
|
||||||
PUSHW = len
|
## ASM
|
||||||
**Out:**
|
**In:**
|
||||||
|
`>PUSHWI count`
|
||||||
|
`>PUSHW buf`
|
||||||
|
`lda fd`
|
||||||
|
`>SYSCALL write`
|
||||||
|
**Out:**
|
||||||
|
CC: Y,A = bytes written
|
||||||
|
CS: A = EC
|
||||||
|
|
||||||
# SKT.Rcvd (DGRAM,RAW)
|
# SKT.Rcvd (DGRAM,RAW)
|
||||||
**In:**
|
**In:**
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -11,7 +11,7 @@ AUTO 4,1
|
||||||
.INB INC/ETH.I
|
.INB INC/ETH.I
|
||||||
.INB INC/LIBTCPIP.I
|
.INB INC/LIBTCPIP.I
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TIMEOUT.MAX .EQ 20 2 sec.
|
TIMEOUT.MAX .EQ 40 4 sec.
|
||||||
BUFSIZE .EQ 256
|
BUFSIZE .EQ 256
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
ZPIPCfgPtr .EQ ZPBIN
|
ZPIPCfgPtr .EQ ZPBIN
|
||||||
|
@ -169,9 +169,10 @@ CS.RUN.OPENSKT ldx #3
|
||||||
|
|
||||||
CS.RUN.LOOP >SLEEP
|
CS.RUN.LOOP >SLEEP
|
||||||
|
|
||||||
>PUSHB.G hSocket
|
|
||||||
>PUSHW ZPBufPtr
|
|
||||||
>PUSHWI BUFSIZE
|
>PUSHWI BUFSIZE
|
||||||
|
>PUSHW ZPBufPtr
|
||||||
|
>LDA.G hSocket
|
||||||
|
|
||||||
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.Read
|
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.Read
|
||||||
bcc .1
|
bcc .1
|
||||||
|
|
||||||
|
@ -204,9 +205,9 @@ CS.RUN.LOOP >SLEEP
|
||||||
cmp #3 Ctrl-C
|
cmp #3 Ctrl-C
|
||||||
beq CS.RUN.USER
|
beq CS.RUN.USER
|
||||||
|
|
||||||
>PUSHB.G hSocket
|
|
||||||
>PUSHW ZPBufPtr
|
|
||||||
>PUSHW ZPBufLen
|
>PUSHW ZPBufLen
|
||||||
|
>PUSHW ZPBufPtr
|
||||||
|
>LDA.G hSocket
|
||||||
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.Write
|
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.Write
|
||||||
bcs CS.RUN.SKTERR
|
bcs CS.RUN.SKTERR
|
||||||
|
|
||||||
|
@ -287,7 +288,7 @@ hLIBTCPIP .BS 1
|
||||||
MSG.IPKO .AZ "TCP/IP Not Loaded/Configured."
|
MSG.IPKO .AZ "TCP/IP Not Loaded/Configured."
|
||||||
MSG.USAGE .AZ "Usage : TELNET <ip|host> [port]"
|
MSG.USAGE .AZ "Usage : TELNET <ip|host> [port]"
|
||||||
MSG.UNKNOWN .AZ "%s: Unknown host\r\n"
|
MSG.UNKNOWN .AZ "%s: Unknown host\r\n"
|
||||||
MSG.HOSTOK .AZ "Connecting to %d.%d.%d.%d:%D (%s) ...\r\n"
|
MSG.HOSTOK .AZ "Connecting to %d.%d.%d.%d:%D (%s)..."
|
||||||
MSG.SKTKO .AZ "Failed to Open Socket."
|
MSG.SKTKO .AZ "Failed to Open Socket."
|
||||||
MSG.SKTOK .AZ "Connected."
|
MSG.SKTOK .AZ "Connected."
|
||||||
MSG.SKTERR .AZ "Socket Error : $%h\r\n"
|
MSG.SKTERR .AZ "Socket Error : $%h\r\n"
|
||||||
|
|
|
@ -1081,13 +1081,13 @@ KeyRemappedRGHT .HS 1B5B4300 esc[C
|
||||||
TelnetOpt .DA #IAC,#DO,#TELOPT.ECHO
|
TelnetOpt .DA #IAC,#DO,#TELOPT.ECHO
|
||||||
TelnetOpt.LEN .EQ *-TelnetOpt
|
TelnetOpt.LEN .EQ *-TelnetOpt
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
WILLDO .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.NAWS
|
WILLDO .DA #TELOPT.BINARY,#TELOPT.SGA
|
||||||
WILLDO.CNT .EQ *-WILLDO
|
WILLDO.CNT .EQ *-WILLDO
|
||||||
WILLDONT .DA #TELOPT.TSPEED,#TELOPT.LINEMODE
|
WILLDONT .DA #TELOPT.TSPEED,#TELOPT.LINEMODE,#TELOPT.STATUS
|
||||||
WILLDONT.CNT .EQ *-WILLDONT
|
WILLDONT.CNT .EQ *-WILLDONT
|
||||||
DOWILL .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.NAWS,#TELOPT.TTYPE
|
DOWILL .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.NAWS,#TELOPT.TTYPE
|
||||||
DOWILL.CNT .EQ *-DOWILL
|
DOWILL.CNT .EQ *-DOWILL
|
||||||
DOWONT .DA #TELOPT.NEWENVIRON
|
DOWONT .DA #TELOPT.NEWENVIRON,#TELOPT.XDISPLOC,#TELOPT.TSPEED,#TELOPT.LFLOW,#TELOPT.NAWS
|
||||||
DOWONT.CNT .EQ *-DOWONT
|
DOWONT.CNT .EQ *-DOWONT
|
||||||
SB.IS.TTYPE .DA #IAC,#SB,#TELOPT.TTYPE,#SB.IS
|
SB.IS.TTYPE .DA #IAC,#SB,#TELOPT.TTYPE,#SB.IS
|
||||||
.AS 'XTERM'
|
.AS 'XTERM'
|
||||||
|
|
|
@ -328,17 +328,22 @@ SKT.MkNod sta .1+1
|
||||||
.9 rts
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # SKT.Read (STREAM)
|
* # SKT.Read (STREAM)
|
||||||
* Read data in pBuf
|
* ## C
|
||||||
* **In:**
|
* `int skt.read(hFD fd, void *buf, int count);`
|
||||||
* PUSHB = hSocket
|
* ## ASM
|
||||||
* PUSHW = pBuf
|
* **In:**
|
||||||
* PUSHW = len
|
* `>PUSHWI count`
|
||||||
|
* `>PUSHW buf`
|
||||||
|
* `lda fd`
|
||||||
|
* `>SYSCALL read`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* Y,A = bytes transfered
|
* CC: Y,A = bytes read
|
||||||
|
* CS: A = EC
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
SKT.Read >PULLW ZPDataInLen !!!use DataInPtr/Len
|
SKT.Read pha
|
||||||
>PULLW ZPDataInPtr !!!DataOut trashed when sending ACK in TCP.OUT
|
>PULLW ZPDataInPtr !!!DataOut trashed when sending ACK in TCP.OUT
|
||||||
>PULLA
|
>PULLW ZPDataInLen !!!use DataInPtr/Len
|
||||||
|
pla
|
||||||
|
|
||||||
SKT.Read.I jsr SKT.Get.I
|
SKT.Read.I jsr SKT.Get.I
|
||||||
bcs .99
|
bcs .99
|
||||||
|
@ -373,16 +378,22 @@ SKT.Read.I jsr SKT.Get.I
|
||||||
.99 rts
|
.99 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # SKT.Write (STREAM)
|
* # SKT.Write (STREAM)
|
||||||
* Send block of data
|
* ## C
|
||||||
* **In:**
|
* `int skt.write(hFD fd, const void *buf, int count);`
|
||||||
* PUSHB = hSocket
|
* ## ASM
|
||||||
* PUSHW = pBuf
|
* **In:**
|
||||||
* PUSHW = len
|
* `>PUSHWI count`
|
||||||
* **Out:**
|
* `>PUSHW buf`
|
||||||
|
* `lda fd`
|
||||||
|
* `>SYSCALL write`
|
||||||
|
* **Out:**
|
||||||
|
* CC: Y,A = bytes written
|
||||||
|
* CS: A = EC
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
SKT.Write >PULLW ZPDataInLen
|
SKT.Write pha
|
||||||
>PULLW ZPDataInPtr
|
>PULLW ZPDataInPtr
|
||||||
>PULLA
|
>PULLW ZPDataInLen
|
||||||
|
pla
|
||||||
|
|
||||||
jsr SKT.Get.I
|
jsr SKT.Get.I
|
||||||
bcs .9
|
bcs .9
|
||||||
|
@ -820,7 +831,8 @@ SKT.GetDataFromSktIn
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 lda #0 NO DATA
|
.9
|
||||||
|
* lda #0 NO DATA
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
|
@ -150,8 +150,8 @@ TCP.IN.JMP.LISTEN
|
||||||
TCP.IN.JMP.SYNSENT
|
TCP.IN.JMP.SYNSENT
|
||||||
ldy #S.TCP.OPTIONS SYN Send, only accept SYN.ACK packet, then Send ACK
|
ldy #S.TCP.OPTIONS SYN Send, only accept SYN.ACK packet, then Send ACK
|
||||||
lda (ZPFrameInPtr),y
|
lda (ZPFrameInPtr),y
|
||||||
cmp #S.TCP.OPTIONS.SYN+S.TCP.OPTIONS.ACK
|
bit #S.TCP.OPTIONS.SYN+S.TCP.OPTIONS.ACK
|
||||||
bne .8
|
beq .8
|
||||||
|
|
||||||
jsr SKT.GetTCB
|
jsr SKT.GetTCB
|
||||||
|
|
||||||
|
@ -462,6 +462,8 @@ TCP.OUT.SendOptA.1
|
||||||
bit #S.TCP.OPTIONS.ACK
|
bit #S.TCP.OPTIONS.ACK
|
||||||
beq .10
|
beq .10
|
||||||
|
|
||||||
|
* pha
|
||||||
|
|
||||||
ldx #3
|
ldx #3
|
||||||
ldy #S.TCP.ACKNUM+3
|
ldy #S.TCP.ACKNUM+3
|
||||||
|
|
||||||
|
@ -471,10 +473,20 @@ TCP.OUT.SendOptA.1
|
||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
.10 ldx #3
|
* pla
|
||||||
|
|
||||||
|
.10
|
||||||
|
* clc
|
||||||
|
* bit #S.TCP.OPTIONS.FIN
|
||||||
|
* beq .11
|
||||||
|
* sec
|
||||||
|
|
||||||
|
.11 ldx #3
|
||||||
ldy #S.TCP.SEQNUM+3
|
ldy #S.TCP.SEQNUM+3
|
||||||
|
|
||||||
.2 lda SKT.TCBCache+S.TCB.OUTNEXTSEQ,x
|
.2 lda SKT.TCBCache+S.TCB.OUTNEXTSEQ,x
|
||||||
|
* adc #0
|
||||||
|
* sta SKT.TCBCache+S.TCB.OUTNEXTSEQ,x
|
||||||
sta (ZPFrameOutPtr),y
|
sta (ZPFrameOutPtr),y
|
||||||
dey
|
dey
|
||||||
dex
|
dex
|
||||||
|
|
Loading…
Reference in New Issue
Block a user