He Chunhui's Tiny386 Turns the Humble ESP32-S3 Into a Fully-Functional 386-Powered Desktop PC

Fancy running Microsoft's Windows 95 on a low-cost microcontroller? Well, now you can!

Gareth Halfacree
2 hours agoRetro Tech

Developer He Chunhui has turned the humble Espressif ESP32 microcontroller into a fully-fledged '90s personal computer with Tiny386 — a resource-efficient emulator capable of running Microsoft Windows 95 and a range of 16- and 32-bit software packages on the low-cost chip.

"Tiny386 is a x86 PC emulator written in C99," Chunhui explains of the project. "The highlight of the project is its portability. It now boots Windows 9x/NT on MCU [Microcontroller Units] such as [the Espressif] ESP32-S3. The core of the project is a built-from-scratch, simple and stupid [Intel] i386 CPU emulator. Some features are missing, e.g. debugging, hardware tasking, and some permission checks, but it should be able to run most 16/32-bit software."

What once took a shiny new desktop computer can be achieved with a low-cost microcontroller — thanks to Tiny386. (📹: He Chunhui)

The 80386, more commonly known as the 386 and later rebadged as the i386, was released in 1985 as the successor to the best-selling 80286, expanding the nascent x86 architecture's capabilities with a six-stage instruction pipeline and support for 32-bit operation with an on-board memory management unit. It was, at the time, a powerful chip and found a home in desktops, laptops, and even servers of the era.

The Espressif ESP32-S3, by contrast, is a low cost — but nevertheless highly capable — microcontroller, available for a fraction of the price of the 386 in its heyday and drawing considerably less power. Despite this, it's also a lot more powerful: the 386 was available in clock speeds of 12MHz up to 40MHz; the ESP32-S3 features a pair of Tensilica Xtensa LX7 cores running at 240MHz. That gap in power means, somewhat surprisingly, it's possible to emulate a mostly-functional 386 PC using just the ESP32-S3 plus some external pseudo-static RAM.

The Tiny386 runs on the microcontroller itself — though is designed for portability to other platforms, with Chunhui releasing a demo that runs in-browser — and, despite having some functionality stripped out, can run a wide range of software including, naturally, Id Software's 1993 classic first-person shooter Doom. The project borrows peripherals from other emulators to flesh out the system, adding VGA graphics capabilities, an emulated Ethernet network interface, and even a choice of three sound devices: PC speaker, Adlib OPL2 synthesis, and Creative Labs' SoundBlaster 16.

"To boot [a] modern Linux kernel and [Microsoft] Windows, some 486 and 586 instructions are added," Chunhui notes of the overall feature set. "The CPU emulator is kept in ~6k LOC [Lines Of Code]. There is also an optional x87 FPU [Floating-Point Unit] emulator. For firmware, the BIOS/VGABIOS comes from [the] SeaBIOS [project]. Tiny386 also supports booting [the] Linux kernel directly, without traditional BIOS."

Full source code for the project is available on GitHub under the permissive BSD three-clause license, with Chunhui having demonstrated success booting it on the low-cost Guition JC3248W535 ESP32-S3-based LCD development board. Additional information is available on Hackaday.io, with an in-browser demo available via GitHub Pages.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles