The z386 Is an FPGA Re-implementation of Intel's i386 — And Yes, It Runs Doom

"There is a reasonable argument that the 386 is Intel's most important CPU," project creator "nand2mario" says.

ghalfacree
38 minutes ago Retro Tech / FPGAs

Pseudonymous developer and vintage computing enthusiast "nand2mario" has released an open source equivalent to Intel's i386 processor — and, as you might expect, has proven its capabilities by running id Software's 1993 classic Doom.

"z386 is a 386-class CPU built around the original Intel microcode, in the same spirit as z8086," nand2mario explains. "The core is not an instruction-by-instruction emulator in RTL [Register Transfer Level]. The goal is to recreate enough of the original machine that the recovered 386 control ROM can drive it. Today z386 boots [Microsoft MS-]DOS 6 and DOS 7, runs protected-mode programs like DOS/4GW and DOS/32A, and plays games like [id Software's] Doom and [Sensible Software's] Cannon Fodder."

The z386 project puts this, Intel's i386 processor, into an FPGA. (📷: Pauli Rautakorpi, CC-BY 3.0)

Intel launched the 386, originally as the 80386 and later the i386, in 1985, promising boosted performance over its predecessor the 286 and support for up to 4GB of memory. Not officially discontinued until 2007, the 386 was a best-seller for Intel even after the launch of the faster i486 in 1989 — and while an open-source re-implementation of the 486 already exists, nand2mario has now delivered a 386 you can run in an FPGA.

"There is a reasonable argument that the 386 is Intel's most important CPU," nand2mario says. "Not the cleanest, not the fastest for its time, and not the most elegant. But it got the hardware-software contract mostly right: a 32-bit x86 with protected mode, paging, and good backward compatibility. Another perspective makes a similar case: what we now call x86 really starts to look like itself with the 80386."

To prove that even demanding workloads run on the soft-core chip, nand2mario reached for a classic: id Software's Doom. (📷: nand2mario)

"z386 is part CPU implementation, part archaeology, and part logic puzzle," the developer continues, crediting existing efforts to reverse-engineer classic Intel processors and disassemble their microcode as providing a starting point for their re-implementation. "Every time a BIOS, memory manager, or DOS extender gets a little further, it is evidence that another part of the design has been reconstructed."

A full write-up is available on nand2mario's blog; the source code is available on GitHub under an unspecified open source license, while a core ready to run on the MiSTer FPGA-based emulation platform is available in a separate repository.

Main article image courtesy of Mister rf, CC-BY-SA 4.0 International.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles