The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-11 16:57 Noel Chiappa
  2018-12-11 17:01 ` Jon Forrest
  2018-12-11 18:03 ` Clem Cole
  0 siblings, 2 replies; 23+ messages in thread
From: Noel Chiappa @ 2018-12-11 16:57 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

PS:

    > IIRC, outbound packets are copied into kernel buffers

IDRC; according to the documentation, outbound packets are DMA'd directly from
user memory. I have yet to read the code to verify this.

    > we must have added PTY's of some sort

There is indeed a PTY driver; it has comments from BBN'ers who edited it, so
perhaps we got it from BBN.

    > I don't remember which one SMTP used.

The 'simple' TCP.

    > The whole thing worked _really_ well. Alas, I don't think anyone else
    > picked up on it.

So I found a long list of people we sent tapes to. Oh well....

    > The kernel code is not that large, it should even run on a /40, without
    > overlays (although the number of disk buffers would probably get hit).

Well, maybe... Here is the output of 'size' on the last Unix image for that
machine:

   40560+3098+44594

It was a /45, so split I/D (no overlays, though). How much could be trimmed
out of that, I'm not sure.

    Noel

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-15  1:54 Paul Ruizendaal
  0 siblings, 0 replies; 23+ messages in thread
From: Paul Ruizendaal @ 2018-12-15  1:54 UTC (permalink / raw)
  To: tuhs@minnie.tuhs.org list


> The journey is documented here:
> http://1587660.websites.xs4all.nl/cgi-bin/9995/timeline
> 
> The network code is in a different tree, I'll move it over to the above tree over the weekend.

Posted the network bit in the online repo; it's in the v6net directory.

Also fixed the instability - it is quite satisfying to login to v6 from a 'nc' client on modern hardware.

However, I also found that the BBN code from November 1981 is what is says on the can: beta.
I'll move to the October 1982 code when I find some time.

Paul

PS, this is the 'server' that nc connects to:

#define unchar unsigned char
#define netaddr unsigned long

#include "con.h"
#include <stdio.h>
#include <string.h>

unsigned long
ipaddr(w,x,y,z)
	int w,x,y,z;
{
	unsigned long ip;
	ip = w;
	ip = (ip<<8)|x;
	ip = (ip<<8)|y;
	ip = (ip<<8)|z;
	return ip;
}

struct con con;

void
child(fd)
	int fd;
{
        close(0);
        dup(fd);
        close(1);
        dup(fd);
        close(2);
        dup(fd);
        close(fd);
        execl("/bin/sh", "[net-sh]", 0);
}

main()
{
	int i, n, sd;
        
 	con.c_mode   = CONTCP;
        con.c_fcon   = ipaddr(192,168,1,114);
        con.c_lcon   = ipaddr(172,16,0,2);
        con.c_fport  = 0;
        con.c_lport  = 4000;

	sd = open("/net", &con);

	printf("Connected\n", sd);
	child(sd);

	close(sd);
}



^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-12 17:55 Paul Ruizendaal
  0 siblings, 0 replies; 23+ messages in thread
From: Paul Ruizendaal @ 2018-12-12 17:55 UTC (permalink / raw)
  To: tuhs@minnie.tuhs.org list


>     > the code size is about 25KB for both a minimal V6 kernel and the TCP
>     > stack, the rest is data.
> 
> That's impressively small; the MIT V6+ with 'demux only in the kernel' was
> 40KB for the combined code (although I can't easily get separate figures for
> the networking part and the rest).

I think my sentence was confusing: it is ~25KB each, so about 50KB combined.

The original V6 kernel was about 29KB (says here https://www.tuhs.org//cgi-bin/utree.pl?file=V6). I've simplified the TTY driver, only support one type of disk driver, dropped shared text segments, dropped FP emulation. Remains about 25KB. Note that the SLIP is merely via a "super RAW" mode on the TTY driver, so I don't need to include the bulky IMP interface driver. Even at 30KB, the V6 kernel must have offered the best bang/buck ratio in the history of software, imho.

>     > The Gurwitz code also has an Ethernet driver (note ARP was not invented
>     > yet)
> 
> How did it get Ethernet addresses?

:^) See here: https://www.tuhs.org//cgi-bin/utree.pl?file=BBN-Vax-TCP/bbnnet/netconf.c

"Someday this will be generated from the configuration file." I think later it did, but I don't have that code.

>     > a project to make V6 run ... on a TI990 clone
> 
> Oh, about the basic part of this: did you start with a plain V6 distribution?
> So you've had to do all the machine language stuff from scratch (and modify
> things in C like estabur())?
> What are you using for a C compiler ? Is there one out there, or did you have
> to do your own?


