Running

Running operating systems

This page gives some pointers on how to start with the operating system software that you can run on a PDP-11, which models will work with it and how to get it running. A lot of operating systems were made for the PDP-11, and most of those are still to be found – however, the copyright and licensing is not in all cases clear and simple; in other words, you may not be allowed to run everything you find. Probably the only OSes that are you are really free to use are the original Unix versions and 2.11BSD.

The historic operating systems are in most ways quite different of what we are used to today – for instance, most operating systems will not directly run on any system, but will need to be configured to run on a specific system model – or may be limited in functionality until such configuration (called ‘sysgen’) has been completed. The Unix versions are probably the easiest to start with if you do not have a PDP-11 history – but even there, there are considerable differences between today’s Linux and V7 or even 2.11BSD. Luckily, lots of documentation is still available – for everything DEC, Bitsavers is the place to start; for the Unix variants, find TUHS or PUPS.

Booting an image
Before trying to boot an image, you need to understand what type of bootable disk image you have, and which disk controllers are present in the VHDL you are using in your FPGA. Each disk controller needs it’s own sd card to read and write the disk images on – but, the RK and RL controllers can use multiple disk images on the same card. The disk formats are not interchangeable – you cannot use an RL controller to read an RK disk, etc. The RH is normally used for a single RP06 disk image; it can be configured to other models from that series, but this has not been tested very well; the RK supports RK05 images, and the RL deals with RL02 images.

The size of the image file is a good clue of what image type you’re looking at:

  • 2.5Mb is RK05
  • 10Mb is RL02 – 0r 20Mb if the image has been sdfmt’ed
  • 170Mb is RP06

although some variations of these sizes can occur, because the bad block track may not have been included in the image, or the OS you’re using may report the actual size on it’s disk – and include any deduplication it’s doing. If you’re not sure what an image is, make a copy and just try it – either with the PDP2011 or with simh.

Booting starts with a reset signal to the cpu (which is generated by power-up, ideally). After the cpu has initialised itself, it will start execution at the address (octal) 165020 – which corresponds to the location of the m9312l boot rom. There are two versions of the code for the boot roms (there are two, actually); see the source files named m9312lXX.mac and m9312hXX.mac in the vhdl source directory. The 46 version is the original M9312 boot code from DEC, with minor modifications so that it accepts lower case input. The 47 version is my own bootstrap code, which will list the addresses in the I/O space and then boot from the first available controller – in the order RK, RL, RH, and from the first disk associated with that controller. This is the easiest option for simple configurations (eg. with one controller and one disk); however, the 46 original M9312 is maybe a bit less friendly – don’t make typo’s – but it is far more flexible: it can deal with booting from all configured controllers in the system, and also from all disks.

Unix V5
Unix V5 works when the cpu model is configured as 11/45, and it needs an rk controller. No other disk controllers or fancy stuff should be on the bus – I noticed that it will crash if the DEUNA is configured. The disk image to boot from can be found from many sources; I use the one from the simh website.

When booting, Univ V5 will give a single ‘@’ character as prompt – which may be very confusing if you’re using the M9312 bootstrap, since that also uses ‘@’. At the unix prompt, you should type name of the executable to load – it is named ‘unix’. Then it will boot and give you a login prompt.

If anyone finds out how to recompile the kernel, please let me know.

Unix V6
Unix V6 works on 11/45, and needs 4 rk disk images – to be found from simh. You can create the sd card from the source disk images as follows:

dd if=unix0_v6_rk.dsk of=/dev/sdc
dd seek=6144 if=unix1_v6_rk.dsk of=/dev/sdc
dd seek=12288 if=unix2_v6_rk.dsk of=/dev/sdc
dd seek=18432 if=unix3_v6_rk.dsk of=/dev/sdc
obviously substituting /dev/sdc with whatever your card reader/writer might be (*take care*). Note the seek parameter; it puts each of the rk images into its place on the sd card image.

Unix V7
Unix V7 works on 11/45 or 11/70 – if you configured for 11/70, make sure that no more than 2Mbytes of memory is available, or Unix will crash; the 11/70 bitstreams I distribute have 4Mbytes, and thus will not work – either use the 11/45, or configure your own system (you’ll need to edit the top vhdl to change the memory size). There are several disk images you can start with; the easiest are probably the rl disk images from simh. See the howto remarks on rl disk images for formatting the sd card.

Upon boot, you should get a single ‘@’ as prompt – if not, it is a sign that the disk image is not usable or maybe something else is wrong. At the ‘@’ prompt, you should enter exactly ‘boot’ – no typo’s, no second chance; if you do something wrong, just reset the board and try again. If all goes well, you’ll get the text: ‘New Boot, known devices are hp ht rk rl rp tm vt’, and another prompt – this time ‘:’. This time, you must reply with ‘rl(0,0)rl2unix’. Again exactly that, and no typos. As follows:

