mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-24 05:35:33 +00:00
Kernel 0.93
This commit is contained in:
parent
4fbe9aa410
commit
f75c1173d9
Binary file not shown.
@ -76,28 +76,28 @@ IP.ComputeTCPChecksum
|
||||
lda ZPFrameOutLen
|
||||
sec
|
||||
sbc #S.IP
|
||||
sta ZPDataInLen
|
||||
sta IP.CHECKSUM.TMP
|
||||
|
||||
lda ZPFrameOutLen+1
|
||||
sbc /S.IP
|
||||
sta ZPDataInLen+1
|
||||
sta IP.CHECKSUM.TMP+1
|
||||
|
||||
clc
|
||||
|
||||
* lda ZPDataInLen+1
|
||||
* lda IP.CHECKSUM.TMP+1
|
||||
* adc /S.IP.PROTOCOL.TCP (all zero)
|
||||
sta IP.CHECKSUM
|
||||
|
||||
lda ZPDataInLen
|
||||
lda IP.CHECKSUM.TMP
|
||||
adc #S.IP.PROTOCOL.TCP
|
||||
sta IP.CHECKSUM+1
|
||||
|
||||
jsr IP.AddSrcDstIPToChecksum
|
||||
|
||||
lda ZPDataInLen
|
||||
lda IP.CHECKSUM.TMP
|
||||
eor #$ff
|
||||
tax
|
||||
lda ZPDataInLen+1
|
||||
lda IP.CHECKSUM.TMP+1
|
||||
eor #$ff
|
||||
|
||||
ldy #S.TCP.CHECKSUM
|
||||
|
@ -499,12 +499,12 @@ SKT.GetDataFromSktIn
|
||||
|
||||
.80 jsr SKT.StoreTCB
|
||||
|
||||
lda #S.TCP.OPTIONS.ACK
|
||||
* jsr TCP.OUT.SendOptA trash ZPDataInLen
|
||||
* lda #S.TCP.OPTIONS.ACK
|
||||
* jsr TCP.OUT.SendOptA
|
||||
|
||||
jsr TCP.SetSocketTCPO.ACK
|
||||
|
||||
* jsr TCP.OUT.I SKT.GetTCB already called
|
||||
jsr TCP.OUT.I SKT.GetTCB already called
|
||||
|
||||
>LDYA ZPDataInLen
|
||||
clc
|
||||
@ -528,7 +528,8 @@ SKT.Write jsr SKT.PullhFDDataInPtrLen
|
||||
jsr SKT.CheckStream
|
||||
bcs .99
|
||||
|
||||
jsr SKT.GetTCB
|
||||
jsr SKT.GetTCB
|
||||
|
||||
ldx SKT.Cache+S.SOCKET.TCP.OUTFREE
|
||||
cpx ZPDataInLen
|
||||
lda SKT.Cache+S.SOCKET.TCP.OUTFREE+1
|
||||
@ -610,7 +611,7 @@ SKT.AddDataToSktOut
|
||||
|
||||
jsr TCP.OUT.I SKT.GetTCB called, try to push, ignore error....
|
||||
|
||||
.88 >LDYA ZPDataInLen
|
||||
>LDYA ZPDataInLen
|
||||
clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
|
@ -32,62 +32,6 @@ TCP.IN.JMP.CLOSED
|
||||
>SYSCALL2 FreeMem
|
||||
rts
|
||||
*--------------------------------------
|
||||
TCP.SENDCLOSE ldx #0
|
||||
|
||||
.1 phx
|
||||
lda SKT.TABLE,x
|
||||
beq .8
|
||||
|
||||
>SYSCALL2 GetMemPtr
|
||||
>STYA ZPPtrSKT
|
||||
|
||||
ldy #S.SOCKET.AF
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #AF.INET
|
||||
bne .8
|
||||
|
||||
iny #S.SOCKET.T
|
||||
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #S.SOCKET.T.SEQPACKET
|
||||
bcc .8
|
||||
|
||||
ldy #S.SOCKET.TCP.S
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #S.SOCKET.TCP.S.TIMEWT
|
||||
beq .4
|
||||
|
||||
cmp #S.SOCKET.TCP.S.ESTBLSH
|
||||
bne .8
|
||||
|
||||
jsr TCP.OUT
|
||||
|
||||
bra .8
|
||||
|
||||
.4 ldy #S.SOCKET.SQ.hInMem
|
||||
lda (ZPPtrSKT),y
|
||||
>SYSCALL2 freemem
|
||||
|
||||
ldy #S.SOCKET.SQ.hOutMem
|
||||
lda (ZPPtrSKT),y
|
||||
>SYSCALL2 freemem
|
||||
|
||||
plx
|
||||
phx
|
||||
lda SKT.TABLE,x
|
||||
>SYSCALL2 freemem
|
||||
|
||||
plx
|
||||
phx
|
||||
stz SKT.TABLE,x
|
||||
|
||||
.8 plx
|
||||
inx
|
||||
cpx #K.SKTTABLE.SIZE
|
||||
bne .1
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
TCP.IN.JMP.LISTEN
|
||||
ldy #S.SOCKET.T Create a new client socket
|
||||
lda (ZPPtrSKT),y
|
||||
@ -327,10 +271,10 @@ TCP.IN.JMP.FINWT1
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
TCP.IN.JMP.FINWT2
|
||||
ldy #S.TCP.OPTIONS only accept FIN packet
|
||||
ldy #S.TCP.OPTIONS only accept ACK packet
|
||||
lda (ZPFrameInPtr),y
|
||||
|
||||
bit #S.TCP.OPTIONS.FIN
|
||||
bit #S.TCP.OPTIONS.ACK
|
||||
beq .8
|
||||
|
||||
jsr SKT.GetTCB
|
||||
@ -382,26 +326,20 @@ TCP.IN.ACKTheFIN
|
||||
jsr TCP.SetSocketTCPO.ACK
|
||||
|
||||
ldx #3
|
||||
|
||||
sec
|
||||
|
||||
.2 lda SKT.Cache+S.SOCKET.TCP.INLASTSEQNUM,x
|
||||
adc #0
|
||||
sta SKT.Cache+S.SOCKET.TCP.INLASTSEQNUM,x
|
||||
.1 inc SKT.Cache+S.SOCKET.TCP.INLASTSEQNUM,x
|
||||
bne .2
|
||||
dex
|
||||
bpl .2
|
||||
bpl .1
|
||||
|
||||
ldx #3
|
||||
.2 ldx #3
|
||||
|
||||
sec
|
||||
|
||||
.3 lda SKT.Cache+S.SOCKET.TCP.OUTACKNUM,x
|
||||
adc #0
|
||||
sta SKT.Cache+S.SOCKET.TCP.OUTACKNUM,x
|
||||
.3 inc SKT.Cache+S.SOCKET.TCP.OUTACKNUM,x
|
||||
bne .8
|
||||
dex
|
||||
bpl .3
|
||||
|
||||
rts
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
TCP.IN.SetDataInPtrAndLen
|
||||
ldy #S.IP.TOTAL.LENGTH+1
|
||||
@ -451,6 +389,70 @@ TCP.IN.SetDataInPtrAndLen
|
||||
|
||||
TCP.IN.RTS rts
|
||||
*--------------------------------------
|
||||
TCP.SENDCLOSE ldx #0
|
||||
|
||||
.1 phx
|
||||
lda SKT.TABLE,x
|
||||
beq .8
|
||||
|
||||
>SYSCALL2 GetMemPtr
|
||||
>STYA ZPPtrSKT
|
||||
|
||||
ldy #S.SOCKET.AF
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #AF.INET
|
||||
bne .8
|
||||
|
||||
iny #S.SOCKET.T
|
||||
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #S.SOCKET.T.SEQPACKET
|
||||
bcc .8
|
||||
|
||||
ldy #S.SOCKET.TCP.S
|
||||
lda (ZPPtrSKT),y
|
||||
cmp #S.SOCKET.TCP.S.TIMEWT
|
||||
beq .4
|
||||
|
||||
cmp #S.SOCKET.TCP.S.ESTBLSH
|
||||
bne .8
|
||||
|
||||
jsr TCP.OUT
|
||||
|
||||
bra .8
|
||||
|
||||
.4 ldy #S.SOCKET.SQ.hInMem
|
||||
lda (ZPPtrSKT),y
|
||||
>SYSCALL2 freemem
|
||||
|
||||
ldy #S.SOCKET.SQ.hOutMem
|
||||
lda (ZPPtrSKT),y
|
||||
>SYSCALL2 freemem
|
||||
|
||||
plx
|
||||
phx
|
||||
lda SKT.TABLE,x
|
||||
>SYSCALL2 freemem
|
||||
|
||||
plx
|
||||
phx
|
||||
stz SKT.TABLE,x
|
||||
|
||||
.8 plx
|
||||
inx
|
||||
cpx #K.SKTTABLE.SIZE
|
||||
bne .1
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
TCP.SetSocketTCPO.ACK
|
||||
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
|
||||
@ -467,7 +469,7 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
|
||||
lda (ZPPtrSKT),y
|
||||
bne TCP.OUT.SendOptA a least an option...
|
||||
clc No data, no flag....exit
|
||||
rts
|
||||
.9 rts
|
||||
|
||||
.1 cpy #K.TCP.MSS
|
||||
pha
|
||||
@ -478,7 +480,7 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
|
||||
>LDYAI K.TCP.MSS yes send only MSS
|
||||
|
||||
.2 jsr TCP.NewFrame
|
||||
bcs TCP.IN.RTS
|
||||
bcs .9
|
||||
|
||||
jsr SKT.GetDataFromSktOut
|
||||
|
||||
@ -488,7 +490,7 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
|
||||
|
||||
jsr TCP.OUT.Send
|
||||
|
||||
bcs TCP.IN.RTS
|
||||
bcs .9
|
||||
|
||||
lda SKT.Cache+S.SOCKET.TCP.OUTNEXTSEQ+3
|
||||
clc
|
||||
@ -510,7 +512,7 @@ TCP.OUT.SendOptA
|
||||
|
||||
>LDYAI 0
|
||||
jsr TCP.NewFrame
|
||||
bcs TCP.IN.RTS
|
||||
bcs TCP.OUT.Send.RTS
|
||||
|
||||
ldy #S.SOCKET.TCP.O
|
||||
lda (ZPPtrSKT),y
|
||||
@ -547,21 +549,14 @@ TCP.OUT.Send ldy #S.TCP.OPTIONS
|
||||
sta (ZPFrameOutPtr),y
|
||||
|
||||
jsr FRM.SendIP
|
||||
bcs .9
|
||||
bcs TCP.OUT.Send.RTS
|
||||
|
||||
ldy #S.SOCKET.TCP.O
|
||||
lda #0
|
||||
sta (ZPPtrSKT),y
|
||||
|
||||
* clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
TCP.SetSocketTCPO.ACK
|
||||
lda #S.TCP.OPTIONS.ACK
|
||||
TCP.SetSocketTCPO
|
||||
ldy #S.SOCKET.TCP.O
|
||||
ora (ZPPtrSKT),y
|
||||
sta (ZPPtrSKT),y
|
||||
TCP.OUT.Send.RTS
|
||||
rts
|
||||
*--------------------------------------
|
||||
TCP.NewFrame ldx #S.IP.PROTOCOL.TCP
|
||||
|
@ -55,10 +55,10 @@ ZPPtrSKT .EQ ZPLIB+22
|
||||
|
||||
ZPCachePtr .EQ ZPLIB+24
|
||||
ZPTmpPtr1 .EQ ZPLIB+26
|
||||
ZPTmpPtr2 .EQ ZPLIB+28
|
||||
TmpDWord .EQ ZPLIB+28
|
||||
IP.CHECKSUM .EQ ZPLIB+28
|
||||
ZPTmpPtr2 .EQ ZPLIB+28
|
||||
ZPTmpPtr3 .EQ ZPLIB+30
|
||||
IP.CHECKSUM.TMP .EQ ZPLIB+30
|
||||
*--------------------------------------
|
||||
* File Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
|
@ -178,12 +178,12 @@ S.DCB.TTY.bG1ALT .EQ 15
|
||||
|
||||
S.DCB.TTY.OUTTAIL .EQ 16
|
||||
S.DCB.TTY.OUTHEAD .EQ 17
|
||||
S.DCB.TTY.INBUFFER .EQ 18
|
||||
S.DCB.TTY.INBUFFER.MAX .EQ 33
|
||||
S.DCB.TTY.OUTBUFFER .EQ 34
|
||||
S.DCB.TTY.OUTBUFFER.MAX .EQ 48
|
||||
S.DCB.TTY.INBUFFER .EQ 18
|
||||
S.DCB.TTY.INBUFFER.MAX .EQ 39
|
||||
S.DCB.TTY.OUTBUFFER .EQ 40
|
||||
S.DCB.TTY.OUTBUFFER.MAX .EQ 64
|
||||
*
|
||||
S.DCB.TTY .EQ 48
|
||||
S.DCB.TTY .EQ 64
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/SYS/KERNEL.S.DEF
|
||||
|
Loading…
x
Reference in New Issue
Block a user