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

Date:

Share:

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.

Source link

Subscribe to our magazine

━ more like this

22 Pictures of Cats Cozying Up by the Fire and Living Their Fluffiest, Toastiest Lives

When the weather turns cold, cats somehow always discover the warmest, coziest corner of the house usually right by the fireplace. They curl up...

Under-$100 Free People Gifts For Everyone On Your List

It’s pretty safe to say that we’re all on a budget and all short on time. The solution? Free People’s online gift shop. The...

Today’s NYT Strands Hints, Answer and Help for Nov. 9 #616

Looking for the most recent Strands answer? Click here for our daily Strands hints, as well as our daily answers and hints for The New...

William Sealy Gosset Plaque in Ireland

When William Sealy Gosset joined the Guinness brewery in Dublin in 1899 as a chemist, he faced a practical problem: how could he...

Hiring manager demands candidate send a “thank-you video” to the team after their interview, candidate refuses: ‘That’s one way to filter out people with...

While interviewing for a new job, one hears a lot of strange requests that they don't quite know how to deal with.We've heard of...