[TUHS] A Census of /etc and /sys Prior to V4

Noel Chiappa jnc at mercury.lcs.mit.edu
Sat May 20 00:36:18 AEST 2023


    > From: Matt G.

    > Given the movement of UNIX to the 11/45 and then to C, does the Third
    > Edition represent a version of UNIX for the 11/45 with protection but
    > written in assembly, not C?

I think so (evidence detailed below). The support may not have been _quite_
identical to that in V4 (e.g. there was no support for pure texts in V3 -
below), though.

    > is there any other information such as documents, code, etc. concerning
    > the 11/45 assembly version?

This is the real problem, of course; all we have for V3 is some man pages.
(And in relying on them, we have to hope that they were updated to match the
then-current system - which is not guaranteed, but in general at this point
in time, man pages do seem to match whats's in the code.)

    > Was work completed on the 11/45 kernel changes in the context of this
    > version and then simply "ported" to the C version or were there
    > concepts that were cropping up in one or the other and varying amounts
    > of transportation back and forth as 11/45 and C aspects were
    > implemented?

Without a lot more information, which is now almost certainly lost, we are
unlikely to be able to tell. But let me start by laying out what we _do_ know.


To start with, it's important to realize that support for protection (and
relocation - i.e. memory that looks, to user code, like it's at 0,
is actually at, say, 060000 in physical terms) in PDP-11 UNIX _pre-dates_ the
-11/45. DEC had a rare, and now almost forgotten "Memory Protect & Relocate"
option for the -11/20, the KS11:

  https://gunkies.org/wiki/KS11_Memory_Protection_and_Relocation_option

What exactly it did, and how, is now uncertain (no documentation, or code
that used it, appeats to have survived - all we have are a couple of vague
recollections), but it is certain that that the UNIX group's -11/20 had it:

   https://www.bell-labs.com/usr/dmr/www/odd.html

and Ken has said that he wrote the code to use it.

It's also important to remember that not all the machines running UNIX would
have had their hardware updated simultaneously: e.g. the patent group's
-11/20 would not have needed the KS11 as much, since it was runnng mature
applications. So UNIX was probably conditionalized to run with and without
the KS11. As late as V3, there were apparently still UNIX machines without
relocation hardware: "The purpose of this command is to simplify the
preparation of object programs for systems which have no relocation
hardware.":

  http://squoze.net/UNIX/v3man/man1/reloc

When the support for the KS11 appeared is uncertain. It's not in the extant
V1 code; but V2 seems to have had it: "the current system, which has
relocation and protection hardware":

  http://squoze.net/UNIX/v2man/man5/core

V2 also seems to have started looking forward to the -11/45 - "a trap is
simulated by the floating point simulator" (ditto); "if they correspond to
11/45 floating point instructions":

  http://squoze.net/UNIX/v2man/man3/fptrap

It is possible that they already had the -11/45 at this point, but I would
tend to doubt it: "immediate mode ((pc)+) is not supported, since the
PDP-11/45 handbook is not clear on what to do about it." (If they had it, a
simple experiment would have produced the answer.) And "Double precision
results are probably less correct than the hardware will be" (note tense).
(All from v2man/man3/fptrap.)


V3 seems to have the -11/45: "it depends on what hardware is present (EAE,
floating-point option)":

  http://squoze.net/UNIX/v3man/man5/core

The "floating-point option" would only have been on the -11/45. (And again we
see that V3 still ran on -11/20's; the -11/45 would not have had an EAE:

  https://gunkies.org/wiki/KE11-A_Extended_Arithmetic_Element

since all the EAE operations - except normalization, but that's only needed
for floating-point - were in the basic -11/45.)

Probably the protection and relocation provided to UNIX processes on the
11/45 was very similar to that provided with the KS11. Do note that thememory
management was not exactly the same as V4's: "In the future the text segment
will be write-protected and shared.":

  http://squoze.net/UNIX/v3man/man5/a.out

However, it was keeping multiple processes in main memory at the same time:
"only processes whose core images are on disk have visible names":

  http://squoze.net/UNIX/v3man/man8/ps


So we can actually tell a fair amount about the evolution through V2 and V3
from the few scraps that are left to us. I do live in hope that a V2 or V3
listing will turn up one day; the system changed a lot in that period, and
many questions aren't answered definitively by the man pages.

(One big one is details of how the process' address space was laid out -
ld(III) and exec(II) simply say nothing at all. I assume it started at 0 -
but who knows? In V1, it must have started at a higher address - as on
MINI-UNIX:

 https://gunkies.org/wiki/MINI-UNIX#Implementation_details

which I am fairly familiar with - but again, neither V1's ld(III) or exec(II)
mentions this detail. I suppose I could work it out from the V1 source, but
I'm not _that_ interested... :-))

It is possible that the evolution started with just protection (if the KS11
could do that), and relocation was added later. It seems clear that the
step from the KS11 to the -11/45 was probably not large.


If anyone has a V2 or V3 listing, please sing up! That would be an
_incredibly_ valuable thing to add to the historical record.

	Noel


More information about the TUHS mailing list