I has been a journey. I started with the 2.11BSD compiler and ported that to the TI990 architecture (more precisely the 9995 chip, which is similar to a T11 chip).
I debugged that to make XINU run, and then moved on to LSX (as recovered by the BK-UNIX project). Then I started with the V6 kernel from the TUHS website and made that work. Dave Pitts made it work on a real TI990 (he has a TI990/10 and a TI990/12 in working order). So, yes, I did bootstrap all the low level stuff from scratch.

After a three year hiatus I resumed work on this, integrating the Gurwitz TCP stack.

The journey is documented here:
http://1587660.websites.xs4all.nl/cgi-bin/9995/timeline

The network code is in a different tree, I'll move it over to the above tree over the weekend.

Paul




^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-12 14:38 Noel Chiappa
  0 siblings, 0 replies; 23+ messages in thread
From: Noel Chiappa @ 2018-12-12 14:38 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Paul Ruizendaal

    > a project to make V6 run ... on a TI990 clone

Oh, about the basic part of this: did you start with a plain V6 distribution?
So you've had to do all the machine language stuff from scratch (and modify
things in C like estabur())?

What are you using for a C compiler ? Is there one out there, or did you have
to do your own?

    > In my setup, network connectivity is via a SLIP interface.

Yeah, that's probably the way to go, to start with.

      Noel


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-12 14:14 Noel Chiappa
  0 siblings, 0 replies; 23+ messages in thread
From: Noel Chiappa @ 2018-12-12 14:14 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Paul Ruizendaal

    > project to make V6 run with the Gurwitz TCP stack on a TI990 clone
    > (which is pretty similar to a PDP11).

Neat!

    > the code size is about 25KB for both a minimal V6 kernel and the TCP
    > stack, the rest is data.

That's impressively small; the MIT V6+ with 'demux only in the kernel' was
40KB for the combined code (although I can't easily get separate figures for
the networking part and the rest).

    > The Gurwitz code also has an Ethernet driver (note ARP was not invented
    > yet)

How did it get Ethernet addresses?

    Noel

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [TUHS]  2.9bsd with networking on 18-bit possible?
@ 2018-12-12 10:29 Paul Ruizendaal
  0 siblings, 0 replies; 23+ messages in thread
From: Paul Ruizendaal @ 2018-12-12 10:29 UTC (permalink / raw)
  To: TUHS main list


> I'm sure it's been attempted before, but would anyone be up to the
> challenge of trying to get that going with networking on an
> 18-bit-address-space pdp11?

By coincidence I’m in the middle of a project to make V6 run with the Gurwitz TCP stack on a TI990 clone (which is pretty similar to a PDP11). It runs without separate I/D as two processes in about 100KB.

The Gurwitz TCP stack was the reference implementation for the VAX that BBN did in 1981. It is in the THUS archive:
https://minnie.tuhs.org//cgi-bin/utree.pl?file=BBN-Vax-TCP

As documented in IEN168, the actual TCP processing happens in a separate kernel process, much like process 0 (swapper) in Unix itself. It turns out that the network process shares no data (other than the u struct) with the kernel proper and can be run in a separate address space. Just a few ’thunks’ are needed: open/read/write/close from the kernel to the TCP stack and sleep/wakeup in the other direction.

A V6 Unix kernel runs in 48KB with buffers, the TCP stack with buffers needs about the same; both must remain resident - i.e. it ties up about 100KB of the 256KB core on a 18-bit machine. I suppose when using separate I/D it can run without thunks: the code size is about 25KB for both a minimal V6 kernel and the TCP stack, the rest is data.

In my setup, network connectivity is via a SLIP interface. The Gurwitz code also has an Ethernet driver (note ARP was not invented yet), but I’m not using that. I’m happy to report that this 1981 tcp/ip code can still talk to current OSX and Linux machines. 

Just yesterday I got the setup working and I can run minimalist telnet connections etc. Alas it is not quite stable yet, it tends to crash after 5-10 minutes of use.

The BBN reference implementation includes FTP and Telnet servers and clients which I think will still interoperate with current versions. As a final remark note that this BBN code uses an API that is almost unchanged from the API as used on NCP Unix. As compared to sockets this means that a listening connection is not a rendez-vous, but blocks until a connection is made (and then becomes an active connection, i.e. stops listening), and that there is no “select” type functionality.



