Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-05-13 17:40:37 +02:00
parent b232facc43
commit aa29d2c12f
6 changed files with 66 additions and 46 deletions

Binary file not shown.

View File

@ -251,21 +251,19 @@ ARP.QUERY.I jsr ARP.FIND.BY.IP
ARP.FIND.BY.IP >LDYA L.ARP.CACHE ARP.FIND.BY.IP >LDYA L.ARP.CACHE
>STYA ZPCachePtr >STYA ZPCachePtr
lda #K.ARPCACHE.SIZE ldx #K.ARPCACHE.SIZE
sta TmpOffset
.1 lda (ZPCachePtr) .1 lda (ZPCachePtr)
beq .3 beq .3
ldx #3 ldy #S.ARPCACHE.IP
ldy #S.ARPCACHE.IP+3
.2 lda ARP.TmpCache+S.ARPCACHE.IP,x .2 lda ARP.TmpCache,y
cmp (ZPCachePtr),y cmp (ZPCachePtr),y
bne .3 bne .3
dey iny
dex cpy #S.ARPCACHE.IP+4
bpl .2 bne .2
clc clc
rts rts
@ -277,8 +275,9 @@ ARP.FIND.BY.IP >LDYA L.ARP.CACHE
bcc .8 bcc .8
inc ZPCachePtr+1 inc ZPCachePtr+1
.8 dec TmpOffset .8 dex
bne .1 bne .1
sec sec
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -252,18 +252,20 @@ DNS.FIND.BY.NAME
>LDYA L.DNS.CACHE >LDYA L.DNS.CACHE
>STYA ZPCachePtr >STYA ZPCachePtr
lda #K.DNSCACHE.SIZE ldx #K.DNSCACHE.SIZE
sta TmpOffset
.1 lda (ZPCachePtr) .1 lda (ZPCachePtr)
beq .6 empty DNS cache entry? beq .6 empty DNS cache entry?
phx
>PUSHW ZPPtrDNS >PUSHW ZPPtrDNS
ldy #S.DNSCACHE.hNAME ldy #S.DNSCACHE.hNAME
lda (ZPCachePtr),y lda (ZPCachePtr),y
>SYSCALL2 GetMemPtr >SYSCALL2 GetMemPtr
>SYSCALL2 StrCaseCmp >SYSCALL2 StrCaseCmp
plx
bcc .8 bcc .8
.6 lda ZPCachePtr .6 lda ZPCachePtr
@ -273,8 +275,9 @@ DNS.FIND.BY.NAME
bcc .7 bcc .7
inc ZPCachePtr+1 inc ZPCachePtr+1
.7 dec TmpOffset .7 dex
bne .1 bne .1
sec sec
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
@ -319,38 +322,45 @@ DNS.UPDATE.BY.ID
.7 dex .7 dex
bne .1 bne .1
sec sec
rts rts
*-------------------------------------- *--------------------------------------
DNS.FIND.FREE >LDYA L.DNS.CACHE DNS.FIND.FREE >LDYA L.DNS.CACHE
>STYA ZPCachePtr >STYA ZPCachePtr
lda #K.DNSCACHE.SIZE
sta TmpOffset
lda #$ff lda #$ff
sta TmpDWord sta TmpDWord
sta TmpDWord+1 sta TmpDWord+1
sta TmpDWord+2 sta TmpDWord+2
sta TmpDWord+3 sta TmpDWord+3
ldx #K.DNSCACHE.SIZE
.1 lda (ZPCachePtr) .1 lda (ZPCachePtr)
beq .8 empty DNS cache entry? beq .8 empty DNS cache entry?
bit #S.DNSCACHE.STATUS.STATIC+S.DNSCACHE.STATUS.PENDING bit #S.DNSCACHE.STATUS.STATIC+S.DNSCACHE.STATUS.PENDING
bne .6 Static/Pending.....skip bne .7 Static/Pending.....skip
phx
ldy #S.DNSCACHE.TTL ldy #S.DNSCACHE.TTL
ldx #3 ldx #3
sec sec
.2 lda TmpDWord,x is saved TTL greater then actual TTL? .2 lda TmpDWord,x is saved TTL greater then actual TTL?
sbc (ZPCachePtr),y sbc (ZPCachePtr),y
iny iny
dex dex
bpl .2 bpl .2
bcc .6 no, bcc .6 no,
ldy #S.DNSCACHE.TTL ldy #S.DNSCACHE.TTL
ldx #3 ldx #3
.3 lda (ZPCachePtr),y Save new lowest TTL .3 lda (ZPCachePtr),y Save new lowest TTL
sta TmpDWord,x sta TmpDWord,x
iny iny
@ -360,14 +370,16 @@ DNS.FIND.FREE >LDYA L.DNS.CACHE
>LDYA ZPCachePtr >LDYA ZPCachePtr
>STYA ZPTmpPtr1 save lowest TTL slot ... >STYA ZPTmpPtr1 save lowest TTL slot ...
.6 lda ZPCachePtr .6 plx
.7 lda ZPCachePtr
clc clc
adc #S.DNSCACHE adc #S.DNSCACHE
sta ZPCachePtr sta ZPCachePtr
bcc .7 bcc .71
inc ZPCachePtr+1 inc ZPCachePtr+1
.7 dec TmpOffset .71 dex
bne .1 no empty slot found, discard lowest TTL bne .1 no empty slot found, discard lowest TTL
>LDYA ZPTmpPtr1 >LDYA ZPTmpPtr1
@ -380,26 +392,33 @@ DNS.FIND.FREE >LDYA L.DNS.CACHE
DNS.EXPIRE >LDYA L.DNS.CACHE DNS.EXPIRE >LDYA L.DNS.CACHE
>STYA ZPCachePtr >STYA ZPCachePtr
lda #K.DNSCACHE.SIZE ldx #K.DNSCACHE.SIZE
sta TmpOffset
.1 lda (ZPCachePtr) .1 lda (ZPCachePtr)
beq .7 empty DNS cache entry? beq .7 empty DNS cache entry?
bit #S.DNSCACHE.STATUS.STATIC bit #S.DNSCACHE.STATUS.STATIC
bne .7 bne .7
phx
ldy #S.DNSCACHE.TTL ldy #S.DNSCACHE.TTL
ldx #4 ldx #4
clc clc
.2 lda (ZPCachePtr),y .2 lda (ZPCachePtr),y
sbc #0 sbc #0
sta (ZPCachePtr),y sta (ZPCachePtr),y
iny iny
dex dex
bne .2 bne .2
bcs .7
bcs .6
jsr DNS.FREE jsr DNS.FREE
.6 plx
.7 lda ZPCachePtr .7 lda ZPCachePtr
clc clc
adc #S.DNSCACHE adc #S.DNSCACHE
@ -407,8 +426,9 @@ DNS.EXPIRE >LDYA L.DNS.CACHE
bcc .8 bcc .8
inc ZPCachePtr+1 inc ZPCachePtr+1
.8 dec TmpOffset .8 dex
bne .1 bne .1
clc clc
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -514,14 +514,9 @@ SKT.GetDataFromSktIn
.80 jsr SKT.StoreTCB .80 jsr SKT.StoreTCB
ldy #S.SOCKET.TCP.O jsr TCP.SetSocketTCPO.ACK Send the new WSIZE
lda (ZPPtrSKT),y
ora #S.TCP.OPTIONS.ACK
sta (ZPPtrSKT),y
jsr TCP.OUT.I SKT.GetTCB already called, Try to ACK read DATA >LDYA ZPTmpPtr3
.88 >LDYA ZPTmpPtr3
clc clc
rts rts
*/-------------------------------------- */--------------------------------------