Hello, world [t44]: cpu 11/45
boot from rl:
@boot
New Boot, known devices are hp ht rk rl rp tm vt
: rl(0,0)rl2unix
A more complete Unix V7 is possible if you start from the original v7 source distribution tape and build a rp06 image from it, using simh, because pdp2011 does not have anything resembling a tape drive. The tape image is easily found on the net, as are instructions to install it to a large disk – look for the original documentation on how to do this. After you’ve finished creating the rp06 image, you can copy it to an sd card directly, the same as with the rk disk images; just a one to one copy. But, before going this length, I recommend playing with the rl images first, just to get a feel of what you’ll get, and to remember that v7 is really a very basic version of Unix as we know it today.

2.11BSD
2.11BSD can run on the 11/70-rpxunofp bitstreams, but this requires you to have applied patches up to at least #445, and then rebuild the kernel with the FPSIM YES option – on another system, for which simh would be the easiest choice. Another option is to configure 11/70 with have_rp=1, have_xu=1 and leave the FP11 at default (included); then also older kernel versions will work, but this requires a large FPGA – the FP11 and the DEUNA take up some space. For normal use, having the simulator instead of the FP11 is no problem; there’s not that much floating point going on, unless you have your own applications that do heavy calculations (and why would you do that on a PDP). I permanently run a de0 board with the 11/70-rpxunofp bitstream; it controls the lighting in my living room.

The other Unibus cpu models supported by 2.11BSD will also work.

XXDP22/25
The XXDP packs have been very useful in verifying the functions of the CPU, FPU and MMU in the early stages of development, and I still often use these for regression testing after I’ve made changes – so much in fact that I’ve physically worn out a couple of sd cards. Almost all of the CPU, MMU and FPU tests pass flawlessly – the exceptions are mainly caused by differences in the autoincrement and autodecrement timing that shows when instructions are aborted. Of many of the tests, the listings are available, which was of great help to me in finding out why some tests did not pass – the code is in some cases so tricky that it can take ages to figure out what it does if the listing is not available – or if the crucial page is missing.

There is something very gratifying about being able to run 40-year old test code designed for the original systems against my VHDL, and see that it works exactly according to the test. But also, some of the tests are just nice – for instance, ZQMC causes a nice pattern on the address line blinkenlights.

The tests that I regularly use are:
for 11/34: FKAA, FKAB, FKAC, FKTH, FFPA, FFPB, FFPC
for 11/44: KKAA, KKAB, KKTA, KKTB, KKUA, KFPA, KFPB, KFPC
for 11/84 and 11/94: ZKDJ, ZKDK, ZKDL

RT-11
Most earlier RT-11 images are RK05, and will work fine on one of the 11/45 bitstreams. If you configure your own system, 11/20 and 11/34 are also good choices. One of the nicest setups to play around with in my opinion is a multi-terminal MUBAS setup – the image to start with can be found on bitsavers; other interesting things are Dungeon, and loads of BASIC games that can be found on the net – many in the form of RK05 images. RT-11 can handle weird setups – for instance, I once played with an 11/20 configured with an FP-11.

Later versions of RT-11 (v5.3 particularly) may not work from the RL distribution media – this is one of the few remaining bugs. However, if you copy the distribution to RK, it will work – at least, it did for me.

RSTS
Some V7 images that I found may not work with the 11/45 bitstreams; for instance, the simh images are RL01 ie. half the size of the RL02. The controller can report RL01 disk types, but this requires changing the RL11.vhd to set the bit that indicates the disk type – and if there’s a mismatch, I’m not sure if things will work correctly. If you have multiple RL01 images, make sure that they start at the RL02 locations – that is where the controller will expect to find them.

V10 images I found on the net will work on the 11/70 bitstreams, and Decnet will work with the DEUNA. However, I’ve only found older Decnet versions for RSTS.

RSX
Most images I found will probably work with the 11/45 bitstreams, depending on the distribution media. RSX used to be a nice testcase in the earlier development of PDP2011, for instance to see if the model detection code in the sysgen would detect the system type I had configured (mostly it did :). Recently, I’ve not tried to run RSX.

RSX11-MPlus
The images I’ve tried so far (mainly V4.6) work on the 11/70 bitstreams, and will run both Decnet and Johnny Billquist’s BQTCP – since the August 2014 fixes for the DEUNA, because BQTCP is the only software that appears to use the DEUNA buffer chaining. Several PDP2011 systems have been used to join HECNET.

Ultrix-11

The images from the simh website will work on the 11/45-rl bitstreams. The later versions can be sysgenned to run on 11/70 or later models, and will (in theory) support TCPIP with the DEUNA; however, as I understand, this was never quite finished and will also not work well on a real PDP.