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.

Cyclone 10 FPGA Development Board - CycloFlex

Cyclone 10 FPGA Development Board – CycloFlex

Altera 10CL016 FPGA with 16,000 Logic Elements. This FPGA Development Kit requires an external JTAG Programmer. The Cyclone…

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)

Introduction to X86 Machine Code Assembly Language: Using an FPGA with Verilog

Introduction to X86 Machine Code Assembly Language: Using an FPGA with Verilog

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.

LXZ Gaming Desktop Core i7-14700F, RTX 5060 8G, 16G DDR5 RAM, 1TB NVME 3.0 SSD, Prebuilt Gaming PC, VR Ready Tower Computer for Home and Office

LXZ Gaming Desktop Core i7-14700F, RTX 5060 8G, 16G DDR5 RAM, 1TB NVME 3.0 SSD, Prebuilt Gaming PC, VR Ready Tower Computer for Home and Office

Next-Gen Powerhouse Performance: Equipped with the powerful Core i7-14700F processor and the latest GeForce RTX 5060 8G graphics…

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.

64GB - Bootable USB Driver 3.2 for Windows 11/10/8.1/7/, WinPE,Password Reset, WiFi & LAN Drives,Bypass TPM requirement,Supported UEFI and Legacy, Reinstall Windows,Compatible New Build & Old Computer

64GB – Bootable USB Driver 3.2 for Windows 11/10/8.1/7/, WinPE,Password Reset, WiFi & LAN Drives,Bypass TPM requirement,Supported UEFI and Legacy, Reinstall Windows,Compatible New Build & Old Computer

✅ If you are a beginner, please refer to “Image-7”, which is a video tutorial, ( may require…

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

Viral AI Art Alert: Maui’s Stunning Visual Effects Capture the Internet’s Imagination

The mesmerizing AI art inspired by Maui is captivating audiences worldwide, but what secrets lie behind its viral success? Discover the magic within.

Large-Scale Ethereum Investors Are Aping Into the Lightchain AI Presale Token

Notable Ethereum investors are flocking to the Lightchain AI presale token, hinting at a transformative shift in the crypto landscape that could reshape the future.

Private equity firm EQT to buy Japan restaurant review operator for $3.7b

Sweden’s EQT to buy Kakaku.com, operator of Tabelog, Japan’s leading restaurant review platform, for approximately $3.75 billion, in a major private equity deal.

How Manus AI Redefines the Link Between Thinking and Doing

Optimizing operations, Manus AI bridges the gap between thought and action—discover how this innovative approach can revolutionize your business strategies.