Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tiny386

> 编程语言
Open source

tiny 386 PC emulator; running win9x on esp32

648 stars0 likes1 views
WebsiteGitHub

About

tiny 386 PC emulator; running win9x on esp32

Tiny386

Introduction

Tiny386 is an x86 PC emulator written in C99. The highlight of the project is its portability. It now boots Windows 9x/NT on MCU such as ESP32-S3.

The core of the project is a built-from-scratch, simple and stupid 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. To boot modern linux kernel and windows, some 486 and 586 instrutions are added. The cpu emulator is kept in ~6K LOC. There is also an optional x87 fpu emulator.

To assemble a complete PC system, we have ported many peripherals from TinyEMU and QEMU, it now includes:

  • 8259 PIC
  • 8254 PIT
  • 8042 Keyboard Controller
  • CMOS RTC
  • ISA VGA with Bochs VBE
  • IDE Disk Controller
  • NE2000 ISA Network Card
  • 8257 ISA DMA
  • PC Speaker
  • Adlib OPL2 (optional)
  • SoundBlaster 16

For firmware, the BIOS/VGABIOS comes from seabios. Tiny386 also supports booting linux kernel directly, without traditional BIOS. The idea comes from JSLinux, and it uses a small stub code called linuxstart.

Tiny386 now supports i686, MMX, SSE (up to SSSE3) and amd64 (64bit long mode only). As these features are optional, they may be safely disregarded if not required.

Demo

See here

Build

The project is designed with simplicity in mind. Just run gcc -O3 *.c -o tiny386_headless -lm, and you will get a "headless" executable without any optional features.

To build with display and sound:

  • Linux (with rawdraw): Install libslirp, libx11, and libasound2 first, then run make.
  • Linux (with SDL): Install libslirp SDL1.2 (or sdl12-compat) first, then run make USE_SDL=y.
  • Windows: Install mingw-w64 first, then run make win32.
  • WebAssembly: Install clang first, then run cd wasm; make.

For details, please refer to .github/workflows/build.yml and Makefile.

Pre-built binaries: here

Usage

  • Prepare an ini file
…
  • Run
bash
./tiny386 config.ini
./tiny386 -kvm config.ini  # run with KVM (build with `make USE_CPUABS=y`)

For rawdraw and SDL port: Press "Ctrl + ]" to grab/ungrab the keyboard and mouse. Press "Ctrl + [" to show/hide OSD (On Screen Display). In OSD mode, the floppy/CD-ROM disk can be changed on the fly.

ESP32 port

Supported boards:

With ESP-IDF 5.2.x:

  • JC3248W535 (ESP32-S3, 480x320)
  • Elecrow CrowPanel Advance 7.0" HMI (ESP32-S3, 800x480)

With ESP-IDF 6.0.x (experimental):

  • JC4880P443 (ESP32-P4 Rev1.3 360MHz, 800x480)

Build and Flash

You can find the pre-built flash image esp/flash_image_JC3248W535.bin from here. The pre-built image can be flashed directly to offset 0.

Online flasher for esp chips: https://espressif.github.io/esptool-js

To build and flash manually:

bash
scripts/build.sh patch_idf  # apply patches to ESP-IDF 5.2.x
#scripts/build.sh patch_idf_60  # apply patches to ESP-IDF 6.0.x
make prepare
cd esp
idf.py -DBOARD=jc3248w535 update-dependencies build  # or -DBOARD=elecrow7s3
idf.py flash

Configure

All files should be put in a SD card with FAT/exFAT file system. The ini file should be tiny386.ini and put in the root directory. Please refer to esp/tiny386.ini.

Alternative usage: bios.bin vgabios.bin vmlinux.bin and linuxstart.bin can be put in corresponding flash partition. Other files can be put in the storage flash partition. Please refer to esp/partition.csv.

Keyboard/Mouse Input

  • Forward over WIFI

wifikbd is used to forward keyboard/mouse events to the dev board over WIFI:

(ESP32-S3 board: listen on TCP port 9999)  AP  (PC: ./wifikbd esp_board_addr 9999)
  • USB hid (experimental)

Add the following config:

[esp]
enable_usb = 1

Note: DO NOT enable USB and WIFI at the same time on ESP32-S3, due to insufficient memory.

More info, see here.

Troubleshooting

"0 bytes of memory" during Windows 95 setup

Use "setup /im" to bypass memory check.

"protection error" during Windows 95 startup

Use patcher9x.

NE2000 doesn't work

Manually set the IRQ to 9(or 2).

freeze during Windows NT4/2000/XP startup

Use fill_cmos = 0 in the config ini file.

License

The cpu emulator and the project as a whole are both licensed under the BSD-3-Clause license.

Adlib emulation is an optional part of the project, and it requires the library fmopl which is licensed under the LGPL. Use make USE_FMOPL=n to build without adlib emulation.

SeaBIOS is distributed under the GNU LGPL-3 license.

Some parts ported from QEMU/TinyEMU are under the MIT license.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Cemulatoresp32x86

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言