^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-11 18:43 Noel Chiappa
  2018-12-11 18:51 ` Clem Cole
  0 siblings, 1 reply; 23+ messages in thread
From: Noel Chiappa @ 2018-12-11 18:43 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Clem Cole

    > I could be mis remembering

No... :-)

    > IIRC the original PTY driver goes back to the Rand and/or UofI for the
    > NCP.

Yup. I found a pty.c in the NCP system, it's clearly the ancestor (comments
match):

  https://minnie.tuhs.org//cgi-bin/utree.pl?file=SRI-NOSC/dmr/pty.c

    > I suspect BBN got it from the Bruce Borden's Rand distribution tape

Or possibly indirectly; my copy of the NCP came from NOSC via SRI. In addition
to the one above, there are also these:

  https://minnie.tuhs.org//cgi-bin/utree.pl?file=SRI-NOSC/dmr/misc/pty.c.ill
  https://minnie.tuhs.org//cgi-bin/utree.pl?file=SRI-NOSC/dmr/misc/pty.c.x

Here:

  https://minnie.tuhs.org//cgi-bin/utree.pl?file=BBN-V6/dmr/pty.c

is the BBN version, you can compare the them all. The MIT one is derived from
the BBN one.


    > Named Piped were definiately a Rand-ism (they were originally called 'Rand Pipes')

Well, _RAND_ called them 'ports':

  https://minnie.tuhs.org//cgi-bin/utree.pl?file=BBN-V6/doc/ipc/ports


    > But there were issues and somethings were not 100% until the UofI NCP;
    > which was the first really complete NCP for UNIX.

Somewhere I found a document about the UofI code, I think they wrote it from
scratch? Sorry, too lazy to look at it. See here:

  https://minnie.tuhs.org//cgi-bin/utree.pl?file=SRI-NOSC  

for links.

    Noel

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-11 16:16 Noel Chiappa
  2018-12-11 16:26 ` Clem Cole
  0 siblings, 1 reply; 23+ messages in thread
From: Noel Chiappa @ 2018-12-11 16:16 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Clem Cole <clemc@ccc.com>

    > This is why I suggested that if you really want telnet and ftp to the
    > PDP-11, you might be better off moving the networking stack out of the
    > kernel

Really, the answer is that I need to get off my @ss and put the MIT V6+ system
up (I have all the files, just need to get a round tuit).


It has TCP/IP, but is it not all crammed into the kernel. And unlike the early
BBN V6, it doesn't do TCP as a single process to which all the other
client/server processes talk via IPC.

Instead, the only thing in the kernel is inbound demuxing, and minimal outbound
processing. (IIRC, outbound packets are copied into kernel buffers; an earlier
version of the networking interface driver actually did do inbound and outbound
DMA directly from buffers in the user's process, but only one process could use
the network interface at a time.)

The TCP code was a library that was built into the user process which did the
server/client applications. (The servers which supported login, like FTP,
needed to run as root, like the ordinary login, setuid'ing to the entered
user-id.) I don't remember if we supported server Telnet, but I think we
did. So we must have added PTY's of some sort, I'll have to check.

Since the TCP was in the user process, we actually had a couple of different
ones, depending on the application. Dave Clark had done a quick-n-dirty TCP on
the Alto (in BCPL) which was only good for things like user Telnet, not for
applications that sent a lot of data. We ported that one for the first TCP; we
later did a 'high-speed bulk data' TCP, used for FTP, etc. I don't remember
which one SMTP used.

The whole thing worked _really_ well. Alas, I don't think anyone else picked
up on it.


The kernel code is not that large, it should even run on a /40, without
overlays (although the number of disk buffers would probably get hit).  And
since the TCP is in user processes, it could all get swapped out, so it would
run OK on machines without that much physical memory.

The issue is going to be that it will need a new network interface driver,
since I think the only driver ever done for it was for Pronet. And now we get
back to the 'what interfaces are available' question. Doing a DEC driver would
allow use of DEQNA's and DELQA's on QBUS machines, which would be optimal,
since they are common. And people could bring up Unix with TCP/IP on -11/23's.

But we'd have to add ARP (which I would do as a process, with only the
IP->Ether address mapping table stored in the kernel). I wrote a really nice
ARP for the C Gateway that could easily be used for that.

      Noel

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-11  4:42 Noel Chiappa
  0 siblings, 0 replies; 23+ messages in thread
From: Noel Chiappa @ 2018-12-11  4:42 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Warner Losh

    > I kinda doubt it has good NCP support: it was released in November of
    > 1983.

Wow, that far back? I'd assumed it was later (considerably later).

