From 4b6b4730013ac9eec95e8a28b3ec54db9f1c4a3e Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Fri, 10 Aug 2018 17:16:44 +0100 Subject: [PATCH] WIP: Telnet works! --- src/system/ether.1 | 18 ++++++++---------- src/system/tcp.275 | 2 ++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/system/ether.1 b/src/system/ether.1 index eb983f40..780e2238 100644 --- a/src/system/ether.1 +++ b/src/system/ether.1 @@ -212,7 +212,7 @@ ETHRXI: PUSH P,Q ;IP can clobber all of these... PUSH P,H MOVE A,I ;Compute number of words - AOS A + ADDI A,3 LSH A,-2 MOVE C,A ;BUG INFO,[IP ipgipt A=],OCT,A @@ -250,13 +250,6 @@ ETHTXI: PUSH P,I PUSH P,R - ; We'll either send this packet, or send an ARP request. - ; Either way we'll need our MAC address in the Ethernet header. - LDB I,[%NEAT"HA01+ETHME] - LDB R,[%NEAT"HA2+ETHME] - DPB I,[%NEH"SMAC01+ETHHBF] - DPB R,[%NEH"SMAC2+ETHHBF] - ; Search the ARP table for the destination address. MOVE C,PK.DST(A) BUG INFO,[ethtxi A=],OCT,A,[ dest=],OCT,C @@ -290,6 +283,9 @@ ETHTX2: ;Not found in ARP table ;requests rather than building it each time... DPB C,[%NEAH"THA0+ETHABF] DPB C,[%NEAH"THA12+ETHABF] + + LDB I,[%NEAT"HA01+ETHME] + LDB R,[%NEAT"HA2+ETHME] DPB I,[%NEAH"SHA01+ETHABF] DPB R,[%NEAH"SHA2+ETHABF] @@ -334,7 +330,9 @@ ETHTX5: PUSHJ P,ETHTX ;Send it! POP P,C POPJ P, -;Send an Ethernet packet (if possible). +;Send an Ethernet packet. +;The source MAC address in the Ethernet header will be filled in +;automatically (by the adapter). ;Unpacked header is in ETHHBF. R contains pointer to unpacked data. ;I contains data length in bytes. ;Clobbers A, B, C, TT, I. @@ -361,7 +359,7 @@ ETHTX: BUG INFO,[ethtx ptr ],OCT,R,[ len ],OCT,I BLTBU TT,(A) ADDI I,%NEH"LENGTH-%NEH"PAD ;Add length of header - ;BUG INFO,[ethtx end desc ],OCT,D,[ len ],OCT,I + BUG INFO,[ethtx end desc ],OCT,D,[ len ],OCT,I JRST UNATX ;Transmit it ;Check whether the interface is able to send a packet. diff --git a/src/system/tcp.275 b/src/system/tcp.275 index 1cb2afbd..2d0f83b5 100755 --- a/src/system/tcp.275 +++ b/src/system/tcp.275 @@ -2059,6 +2059,7 @@ SUBTTL TCP Input Interrupt Level %TSIFL==4 ; Bad seq, flush after handling RST/ACK/URG TCPIS: METER("TCP: Segs rcvd") + BUG INFO,[tcpis] SKIPN TCPUP ; Unless TCP claims to be up, JRST TSIFL ; Throw it away, no TCP yet, sigh. @@ -2066,6 +2067,7 @@ TCPIS: METER("TCP: Segs rcvd") ; checksumming it (sigh!). TT gets total # bytes in TCP segment. CALL THCKSI ; Get checksum in A for segment LDB B,[TH$CKS (H)] ; Get segment's checksum + BUG INFO,[tcpis csum=],OCT,B,[ exp=],OCT,A CAME A,B ; Should match. JRST TSIF01 ; Failed, go bump err count and flush it. LDB T,[TH$THL (H)] ; Find TCP header length in words