PDP-11 Xenix (LONG)
Steven M. Schultz
sms at moe.2bsd.com
Sat Oct 11 02:55:45 AEST 1997
Howdy -
> From: "Frank Wortner" <fwortner at prodigy.net>
> Since I'm the one that started this --- albeit indirectly --- let me try to
And I hate to see a fellow talk to himself without interruption ;-)
> PD.-11 Xenix was essentially V7, but it had a few added features.
> Processor support included all models of PDP-11 with MMUs: 23s, 34s, 40s,
I remember (not terribly fondly) running V7 on an 11/23. We hacked
in an overlay scheme to the kernel (but not user programs). Just
enough resources to run 1 user and a couple processes - do an "ls" and
the shell got swapped out, when 'ls' finished the shell would get
swapped back in. Wheee! ;)
> 45s, 55s, 60s, and 70s. It had split I&D space emulation --- borrowed, I
> believe from 2.something BSD. That emulation required a grand total of
Not having used Xenix I'd never heard the term "split I&D space
emulation". What we hacked in to V7 and BSD later implemented
was an even older concept: overlays.
2.9 was the first version I know of that had 'overlay' support. The
overlays were memory resident and switching between them was done
by flipping MMU registers.
It is (present tense since 2.11BSD uses the same method today) done
with a single link phase (no "-j" option or multiple link edits). In
2.9 there was a limit of 7 overlay segments plus the base segment. Later
on (the 1985 update to 2.9) the limit was increased to 15 overlays
which has proven to be adequate since then. For the kernel the overlays
could only be 8kb (1 page register) but user mode programs could have
larger (but still multiple of 8kb) overlays.
In 2.9 there was a separate libc.a that you did need to link with
because the callframe had an extra word (the overlay number) and
'csv, cret' had a couple extra instructions to switch overlays. Later
(2.10 and up) the callframe was changed to always have the extra word
This made life easier (at the expense of an extra 3microseconds per
function call) by not having to maintain/build two versions of all
the libraries.
> three(!) link passes, but the compiler driver was modified to do this
> automatically if you specified the "-j" option. Instead of source, the
> kernel was delivered mostly as .o files and .a libraries, so you could
A multiphase link IS currently used to build the 2.11 networking though.
The networking code (4.3BSD's TCP/IP stack) runs in supervisor mode.
The kernel, at boot time, loads /netnix into supervisor space. The
/netnix image is built in a similar manner to what was mentioned for
Xenix's emulated I&D space - first build the unix image (with undefined
references to the networking code), then build the netnix image
(with undefined references to the kernel code), then cross reference
the two images for undefineds and create .s stub files to satisfy
the undefineds. Assemble the two .s files and then link unix with
d.netnix.o and netnix with d.unix.o and voila a kernel and an image
it can load into supervisor space.
> reboot or halt it. Although the OS was pretty big --- I find it amazing
> that I thought of it as "big" ;-) --- you could, with some effort build a
Even V7 had trouble fitting on a non split I/D machine. The problem
is that the kernel has to map the I/O page which removes an extra
MMU page from being used for data. Then the 'u' area needs a page
(for the kernel stack and per process context). And you need a page
to perform copyin/copyout with (and to map the buffer cache if that
has been moved external to the kernel) - that leaves only 40kb for
everything else (and on a nonsplit I/D machine with overlays you'd
need two or three pages for the base segment and an overlay, that leaves
just 2 pages or 16kb for all the data).
> Full source V7 (or even better 2BSD) is probably a more "interesting" system
> from a hobbyist or preservationist point of view, particularly if you're
> like me and don't have or care to own actual PDP-11 hardware. I'm quite
An 11/73 takes up less space than some PC tower cases and uses about
the same amount of electricity.
> happy to run John Wilson's and Bob Supnick's wonderful emulator programs
> with whatever software I can obtain. They let me have the PDP-11 models I
I can't speak for John's emulator (only runs on top of DOS and my
place is a MS-free zone ;)) but I have booted up 2.11BSD under Bob's.
Only went to the single user state and ran a couple simple commands.
Seems to work ok that far, but 'vi' doesn't run right - I suspect it's
something to do with overlaid programs flipping MMU registers about
but haven't had the time to look into it further (besides which I've
a 11/73 and a 11/93 to use).
> worked on (23, 34, 45) as well as those I'd like to have had (70) without
> the hassle and expense of maintaining the actual hardware.
A Q-bus system such as an 11/83 combines the best of both worlds - it's
got the address space and the speed (cpuwise) of a 70 but the
convenience of no UNIBUS map (like the 45). Maintenance thus far
over the last 6 years has consisted of replacing an M8192 when the
cache developed a parity error.
Well, I suppose I should get back to work before the boss wanders by
and sees me having fun instead of getting his work done ;-)
Steven Schultz
More information about the TUHS
mailing list