mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 20:33:13 +00:00
Kernel 0.93
This commit is contained in:
parent
b6fdc79b80
commit
26d4d0a64a
Binary file not shown.
@ -191,7 +191,6 @@ S.SOCKET.TCP.INSEQNUM .EQ S.SOCKET+22 Recv:Last SEQ received from remote
|
|||||||
|
|
||||||
S.SOCKET.TCP.OUTSEQNUM .EQ S.SOCKET+26 Send:SEQ sent not yet ACKed (retransmit)
|
S.SOCKET.TCP.OUTSEQNUM .EQ S.SOCKET+26 Send:SEQ sent not yet ACKed (retransmit)
|
||||||
S.SOCKET.TCP.OUTNEXTSEQ .EQ S.SOCKET+30 Send:Next SEQ to send
|
S.SOCKET.TCP.OUTNEXTSEQ .EQ S.SOCKET+30 Send:Next SEQ to send
|
||||||
*S.SOCKET.TCP.OUTACKNUM .EQ S.SOCKET+34 Send:ACK to send to remote
|
|
||||||
*
|
*
|
||||||
S.SOCKET.TCP .EQ S.SOCKET+34
|
S.SOCKET.TCP .EQ S.SOCKET+34
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -356,7 +356,7 @@ SKT.shutdown.STREAM
|
|||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
lda #S.TCP.OPTIONS.FIN+S.TCP.OPTIONS.ACK
|
lda #S.TCP.OPTIONS.FIN+S.TCP.OPTIONS.ACK
|
||||||
jsr TCP.OUT.SendOptA
|
jsr TCP.OUT.SendOptA Send FIN/ACK
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
lda #S.SOCKET.TCP.S.FINWT1
|
lda #S.SOCKET.TCP.S.FINWT1
|
||||||
@ -365,7 +365,7 @@ SKT.shutdown.STREAM
|
|||||||
.1 cmp #S.SOCKET.TCP.S.TIMEWT
|
.1 cmp #S.SOCKET.TCP.S.TIMEWT
|
||||||
beq .8
|
beq .8
|
||||||
lda #S.TCP.OPTIONS.RST+S.TCP.OPTIONS.ACK
|
lda #S.TCP.OPTIONS.RST+S.TCP.OPTIONS.ACK
|
||||||
jsr TCP.OUT.SendOptA
|
jsr TCP.OUT.SendOptA Send RST/ACK
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
lda #S.SOCKET.TCP.S.TIMEWT
|
lda #S.SOCKET.TCP.S.TIMEWT
|
||||||
@ -484,27 +484,9 @@ SKT.GetDataFromSktIn
|
|||||||
.8 >ADC16 SKT.Cache+S.SOCKET.TCP.INFREE,ZPDataInLen
|
.8 >ADC16 SKT.Cache+S.SOCKET.TCP.INFREE,ZPDataInLen
|
||||||
>SBC16 SKT.Cache+S.SOCKET.TCP.INUSED,ZPDataInLen
|
>SBC16 SKT.Cache+S.SOCKET.TCP.INUSED,ZPDataInLen
|
||||||
|
|
||||||
* lda SKT.Cache+S.SOCKET.TCP.OUTACKNUM+3
|
|
||||||
* clc
|
|
||||||
* adc ZPDataInLen
|
|
||||||
* sta SKT.Cache+S.SOCKET.TCP.OUTACKNUM+3
|
|
||||||
* lda SKT.Cache+S.SOCKET.TCP.OUTACKNUM+2
|
|
||||||
* adc ZPDataInLen+1
|
|
||||||
* sta SKT.Cache+S.SOCKET.TCP.OUTACKNUM+2
|
|
||||||
|
|
||||||
* bcc .80
|
|
||||||
* inc SKT.Cache+S.SOCKET.TCP.OUTACKNUM+1
|
|
||||||
* bne .80
|
|
||||||
* inc SKT.Cache+S.SOCKET.TCP.OUTACKNUM
|
|
||||||
*.80
|
|
||||||
jsr SKT.StoreTCB
|
jsr SKT.StoreTCB
|
||||||
|
|
||||||
* lda #S.TCP.OPTIONS.ACK
|
jsr TCP.SetSocketTCPO.ACK ACK=1 -> send WSIZE
|
||||||
* jsr TCP.OUT.SendOptA
|
|
||||||
|
|
||||||
* jsr TCP.SetSocketTCPO.ACK ACK=1 -> send WSIZE
|
|
||||||
|
|
||||||
* jsr TCP.OUT.I SKT.GetTCB already called
|
|
||||||
|
|
||||||
>LDYA ZPDataInLen
|
>LDYA ZPDataInLen
|
||||||
clc
|
clc
|
||||||
@ -692,8 +674,6 @@ SKT.AddDataToSktOut
|
|||||||
>ADC16 SKT.Cache+S.SOCKET.TCP.OUTTOSEND,ZPDataInLen
|
>ADC16 SKT.Cache+S.SOCKET.TCP.OUTTOSEND,ZPDataInLen
|
||||||
jsr SKT.StoreTCB
|
jsr SKT.StoreTCB
|
||||||
|
|
||||||
* jsr TCP.OUT.I SKT.GetTCB called, try to push, ignore error....
|
|
||||||
|
|
||||||
>LDYA ZPDataInLen
|
>LDYA ZPDataInLen
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
@ -104,7 +104,7 @@ TCP.IN.JMP.SYNSENT
|
|||||||
jmp SKT.StoreTCB.S
|
jmp SKT.StoreTCB.S
|
||||||
|
|
||||||
.9 lda #S.TCP.OPTIONS.RST
|
.9 lda #S.TCP.OPTIONS.RST
|
||||||
jsr TCP.OUT.SendOptA
|
jsr TCP.OUT.SendOptA Send RST
|
||||||
|
|
||||||
ldx SKT.Index
|
ldx SKT.Index
|
||||||
lda SKT.TABLE,x
|
lda SKT.TABLE,x
|
||||||
@ -193,7 +193,7 @@ TCP.IN.JMP.ESTBLSH
|
|||||||
sbc TmpDWord+2
|
sbc TmpDWord+2
|
||||||
sta SKT.Cache+S.SOCKET.TCP.OUTUSED+1
|
sta SKT.Cache+S.SOCKET.TCP.OUTUSED+1
|
||||||
|
|
||||||
.3 jsr SKT.StoreTCB and update SKT
|
jsr SKT.StoreTCB
|
||||||
|
|
||||||
.4 jsr TCP.IN.SetDataInPtrAndLen
|
.4 jsr TCP.IN.SetDataInPtrAndLen
|
||||||
|
|
||||||
@ -227,12 +227,9 @@ TCP.IN.JMP.ESTBLSH
|
|||||||
bne .6
|
bne .6
|
||||||
inc SKT.Cache+S.SOCKET.TCP.INSEQNUM
|
inc SKT.Cache+S.SOCKET.TCP.INSEQNUM
|
||||||
|
|
||||||
.6 jsr TCP.SetSocketTCPO.ACK
|
.6 jsr SKT.StoreTCB update socket
|
||||||
|
|
||||||
* lda #S.TCP.OPTIONS.ACK
|
jsr TCP.SetSocketTCPO.ACK ...and ack data
|
||||||
* jsr TCP.OUT.SendOptA Try to ACK read DATA
|
|
||||||
|
|
||||||
jsr SKT.StoreTCB success, update socket
|
|
||||||
|
|
||||||
.7 ldy #S.TCP.OPTIONS
|
.7 ldy #S.TCP.OPTIONS
|
||||||
lda (ZPFrameInPtr),y
|
lda (ZPFrameInPtr),y
|
||||||
@ -245,7 +242,7 @@ TCP.IN.JMP.ESTBLSH
|
|||||||
|
|
||||||
jsr TCP.IN.ACKTheFIN
|
jsr TCP.IN.ACKTheFIN
|
||||||
lda #S.TCP.OPTIONS.FIN+S.TCP.OPTIONS.ACK
|
lda #S.TCP.OPTIONS.FIN+S.TCP.OPTIONS.ACK
|
||||||
jmp TCP.OUT.SendOptA FIN received, Send FIN.ACK
|
jmp TCP.SetSocketTCPO FIN received, Send FIN.ACK
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
.9 rts
|
.9 rts
|
||||||
@ -340,10 +337,10 @@ TCP.IN.ACKTheSYN
|
|||||||
.3 lda (ZPFrameInPtr),y Set OUTACK=SEQ+1 for new socket...
|
.3 lda (ZPFrameInPtr),y Set OUTACK=SEQ+1 for new socket...
|
||||||
adc #0
|
adc #0
|
||||||
sta SKT.Cache+S.SOCKET.TCP.INSEQNUM,x
|
sta SKT.Cache+S.SOCKET.TCP.INSEQNUM,x
|
||||||
* sta SKT.Cache+S.SOCKET.TCP.OUTACKNUM,x
|
|
||||||
dey
|
dey
|
||||||
dex
|
dex
|
||||||
bpl .3
|
bpl .3
|
||||||
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TCP.IN.ACKTheFIN
|
TCP.IN.ACKTheFIN
|
||||||
@ -356,13 +353,6 @@ TCP.IN.ACKTheFIN
|
|||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
*.2 ldx #3
|
|
||||||
|
|
||||||
*.3 inc SKT.Cache+S.SOCKET.TCP.OUTACKNUM,x
|
|
||||||
* bne .8
|
|
||||||
* dex
|
|
||||||
* bpl .3
|
|
||||||
|
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TCP.IN.SetDataInPtrAndLen
|
TCP.IN.SetDataInPtrAndLen
|
||||||
@ -441,6 +431,7 @@ TCP.SENDCLOSE ldx #0
|
|||||||
cmp #S.SOCKET.TCP.S.ESTBLSH
|
cmp #S.SOCKET.TCP.S.ESTBLSH
|
||||||
bne .8
|
bne .8
|
||||||
|
|
||||||
|
jsr SKT.GetTCB
|
||||||
jsr TCP.OUT
|
jsr TCP.OUT
|
||||||
|
|
||||||
bra .8
|
bra .8
|
||||||
@ -466,17 +457,7 @@ TCP.SENDCLOSE ldx #0
|
|||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TCP.SetSocketTCPO.ACK
|
TCP.OUT lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
|
||||||
lda #S.TCP.OPTIONS.ACK
|
|
||||||
TCP.SetSocketTCPO
|
|
||||||
ldy #S.SOCKET.TCP.O
|
|
||||||
ora (ZPPtrSKT),y
|
|
||||||
sta (ZPPtrSKT),y
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
TCP.OUT jsr SKT.GetTCB
|
|
||||||
|
|
||||||
TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
|
|
||||||
ldy SKT.Cache+S.SOCKET.TCP.OUTTOSEND
|
ldy SKT.Cache+S.SOCKET.TCP.OUTTOSEND
|
||||||
|
|
||||||
bne .1
|
bne .1
|
||||||
@ -505,9 +486,14 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
|
|||||||
|
|
||||||
jsr SKT.GetDataFromSktOut
|
jsr SKT.GetDataFromSktOut
|
||||||
|
|
||||||
lda #S.TCP.OPTIONS.ACK+S.TCP.OPTIONS.PSH
|
ldy #S.TCP.WINDOW
|
||||||
|
lda SKT.Cache+S.SOCKET.TCP.INFREE+1
|
||||||
|
sta (ZPFrameOutPtr),y
|
||||||
|
iny
|
||||||
|
lda SKT.Cache+S.SOCKET.TCP.INFREE
|
||||||
|
sta (ZPFrameOutPtr),y
|
||||||
|
|
||||||
* jsr TCP.SetSocketTCPO
|
lda #S.TCP.OPTIONS.ACK+S.TCP.OPTIONS.PSH
|
||||||
|
|
||||||
jsr TCP.OUT.Send
|
jsr TCP.OUT.Send
|
||||||
|
|
||||||
@ -533,7 +519,19 @@ TCP.OUT.SendOptA
|
|||||||
|
|
||||||
>LDYAI 0
|
>LDYAI 0
|
||||||
jsr TCP.NewFrame
|
jsr TCP.NewFrame
|
||||||
bcs TCP.OUT.Send.RTS
|
bcs TCP.OUT.Send.9
|
||||||
|
|
||||||
|
ldy #S.SOCKET.TCP.INFREE+1
|
||||||
|
lda (ZPPtrSKT),y
|
||||||
|
tax
|
||||||
|
dey
|
||||||
|
lda (ZPPtrSKT),y
|
||||||
|
|
||||||
|
ldy #S.TCP.WINDOW
|
||||||
|
sta (ZPFrameOutPtr),y
|
||||||
|
iny
|
||||||
|
txa
|
||||||
|
sta (ZPFrameOutPtr),y
|
||||||
|
|
||||||
ldy #S.SOCKET.TCP.O
|
ldy #S.SOCKET.TCP.O
|
||||||
lda (ZPPtrSKT),y
|
lda (ZPPtrSKT),y
|
||||||
@ -562,22 +560,22 @@ TCP.OUT.Send ldy #S.TCP.OPTIONS
|
|||||||
dex
|
dex
|
||||||
bpl .3
|
bpl .3
|
||||||
|
|
||||||
ldy #S.TCP.WINDOW
|
|
||||||
lda SKT.Cache+S.SOCKET.TCP.INFREE+1
|
|
||||||
sta (ZPFrameOutPtr),y
|
|
||||||
iny
|
|
||||||
lda SKT.Cache+S.SOCKET.TCP.INFREE
|
|
||||||
sta (ZPFrameOutPtr),y
|
|
||||||
|
|
||||||
jsr FRM.SendIP
|
jsr FRM.SendIP
|
||||||
bcs TCP.OUT.Send.RTS
|
bcs TCP.OUT.Send.9
|
||||||
|
|
||||||
ldy #S.SOCKET.TCP.O
|
ldy #S.SOCKET.TCP.O
|
||||||
lda #0
|
lda #0
|
||||||
sta (ZPPtrSKT),y
|
sta (ZPPtrSKT),y
|
||||||
|
|
||||||
* clc
|
* clc
|
||||||
TCP.OUT.Send.RTS
|
TCP.OUT.Send.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
TCP.SetSocketTCPO.ACK
|
||||||
|
lda #S.TCP.OPTIONS.ACK
|
||||||
|
TCP.SetSocketTCPO
|
||||||
|
ldy #S.SOCKET.TCP.O
|
||||||
|
ora (ZPPtrSKT),y
|
||||||
|
sta (ZPPtrSKT),y
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TCP.NewFrame ldx #S.IP.PROTOCOL.TCP
|
TCP.NewFrame ldx #S.IP.PROTOCOL.TCP
|
||||||
@ -592,13 +590,6 @@ TCP.NewFrame ldx #S.IP.PROTOCOL.TCP
|
|||||||
lda #$50 Header size = 5 DWORDS
|
lda #$50 Header size = 5 DWORDS
|
||||||
sta (ZPFrameOutPtr),y
|
sta (ZPFrameOutPtr),y
|
||||||
|
|
||||||
ldy #S.TCP.WINDOW
|
|
||||||
lda SKT.Cache+S.SOCKET.TCP.INFREE+1
|
|
||||||
sta (ZPFrameOutPtr),y
|
|
||||||
iny
|
|
||||||
lda SKT.Cache+S.SOCKET.TCP.INFREE
|
|
||||||
sta (ZPFrameOutPtr),y
|
|
||||||
|
|
||||||
clc
|
clc
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user