IOCCC 2018 Best of show, aka PDP-7 emulation in under 4kb!

The most incredible thing about this PDP-7 emulator is that it not only can run Unix v0 as recovered by TUHS, but for kicks there is also a PDP-11 emulator coded in PDP-7 assembly that is capable of running both Unix v6 & 2.9BSD!

So if I have a PDP-7 emulator, how do I run operating systems that expect a PDP-11? Simple… I emulate a PDP-11/40 on the PDP-7. I have written PDP-7 assembler code to emulate a PDP-11/40 with the following equipment:

PDP-11/40 (KD11-A)
EIS instruction set (KE11-E)
Memory management unit (KJ11-A)
Line time clock (KT11-D)
124 Kwords of memory (244 Kbytes)
RK05 fixed disk drive (RK11)
Console TTY (DL11)

And as you can see, here is the PDP-7 running 2.9BSD via the emulated PDP-11!

You read that right.  And yes, here it is running 2.9BSD.  This is nothing short of amazing!

Read about Christopher Mills’s entry here:

http://ioccc.org/2018/mills/hint.html

And yes, the source has been stylized like a paper tape…

It really works best on a ‘real’ Unix like system.  I’ve run it on Debian 9 & OS X 10.13.14 … It does consume 100% of a CPU core.  But it’ll run a PDP-7 with v0 Unix, PDP-11 with Unix v6, and the aforementioned 2.9BSD. The Linux subsystem for Windows 10 didn’t handle the terminal control so well.

So, yeah kill your CPU and bask in the 4k glory!

4 thoughts on “IOCCC 2018 Best of show, aka PDP-7 emulation in under 4kb!

  1. “PDP-11/40 (KD11-A)
    EIS instruction set (KE11-E)
    Memory management unit (KJ11-A)
    Line time clock (KT11-D)
    124 Kwords of memory (244 Kbytes)
    RK05 fixed disk drive (RK11)
    Console TTY (DL11)”

    Some corrections are in order. The Memory management unit is actually the KT11-D, the KJ11-A is the Stack-Limit register option. The Line time clock is actually a KW11-L. The RK11 is the controller for an RK05 disk drive which came in two flavors, the RK05F fixed disk, and the RK05J removable cartridge disk drive.

Leave a Reply