z386: An Open-Source 80386 Built Around Original Microcode

TL;DR

z386 is an open-source FPGA implementation of the Intel 80386 CPU built around original microcode. It can run DOS, protected-mode programs, and classic games, offering insights into historic microarchitecture. Its development marks a significant step in hardware reconstruction and education.

The z386 project is an open-source FPGA implementation of the Intel 80386 CPU, built around the original microcode, capable of running DOS 6, DOS 7, and protected-mode applications like Doom.

The project, led by an enthusiast known as reenigne, has reconstructed the 386 microarchitecture to the point where it can boot and run real software, including classic games and protected-mode programs. It uses a microcode ROM with 2,560 entries, matching the original design, and performs at speeds comparable to a 70MHz 386 or low-end 486.

The FPGA implementation includes key 386 units such as prefetch, decode, microcode sequencer, ALU, segmentation, protection, paging, and memory interface, mirroring the original architecture while incorporating FPGA-friendly optimizations. It is capable of running DOS and protected mode applications like DOS/4GW and DOS/32A, with benchmarks showing performance close to historical hardware.

Why It Matters

This project offers a rare, open-source reconstruction of the 386 microarchitecture, providing educational insights into microcode-driven CPU design and the evolution of x86 architecture. It also enables enthusiasts and researchers to study and experiment with authentic hardware behavior without proprietary restrictions, fostering deeper understanding of legacy systems.

Amazon

FPGA development board for microcontroller projects

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

The 80386 microcode was recently recovered and disassembled by researchers, enabling projects like z386 to recreate the chip’s functionality on FPGA. Previous efforts, such as z8086, demonstrated the feasibility of microcode-based CPU reconstruction, but the 386’s complexity posed a greater challenge due to its richer internal state, protection features, and denser micro-operations. The current development builds on this foundation, aiming for both educational value and practical software compatibility.

“Building z386 around original microcode allows us to understand and demonstrate the inner workings of the 386 in a way that emulators or RTL-based designs can’t match.”

— reenigne (project developer)

“The 80386 architecture is organized into multiple units that work together, including prefetch, decode, microcode sequencer, and memory management units.”

— Intel documentation (source reference)

Amazon

x86 CPU emulator hardware

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 fully the z386 implementation can handle all edge cases of the original microcode, particularly under complex or rare instruction sequences. Performance metrics and stability over long-term use are still being evaluated, and the project is actively evolving.

Amazon

retro gaming PC build components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Future steps include optimizing performance, expanding software compatibility, and refining microcode accuracy. Additional testing with a broader range of protected-mode applications and further microcode analysis are expected to follow.

Amazon

legacy software compatible hardware

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Can z386 run modern x86 software?

No, z386 is designed to emulate the 80386 architecture and is primarily capable of running legacy DOS and protected-mode applications from the era.

How accurate is the microcode reconstruction?

The microcode has been reconstructed based on disassembly and analysis of recovered original ROMs, aiming for high fidelity to the original hardware, but some micro-operations may still be approximated.

Is z386 available for public use?

Yes, the project is open-source and available on repositories like GitHub, allowing enthusiasts and researchers to explore and contribute.

What hardware is needed to run z386?

An FPGA development board capable of supporting the design’s resource requirements (such as a Xilinx or Intel FPGA board) is needed; it does not run on general-purpose CPUs.

What are the main challenges in recreating the 386 microarchitecture?

The complexity of dense microcode, detailed protection and paging mechanisms, and the need for accurate timing and behavior modeling pose significant challenges.

Source: Hacker News

You May Also Like

Academia Meets Innovation as Kent State Expands Into AI Learning.

Metamorphosing higher education, Kent State’s AI initiatives promise groundbreaking advancements—discover how they are shaping the future of learning and discovery.

Shopping in the Predictive Age: From Want to Need to Know

Shopping in the Predictive Age transforms your experience from want to need with AI-driven insights—discover how your preferences are shaping the future of retail.