the kek PDP-11/70 Emulator
The PDP-11/70 is a 16-bit minicomputer built by DEC (Digital Equipment Corporation) in the 1970s. It is the hardware on which UNIX was first developed and the e
Fifty-Year-Old UNIX Joins a Modern LAN Through the W5500 — the kek PDP-11/70 Emulator
What Is a PDP-11/70, and Why Run It Today?
The PDP-11/70 is a 16-bit minicomputer built by DEC (Digital Equipment Corporation) in the 1970s. It is the stage on which UNIX matured after being rewritten in C — and the environment where the C language itself was born. Every Unix-like OS in use today traces its lineage back to this machine. A single unit once cost tens of thousands of dollars and weighed hundreds of kilograms. Half a century later, it lives again on a palm-sized board carrying an ESP32 and a W5500.
The emulator kek is not just a retro-computing curiosity. What sets it apart from other emulators is that the emulated PDP-11 connects to a real Ethernet network. The DEQNA — the Ethernet adapter fitted to PDP-11s in the 1970s and 80s — is reproduced in software, and the raw Ethernet frames it emits are carried straight onto the physical wire by the W5500.
The result: you can Telnet from a modern PC directly into UNIX v7 or BSD 2.11 booted on the emulator. A fifty-year-old operating system, joining today's LAN through a W5500.
WIZnet Product Used — Raw MAC Frame Access
| Product | Library | Access Mode | Role |
|---|---|---|---|
| W5500 | folkertvanheusden/W5500MacRaw (Git submodule) | Raw Ethernet frame TX/RX | Physical layer for the emulated DEQNA Ethernet card |
W5500MacRaw is a library the author, Folkert van Heusden, forked directly from WIZnet's ioLibrary Driver. Instead of a conventional TCP/UDP socket API, it accesses the W5500 at the raw Ethernet frame level. The fork also adds runtime-configurable SPI pins to support the Waveshare ESP32-S3-ETH board.
Because the W5500 handles the Ethernet MAC/PHY layer entirely in hardware, the ESP32 CPU stays focused on its real job: emulating PDP-11 instructions.
Why the W5500 — DEQNA Emulation Demands Raw Frames
The PDP-11's Ethernet card, the DEQNA (DEC QBUS Network Adapter), embodies a different philosophy from a modern NIC. The operating system assembles arbitrary Ethernet frames itself and pushes them to the card; the card simply puts them on the wire. Upper-layer protocols — DECnet, LAT, IP — all live inside the OS, not the hardware. Emulating this faithfully requires raw MAC-layer (L2) access, which a library that only exposes TCP/UDP sockets (L4) cannot provide.
| Factor | Standard TCP socket library | W5500 raw MAC (W5500MacRaw) |
|---|---|---|
| Access layer | TCP/UDP socket (L4) | Raw Ethernet frame (L2) |
| DEQNA emulation | Not possible — arbitrary EtherTypes blocked | Possible — arbitrary frame assembly and delivery |
| Non-IP protocols (DECnet, etc.) | Not supported | Supported |
| ESP32 CPU load | Software stack required | Handled in W5500 hardware |
| Waveshare board support | — | Runtime-configurable SPI pins (author-modified) |
This raw MAC access is precisely what allows fifty-year-old UNIX to reach a modern Ethernet.
System Architecture — Where Emulation Meets Physical Hardware
(Diagram: emulated kernel → DEQNA emulation → W5500 → physical LAN)
Core Capabilities — a 1970s OS on a Modern Network
| Capability | Detail | Significance |
|---|---|---|
| Supported OSes | UNIX v7, BSD 2.11 | Boot and use historic Unix systems for real |
| DEQNA Ethernet emulation | Raw MAC frames → W5500 | The emulated OS joins a real physical network |
| DZ-11 Telnet multiuser | TCP ports 1101–1104 | Log into UNIX v7 from a modern terminal |
| Disk images | RK05 / RL02 / RP06 / TM11 tape | PDP-11-era disk and tape formats |
| NBD remote disk | Network Block Device | Mount disk images from a network server |
| Built-in debugger | Instruction, memory, register breakpoints | Inspect emulation state in real time |
| Supported platforms | ESP32, Teensy 4.1, PICO2W, Linux, macOS, Windows | One emulator from desktop down to MCU |
Among these, the DEQNA emulation + W5500 raw MAC combination is the decisive differentiator. Most retro emulators either leave networking outside the emulation boundary or detour through the host OS's TAP interface. kek connects to physical Ethernet through the W5500 and lets the emulated OS run its own network stack, end to end.
Hardware Configuration
| Component | Interface | Pins | Role |
|---|---|---|---|
| ESP32-S3 | — | — | PDP-11/70 CPU, MMU, and bus emulation |
| W5500 (integrated on the Waveshare board) | SPI | Per board spec (not listed in README) | DEQNA raw Ethernet frame TX/RX |
| SD card | SPI | MISO=19, MOSI=23, SCK=18, SS=5 | Disk image storage (.dsk files) |
| MAX232 / UART | UART | TX=17, RX=16 | External serial terminal |
| Heartbeat LED | GPIO | 25 | Emulator status indicator |
Recommended board: Waveshare ESP32-S3-ETH — the README says so directly: "If possible, use a waveshare-esp32-s3-eth: that device can do Ethernet for the emulated system over its Ethernet port."
Build environment: PlatformIO (cd ESP32 && pio run -t upload && pio run -t uploadfs)
Desktop build requirements: libncursesw5-dev, cmake, build-essential, pkg-config, libjansson-dev (required); libsdl3-dev, libsdl3-ttf-dev (optional — ImGui graphics output)
Recommended memory: at least 2 MB PSRAM (ESP32 variants)
Communication Architecture — Three Layers Across the Emulation Boundary
| Segment | Protocol | Notes |
|---|---|---|
| DEQNA ↔ W5500 | Raw Ethernet frames (L2) | Via eth_transport_esp32.cpp; arbitrary EtherTypes supported |
| DZ-11 ↔ clients | Telnet (TCP 1101–1104) | One port = one virtual serial terminal; up to 4 |
| Disk backend | Local file / NBD | Disk images on SD card or a remote server |
| Networking inside the emulated OS | startnet (UNIX internal command) | The OS configures its own networking |
Because access happens at L2, every upper-layer protocol (DECnet, IP, and so on) is handled entirely by the emulated UNIX. The kek emulator itself is protocol-agnostic — it simply shuttles frames to and from the W5500.
Implementation & Design Notes
kek drives the CPU, bus, disks, network, and serial devices from a single emulation loop. Each device lives in its own module (deqna.cpp, dz11.cpp, dc11.cpp, etc.), so accuracy improvements stay localized to one file.
Data flow (Ethernet path):
UNIX v7 / BSD 2.11 (emulated kernel)
→ DEQNA driver (code inside the emulated OS)
→ kek DEQNA emulation (deqna.cpp) — assembles the raw frame
→ eth_transport_esp32.cpp — calls W5500MacRaw
→ W5500 (SPI) — transmits the physical Ethernet frame
→ Real LAN
Built-in debugger:
| Feature | Detail |
|---|---|
| Instruction breakpoint | Halt on a specific PDP-11 instruction |
| Memory breakpoint | Halt on read/write of a specific address |
| Register breakpoint | Halt when a register meets a condition |
| Compound conditions | AND / OR combinations |
Output interfaces: ImGui (graphics), ncurses (terminal), and the POSIX console.
W5500MacRaw customizations: compared with the original WIZnet ioLibrary Driver — ① runtime-configurable SPI pins, ② variable-name conflict fixes — both made specifically to support the Waveshare ESP32-S3-ETH board.
Project Value & Broader Applications
The core pattern here is "W5500 raw MAC + MCU emulator → legacy network hardware bridged onto modern Ethernet." It is a reusable structure for any system that must handle arbitrary L2 frames without being bound to TCP/IP — a bridge between old equipment and new infrastructure.
- Industrial legacy protocol bridges: Connect RS-232 or HDLC-era equipment to a modern LAN via W5500 raw Ethernet
- Protocol analysis and test tools: L2 test gear that generates and captures frames with arbitrary EtherTypes
- Educational networking platforms: Students implement a TCP/IP stack from scratch and validate it against real traffic through the W5500
- Historical network protocol research: Reproduce non-IP protocols such as DECnet or XNS on modern hardware
The W5500MacRaw library is independently reusable, and the fact that its author actively maintains it for Waveshare board support bodes well for long-term viability.
Q&A
Q1. Why does a PDP-11/70 emulator need real Ethernet at all?
Typical emulators route networking through the host OS via a TAP interface or SLIP. kek emulates the PDP-11's DEQNA Ethernet card itself, so the emulated OS runs its own network stack from within. That is why UNIX v7 genuinely processes IP packets — and why an external PC can Telnet straight into the emulated system.
Q2. Why W5500 raw MAC access instead of a standard TCP library?
The DEQNA is a card to which the OS hands fully formed Ethernet frames with any EtherType — including non-IP protocols like DECnet and LAT. That requires L2 (MAC frame) access rather than L4 (TCP/UDP) sockets, and the W5500MacRaw library provides exactly that.
Q3. Is the Waveshare ESP32-S3-ETH board mandatory?
The README recommends it but does not require it. Since W5500MacRaw supports runtime-configurable SPI pins, any ESP32 board with a W5500 attached should build. The Waveshare board is simply the easiest path, with Ethernet built in.
Q4. Can operating systems other than UNIX v7 and BSD 2.11 run on kek?
The README names UNIX v7 and BSD 2.11. Other OSes that ran on real PDP-11/70 hardware (RT-11, RSX-11, etc.) may work in theory, but kek's support for them is not stated in the README.
Q5. Is Ethernet available on the Teensy 4.1 and PICO2W builds?
The W5500 submodule exists only under the ESP32/ directory, so the Teensy 4.1 and PICO2W builds appear to offer serial terminal access only, without Ethernet (inferred from the directory structure — direct code verification recommended).
