Upgrading UNIX Sixth Edition
This makes sense, from a distribution logistics perspective; the -11/40 binaries will run on any PDP-11 available at the time which would support UNIX (i.e. PDP-11/45, etc), and once UNIX is up and running, it is fairly easy to produce binaries of the OS and user commands which take advantage of the extra capabilities of the /45, etc - principally Split I+D space.
The Setting up UNIX - Sixth Edition document is a little thin on details for how to do the upgraded OS, however; it just says:
In the run Shell file, the 11/45 code is commented out. ... Since the layout of addresses in the system is somewhat peculiar, and not directly supported by the link-editor 'ld', the 'sysfix' program has to be run before the loaded output file can be booted.
Not very detailed (although, to be honest, there's not a great deal of complexity). More detailed instructions are below; and if you want to know more about that "somewhat peculiar .. layout of addresses in the system", see the page Unix V6 kernel memory layout.
Building a /45 or /70 OS binary
To start with, do read through the 'Setting up UNIX - Sixth Edition' document to make sure everything else in it is fresh in your memory.
The aforementioned 'run' shell command file (in /usr/sys) contains the following commented-out commands which need to be run to build a /45 or /70 system (the same OS binary can be run on either type of machine, and will automatically adapt):
- as m45.s
- mv a.out m45.o
- cc sysfix.c
- mv a.out sysfix
- as data.s l.s
- ld -x -r -d a.out m45.o c.o ../lib1 ../lib2
- nm -ug
- sysfix a.out x
- mv x a.out
And that's all you need to do to build the OS binary for a /45; none of the other object files (in the two libraries) need to be touched.
(Note: you may need to edit the m45.s file to turn the 'floating point hardware present' flag off or on. If you intend to be turning it off and on a lot, it's probably best to move it into a separate file, and prepend that to m45.s in the assembly command, viz.:
- as fpon.s m45.s
- as fpoff.s m45.s
so you'll never have to actually edit anything.)
Here is a brief commentary on what each command does:
- as m45.s - assemble the machine-language support module; all the other modules of the OS are written in C
- mv a.out m45.o - the assembler's output file is named 'a.out' for historical reasons
- cc sysfix.c - you'll need this command in a moment
- mv a.out sysfix - the C compiler also uses 'a.out'
- as data.s l.s - the l.s file contains configuration-specific material; see the explanation below - and the 'data.s' (the order is important) is to force the information in this to go in the 'data' section (see the memory layout article)
- ld -x -r -d a.out m45.o c.o ../lib1 ../lib2 - the command to actually build the OS binary, using the system's ordinary linker/loader; the -r flag says to save the relocation information in the output file ('sysfix' will need this), the -x flag says to discard local symbols, and only retain globals, and the -d flag forces allocation of storage for common blocks
- nm -ug - list un-defined global symbols (AKA errors)
- sysfix a.out x - magic!
- mv x a.out - it's probably better to do something like 'mv x /45unix', or something like that; since the /45 version of the OS will then be in a different file (you'll type that name in the bootstrapping process), if you make a mistake, the /40 version is still there, and can be booted
The configuration of the system (in terms of what devices it supports, etc) are specified in two files, 'c.c' and 'l.s'. For novice users, these are generated by the 'mkconf' utility, but after a while you may prefer to just edit them directly. (If you want to do anything that's not supported by 'mkconf', you will have no other choice, other than modifying it.)
The former provides the table which converts device numbers to the appropriate subroutines for the OS to open, read, write etc on that device. It also contains a few parameters; e.g. what device the root of the file system is on, and which device is used for swapping, and where on it the swap partition is.
It might be a good idea to practice all the above on a UNIX V6 system running under an emulator.
Building a /45 or /70 user command binary
On a /45 or /70, UNIX V6 supports the use of split-I+D for user commands. The '-i' flag to the linker/loader ('ld') tells it to produce an output binary which runs in this mode. Very few commands will need this; only those that use large amounts of memory.
Also, see the commentary in the 'Setting up UNIX - Sixth Edition' regarding floating point emulation (for machines that don't have floating point hardware).
- UNIX V6 internals
- Unix V6 kernel memory layout
- Installing UNIX Sixth Edition
- Running UNIX V6 on an -11/23
- Installing Unix v6 (PDP-11) on SIMH
- Installing UNIX Sixth Edition on Ersatz-11
- run - the 'run' shell command file
|v • d • e UNIX Versions, Vendors and Related|
| Research Unix PDP-7 UNIX • UNIX First Edition • UNIX Second Edition • UNIX Third Edition|
UNIX Fourth Edition • UNIX Fifth Edition • UNIX Sixth Edition • Unix Seventh Edition
Unix Eighth Edition • Unix Ninth Edition • Unix Tenth Edition
LSX • MINI-UNIX • Unix/32V