z386: An Open-Source 80386 Built Around Original Microcode

TL;DR

z386 is an open-source FPGA implementation of the Intel 80386 microprocessor, built around recovered original microcode. It can run DOS, protected-mode programs, and classic games, representing a significant step in hardware reconstruction.

The z386 project, an open-source FPGA implementation of the Intel 80386 microprocessor, has achieved a milestone by successfully booting DOS 6 and DOS 7, and running protected-mode software, including classic games. This development allows researchers and enthusiasts to explore the original 386 microarchitecture in hardware form, based on recovered microcode.

The z386 CPU is built around the original 386 microcode, which has been recovered and disassembled by researchers. The project is designed to reproduce key aspects of the original microarchitecture, including microcode ROM, instruction prefetch, decode logic, and address translation units. It runs at a clock speed comparable to a 70MHz 386 or low-end 486, with performance benchmarks showing it can handle software like Doom and Cannon Fodder. The implementation uses FPGA-friendly techniques, such as DSP blocks for multiplication and a 16 KB cache, to balance accuracy and practicality. The project is a continuation of previous efforts, notably the z8086, and benefits from shared microcode disassembly work from the community, including reenigne and others.

According to the project creator, the goal was to create a faithful reconstruction that is both educational and functional, capable of running real software. The design includes major units such as prefetch, decode, microcode sequencer, ALU, segmentation, protection, paging, and memory interface, mirroring the original 386 architecture. The project has demonstrated the ability to run complex protected-mode software, a significant step forward in hardware archaeology.

Why It Matters

This development matters because it provides a tangible, hardware-based window into the original 386 microarchitecture, which has been largely inaccessible since the microcode was proprietary. It enables detailed study of the processor’s design and operation, offering educational value and insights into early PC architecture. For the retro computing community, it represents a milestone in hardware reconstruction, potentially inspiring further projects and preserving computing history in a functional form.

LILYGO T-FPGA ESP32-S3 TTGO Development Board M.2 Slot FPGA Low-Power Microcontrollers WiFi Bluetooth5 Module (T-FPGA Kit)

LILYGO T-FPGA ESP32-S3 TTGO Development Board M.2 Slot FPGA Low-Power Microcontrollers WiFi Bluetooth5 Module (T-FPGA Kit)

【MCU】ESP32-S3R8 Dual-core LX7 microprocessor

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

The 80386 was a pivotal processor introduced by Intel in 1985, featuring protected mode, paging, and a 32-bit architecture that laid the groundwork for modern x86 systems. Prior efforts to emulate or reconstruct the 386 in hardware have been limited or theoretical. The recent recovery and disassembly of the original microcode, shared by the community, has enabled projects like z386 to move from software emulation to hardware implementation. The project builds on previous FPGA CPU efforts, such as z8086, and benefits from detailed microcode analysis that has only recently become available.

“The goal was to create a faithful, educational, and functional replica of the 386 microarchitecture based on original microcode.”

— Project creator

“The recovered microcode provides unprecedented insight into the 386’s internal operations, enabling accurate hardware reconstruction.”

— Community microcode disassembler team

BRICKKK Retro Computer Building Blocks Set, Vintage PC Model Kit for Adults, Creative Collectible Computer Model Bricks Set, Classic Desktop Construction Kit, Perfect Display Piece for Home or Office

BRICKKK Retro Computer Building Blocks Set, Vintage PC Model Kit for Adults, Creative Collectible Computer Model Bricks Set, Classic Desktop Construction Kit, Perfect Display Piece for Home or Office

【Retro Computer Building Blocks Kit】Relive the charm of 1980s computing with this detailed retro computer building set. More…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It is not yet clear how closely the current FPGA implementation matches the original 386 microarchitecture in all details, or how well it handles all edge cases and rare instructions. The project is still in development, with ongoing testing and refinement needed to improve accuracy and performance. Additionally, the full extent of microcode disassembly and interpretation remains a work in progress, and some microarchitectural features may be simplified or approximated.

Sipeed Tang Console FPGA Retro Game Console - Tang Mega 60K/138K SOM BL616 MCU - USB3.0 HDMI Output - PMOD x2 40Pin x2, Linux Dev Board Developer Kit for FPGA IDE Programming (60K SoM, Dev Board Kit)

Sipeed Tang Console FPGA Retro Game Console – Tang Mega 60K/138K SOM BL616 MCU – USB3.0 HDMI Output – PMOD x2 40Pin x2, Linux Dev Board Developer Kit for FPGA IDE Programming (60K SoM, Dev Board Kit)

[Compatible with Various SOMs] Sipeed Tang Console FPGA development board enjoy powerful FPGA performance with configurations up to…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

The next steps include further testing with a broader set of software, optimizing performance, and possibly expanding microcode coverage. Developers aim to refine the microarchitecture fidelity and explore more complex protected-mode applications. Community collaboration and microcode analysis are expected to continue, potentially leading to more accurate or complete reconstructions of the 386 microarchitecture.

Amazon

open-source 386 microprocessor FPGA

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is z386?

z386 is an open-source FPGA-based implementation of the Intel 80386 microprocessor, built around recovered original microcode, capable of running DOS and protected-mode software.

Why is this project significant?

It provides a hardware-based reconstruction of the 386 architecture, offering educational insights and preserving a key step in computing history that was previously only accessible via software emulation.

Can z386 run all 386 software?

Currently, it can run many DOS-based and protected-mode programs, including classic games like Doom, but full compatibility with all software remains under development.

How accurate is the microcode implementation?

The project is based on recovered and disassembled microcode, but some microarchitectural features may be simplified or approximated as development continues.

What are the future plans for z386?

Future efforts focus on expanding microcode coverage, improving performance, and testing with a wider range of software to enhance fidelity and usability.

Source: Hacker News

You May Also Like

Fully-functional RTX 3070 16GB gets frankensteined into existence by harvesting dead PCBs and RX 6800 XT’s VRAM chips — doubles frame rate in games like Spider Man 2 at 4K and includes switch for 8GB mode

A PC enthusiast successfully combines an RTX 3070 and a damaged RX 6900 XT to produce a working 16GB RTX 3070, demonstrating advanced hardware hacking.

Microsoft starts canceling Claude Code licenses

Microsoft plans to phase out Claude Code licenses by June 30, shifting focus to GitHub Copilot CLI amid internal transitions and cost-cutting measures.

Nanotechnology in 2025: Tiny Tech With Big Impact

Just as nanotechnology transforms industries by 2025, discover how tiny innovations will shape your everyday life and the world around you.

How Anthropic Could Take an OpenAI Supplier Off The Table

Anthropic is exploring ways to replace a major supplier providing hardware components for OpenAI, potentially impacting AI development supply chains.