Looking at the 2.9 networking stuff:

  https://minnie.tuhs.org//cgi-bin/utree.pl?file=2.9BSD/usr/net/sys/net

it does indeed have _no_ NCP support.


    > I'd get it running in simh, then move to real hardware.

Absolutely; running in an emulator is, I have found, a key step on getting an old
OS running. I've found Ersatz-11 to be really good for PDP-11 emulation.


    > It's going to take a lot of elbow grease to make that work, I think.

Indeed; part of the problem, if the goal is going to be 'run it on real
hardware' is 'what network interface to use'.

All the ARPANET interfaces are out. There are drivers there for Proteon,
Ungermann-Bass, Xerox 3MB Ethernet, etc interfaces, but i) where you gonna
find one, and ii) you'll need a router to connect up to most other things.

There's a driver for the Interlan Ethernet interface, but AFAIK, those are
non-existent. (If anyone has one they're willing to part with, please let me
know!)

DEC Ethernet interfaces are available, but i) only the QBUS ones are common,
DEUNAs and DELUAs are almost impossible to find, that I've even seen, and ii)
it would need a driver.


    > Ultrix-11 is of similar vintage, and similar functionality and does boot
    > on the 18-bit 11's.

Yes, definitely worth looking at; I know it had TCP/IP (we had it on our
-11/73 at Proteon), but I don't know which interfaces it supported; probably
just the DEC ones (which, given the above, is not necessarily a Bad Thing).

     Noel

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-11  2:11 Noel Chiappa
  2018-12-11  2:36 ` Grant Taylor via TUHS
  0 siblings, 1 reply; 23+ messages in thread
From: Noel Chiappa @ 2018-12-11  2:11 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Grant Taylor

    > What protocols did 2.9BSD support?  Did it have NCP?

NCP was turned off on 1 January, 1983. What do you think?a

    > Would it be any easier to use an external NCP to TCP/IP gateway?

Such as?

     Noel

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [TUHS] 2.9bsd with networking on 18-bit possible?
@ 2018-12-10 22:05 Jacob Ritorto
  2018-12-11  1:21 ` Clem cole
  0 siblings, 1 reply; 23+ messages in thread
From: Jacob Ritorto @ 2018-12-10 22:05 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

Hi,
  I have an 11/45 I'm hoping will be running soon.

I'd like to run 2.9BSD on it because it's the most highly functional system
I know of that has "official hopes" to fit on such a restrictive machine.

 I've heard that it's really unlikely / tough to get a kernel built that'll
run tcp (I care mostly about ftp and telnet) on such a
small-memory-footprint machine.  Is this true?

Would anyone be willing to do a quick mentoring / working session with me
to get me up to speed with the constraints I'm facing here and possibly
give me a jump on making adjustments to build such a kernel if possible?

thx
jake

P.S. There's kind of an implied challenge in the 2.11bsd setup docs,
mentioning that "2.11BSD would probably only require a moderate amount of
squeezing to fit on machines with less memory, but it would also be very
unhappy about the prospect."

I'm sure it's been attempted before, but would anyone be up to the
challenge of trying to get that going with networking on an
18-bit-address-space pdp11?

[-- Attachment #2: Type: text/html, Size: 1311 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-12-15  1:55 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 16:57 [TUHS] 2.9bsd with networking on 18-bit possible? Noel Chiappa
2018-12-11 17:01 ` Jon Forrest
2018-12-11 18:03 ` Clem Cole
  -- strict thread matches above, loose matches on Subject: below --
2018-12-15  1:54 Paul Ruizendaal
2018-12-12 17:55 Paul Ruizendaal
2018-12-12 14:38 Noel Chiappa
2018-12-12 14:14 Noel Chiappa
2018-12-12 10:29 Paul Ruizendaal
2018-12-11 18:43 Noel Chiappa
2018-12-11 18:51 ` Clem Cole
2018-12-12  1:20   ` Jacob Ritorto
2018-12-11 16:16 Noel Chiappa
2018-12-11 16:26 ` Clem Cole
2018-12-11  4:42 Noel Chiappa
2018-12-11  2:11 Noel Chiappa
2018-12-11  2:36 ` Grant Taylor via TUHS
2018-12-11  3:28   ` Warner Losh
2018-12-10 22:05 Jacob Ritorto
2018-12-11  1:21 ` Clem cole
2018-12-11  1:55   ` Grant Taylor via TUHS
2018-12-11  7:22     ` Lars Brinkhoff
2018-12-11 15:28       ` Clem Cole
2018-12-11 17:21         ` Lars Brinkhoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).