z386: An Open-Source 80386 Built Around Original Microcode
AIThis post was created with the assistance of artificial intelligence (AI).

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.

Nandland Go Board - FPGA Development Board for Beginners with USB Cable, 4 LEDs, 4 Push-Buttons, 7-Segment Display, VGA, PMOD, Win/Mac/Linux Compatible

Nandland Go Board – FPGA Development Board for Beginners with USB Cable, 4 LEDs, 4 Push-Buttons, 7-Segment Display, VGA, PMOD, Win/Mac/Linux Compatible

  • Ideal for FPGA Beginners: Simple board with progressive projects
  • Includes Multiple Peripherals: 4 LEDs, push-buttons, 7-segment display, VGA, PMOD
  • Compatible with Major OS: Works with Windows, Mac, Linux

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)

CPU DIY Kit TD4 Make a Simple 4-bit CPU By Yourself Open Source Software and Hardware Including PCB and All Components (PCB and Components)

CPU DIY Kit TD4 Make a Simple 4-bit CPU By Yourself Open Source Software and Hardware Including PCB and All Components (PCB and Components)

  • Shipping includes TD4 PCB and components: Complete kit with PCB and parts

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 microprocessor emulator hardware

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 x86 protected mode software 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

The Workforce of 2025: Ai-Savvy Millennials Lead the Productivity Shift.

Prepare to discover how AI-savvy millennials will reshape the workforce by 2025, transforming productivity and workplace dynamics in ways you won’t want to miss.

Forward-Deployed Engineer Economics 2.0: The Unit Economics Math, Six Months Later

Six months after initial analysis, FDE unit economics reveal profitability at enterprise scale, but challenges at lower levels. Key data and implications explained.

Apple Is Reaching for Chinese Memory. Europe Doesn’t Even Have That Option.

Apple is lobbying Washington to buy memory chips from China’s CXMT, highlighting Europe’s lack of domestic memory manufacturing and strategic leverage.