From 4af56464aa430d14f27bc416c40df881c86bd458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Victor?= Date: Sat, 13 Feb 2021 13:42:33 +0100 Subject: [PATCH 1/3] Fix 17-year-old spelling error hopefully fixing horrible concurrency problems which appears on faster hardware(?). --- src/dvch11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dvch11.c b/src/dvch11.c index 2dad635..3b683e2 100644 --- a/src/dvch11.c +++ b/src/dvch11.c @@ -622,7 +622,7 @@ ch11_cmd_status(struct ch11 *ch, FILE *of) fprintf(of,"Input possible: %d, Output possible: %d\n", ch->ch_inactf, ch->ch_outactf); fprintf(of, "DP status: %d\n", ch->ch_dpstate); fprintf(of, "DP Rtest: %d, Stest: %d\n", - (int)dp_xrtest(dp_dpxfr(&ch->ch_dp)), (int)dp_xstest(dp_dpxfr(&ch->ch_dp))); + (int)dp_xrtest(dp_dpxfr(&ch->ch_dp)), (int)dp_xstest(dp_dpxto(&ch->ch_dp))); fprintf(of, "DP rcmd: %d, rcnt: %d\n", (int)dp_xrcmd(dp_dpxfr(&ch->ch_dp)), (int)dp_xrcnt(dp_dpxfr(&ch->ch_dp))); fprintf(of,"Input buffer: "); @@ -961,7 +961,7 @@ ch11_write(struct device *d, uint18 addr, register dvureg_t val) /* AIM628: when both xDN and xEN are set, the computer is interrupted */ if ((val & CH_TEN) && (val & CH_REN)) { /* try to be clever */ - if (dp_xstest(dp_dpxfr(&ch->ch_dp))) { + if (dp_xstest(dp_dpxto(&ch->ch_dp))) { ch_ogo(ch); /* sender's turn, process output first */ ch_igo(ch); } else { From efb657a55bb573b5b00b48f408b815b4b413612e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Victor?= Date: Mon, 22 Feb 2021 07:34:37 +0100 Subject: [PATCH 2/3] Don't read another until this one is read Instead of accepting new input pkts after checking that the input pkt is shaped OK, do it after actually reading the pkt to ITS. Otherwise read pkts can be overwritten while only partially read to ITS, leading to corruption of data. --- src/dvch11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dvch11.c b/src/dvch11.c index 3b683e2..bcbfb3d 100644 --- a/src/dvch11.c +++ b/src/dvch11.c @@ -838,6 +838,8 @@ ch11_read(struct device *d, register uint18 addr) fprintf(DVDBF(ch), "[CH11 reading last word, clearing RDN]\r\n"); ch->ch_rcnt = -1; /* read last word */ REG(ch) &= ~CH_RDN; /* Done receiving? */ + ch->ch_inactf = TRUE; /* OK to read another */ + dp_xrdone(dp_dpxfr(&ch->ch_dp)); /* Done, can now ACK */ } break; } @@ -1548,8 +1550,6 @@ chaos_inxfer(register struct ch11 *ch) } REG(ch) |= CH_RDN; /* Note it's done! */ } - ch->ch_inactf = TRUE; /* OK to read another */ - dp_xrdone(dpx); /* Done, can now ACK */ } #endif /* KLH10_DEV_CH11 */ From 0a9e34c36f4091de2e497aacb72bc7fa9c312133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Victor?= Date: Tue, 23 Feb 2021 08:31:29 +0100 Subject: [PATCH 3/3] Update dvch11.txt --- src/dvch11.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/dvch11.txt b/src/dvch11.txt index 753613c..fbad7c4 100644 --- a/src/dvch11.txt +++ b/src/dvch11.txt @@ -7,10 +7,11 @@ The ch11 device in KLH10 for ITS, which was originally just a dummy inteface to keep ITS running, is now a functional Unibus Chaosnet device, which supports Chaosnet-on-Ethernet and Chaosnet-over-UDP. -It does not support SPY (promiscuous) mode, LUP (loopback), or -broadcast, but ITS doesn't seem to use/need these. +It does not support SPY (promiscuous) mode, or LUP (loopback), but ITS +doesn't seem to use/need these. It only supports broadcast on +Ethernet, not on UDP. -Latest update: 2018-04-15 +Latest update: 2021-02-23 Like other KLH10 network devices, ch11 works together with a Device Process which communicates with the device and reads/writes network @@ -59,7 +60,7 @@ For "chudp": used, the first IPv4 address returned is used. (Rather than listing all your friends' ITS hosts directly, I suggest joining the Global Chaosnet and just list its central router. See - https://aosnet.ch.) + https://chaosnet.net.) If chudpport or chip parameters are given, the ifmeth defaults to chudp. @@ -88,11 +89,11 @@ to IFN CHAOSP,DEFOPT NM%CHA== ; Set default netmask for it but the real fix would be to the IPMASK macro. -Ideas for future work: -- Implement Chaos-over-DTLS to get some security, on this modern Internet. +---------------- -More info: -- see https://chaosnet.net +See https://chaosnet.net for much much more information, and +https://github.com/bictorv/chaosnet-bridge for a bridging/routing +program for Chaosnet. Cheers,