View File

@ -217,6 +217,10 @@ TCP.IN.JMP.ESTBLSH
jsr SKT.StoreTCB success, update socket jsr SKT.StoreTCB success, update socket
jsr TCP.SetSocketTCPO.ACK Try to ACK read DATA
* jsr TCP.OUT.I SKT.GetTCB already called
.2 ldy #S.TCP.OPTIONS .2 ldy #S.TCP.OPTIONS
lda (ZPFrameInPtr),y lda (ZPFrameInPtr),y
and #S.TCP.OPTIONS.FIN and #S.TCP.OPTIONS.FIN
@ -330,10 +334,7 @@ TCP.IN.ACKTheSYN
rts rts
*-------------------------------------- *--------------------------------------
TCP.IN.ACKTheFIN TCP.IN.ACKTheFIN
ldy #S.SOCKET.TCP.O jsr TCP.SetSocketTCPO.ACK
lda (ZPPtrSKT),y
ora #S.TCP.OPTIONS.ACK
sta (ZPPtrSKT),y
ldx #3 ldx #3
@ -374,11 +375,11 @@ TCP.IN.SetDataInPtrAndLen
and #$F0 Get TCP Header len in DWORD and #$F0 Get TCP Header len in DWORD
lsr lsr
lsr lsr
sta TmpOffset sta ZPDataInPtr TMP Storage
lda ZPDataInLen lda ZPDataInLen
sec sec
sbc TmpOffset sbc ZPDataInPtr TMP Storage
sta ZPDataInLen sta ZPDataInLen
bcs .1 bcs .1
@ -395,7 +396,7 @@ TCP.IN.SetDataInPtrAndLen
pla pla
clc clc
adc TmpOffset adc ZPDataInPtr TMP Storage
bcc .2 bcc .2
inx inx
@ -436,10 +437,9 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
jsr SKT.GetDataFromSktOut jsr SKT.GetDataFromSktOut
ldy #S.SOCKET.TCP.O lda #S.TCP.OPTIONS.ACK+S.TCP.OPTIONS.PSH
lda (ZPPtrSKT),y
ora #S.TCP.OPTIONS.ACK+S.TCP.OPTIONS.PSH jsr TCP.SetSocketTCPO
sta (ZPPtrSKT),y
jsr TCP.OUT.Send jsr TCP.OUT.Send
@ -461,9 +461,7 @@ TCP.OUT.I lda SKT.Cache+S.SOCKET.TCP.OUTTOSEND+1
.80 jmp SKT.StoreTCB exits with CC .80 jmp SKT.StoreTCB exits with CC
*-------------------------------------- *--------------------------------------
TCP.OUT.SendOptA TCP.OUT.SendOptA
ldy #S.SOCKET.TCP.O jsr TCP.SetSocketTCPO
ora (ZPPtrSKT),y
sta (ZPPtrSKT),y
>LDYAI 0 >LDYAI 0
jsr TCP.NewFrame jsr TCP.NewFrame
@ -513,6 +511,14 @@ TCP.OUT.Send ldy #S.TCP.OPTIONS
* clc * clc
.9 rts .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.NewFrame ldx #S.IP.PROTOCOL.TCP TCP.NewFrame ldx #S.IP.PROTOCOL.TCP
jsr FRM.NewIP jsr FRM.NewIP
bcs .9 bcs .9

View File

@ -452,9 +452,9 @@ SKT.Index .BS 1
SKT.TABLE .BS K.SKTTABLE.SIZE SKT.TABLE .BS K.SKTTABLE.SIZE
SKT.LOC.ADDR .BS S.SOCKADDR SKT.LOC.ADDR .BS S.SOCKADDR
SKT.REM.ADDR .BS S.SOCKADDR SKT.REM.ADDR .BS S.SOCKADDR
SKT.Cache .BS S.SOCKET.TCP SKT.Cache .EQ *-S.SOCKET.TCP.INTAIL
.BS S.SOCKET.TCP-S.SOCKET.TCP.INTAIL
TmpDWord .BS 4 TmpDWord .BS 4
TmpOffset .BS 2
hFrameIn .BS 1 hFrameIn .BS 1
hFrameOut .BS 1 hFrameOut .BS 1
HST.SScanF .AZ "%d.%d.%d.%d" HST.SScanF .AZ "%d.%d.%d.%d"