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