8086tiny · Home
About 8086tiny 1.25

8086tiny is a free, open source PC XT-compatible emulator/virtual machine written in C. It is, we believe, the smallest of its kind (the fully-commented source is around 28K). Despite its size, 8086tiny provides a highly accurate 8086 CPU emulation, together with support for PC peripherals including XT-style keyboard, floppy/hard disk, clock, timers, audio, and Hercules/CGA graphics. 8086tiny is powerful enough to run software like AutoCAD, Windows 3.0, and legacy PC games: the 8086tiny distribution includes Alley Cat, the author's favorite PC game of all time.

8086tiny is highly portable and runs on practically any little endian machine, from simple 32-bit MCUs upwards. 8086tiny has successfully been deployed on 32-bit/64-bit Intel machines (Windows, Mac OS X and Linux), Nexus 4/ARM (Android), iPad 3 and iPhone 5S (iOS), and Raspberry Pi (Linux).

The philosophy of 8086tiny is to keep the code base as small as possible, and through the open source license and repository on GitHub encourage individual developers to tune and extend it as per their specific requirements, adding support, for example, for more complex instruction sets (e.g. Pentium) or peripherals (e.g. mouse). Any questions, comments or suggestions are very welcome in our forum.

An obfuscated version of 8086tiny (condensed into just 4043 bytes of C code) was a winner of the 2013 IOCCC contest. Significant interest followed for a documented, commented, maintainable version. The result is the distribution presented here.

Feature Highlights

8086tiny's feature highlights include:

  • Highly accurate, complete 8086 CPU emulation (including undocumented features and behavior)
  • Support for all standard PC peripherals: keyboard, 3.5" floppy drive, hard drive, video (Hercules/CGA graphics and text mode, including direct video memory access), real-time clock, timers, PC speaker
  • Disk images are compatible with standard Windows/Mac/UNIX mount tools for simple interoperability
  • Complete source code provided (including custom BIOS)

8086tiny is highly portable, with minimal system requirements:

  • Minimal C runtime library support required (uses POSIX file I/O and time functions only - no memory management or string functions)
  • Uses SDL 1.2 for graphics, but can compile without SDL for text-only applications
  • Storage requirement: typically around 20KB for compiled binary, 6KB for BIOS image, and 720KB/1.44MB for floppy disk image
  • System RAM requirement: around 1.5MB
Screenshots
MS-DOS 6.22
Windows 3.0
Lotus 1-2-3 R2.4
MS Flight Simulator 4
Linux/ELKS 0.1.5
Microsoft QBASIC
Alley Cat
ETEN Chinese System
Carrier Command
Applications

Some possible applications:

  • Run legacy PC software and games on modern hardware
  • Teach computer architecture and Intel assembly language in a safe, sandboxed environment
  • Deploy on Raspberry Pi to make the world's cheapest ($25) complete IBM-compatible PC
  • Extend the code base to develop a lean, modern-processor VM

If you develop an application that makes use of 8086tiny, and would like a link to it here, please get in touch.

License

8086tiny is free to use for any purpose, commercial or non-commercial, and is made available under the MIT License.

Author Contact
Adrian Cable
adrian.cable@gmail.com

If 8086tiny brings you joy or profit, the author welcomes modest donations as a token of appreciation.

Latest Updates
March 19th, 2014: Revision 1.25. Major CPU, graphics, text and audio performance improvements. Support for DOS Plus and CPM-86. BIOS bug fixes.

February 20th, 2014: Revision 1.20. Major update. 2X faster CPU, 4X faster graphics. PC speaker, CGA graphics and timer support. Keyboard and video bug fixes.

February 9th, 2014: Revision 1.15. Full keyboard support for graphics (SDL) applications. Performance improvements.

February 5th, 2014: Revision 1.11. Binary and BIOS are smaller and faster. Keystroke dropping and character output bugs fixed.

February 3rd, 2014: Revision 1.10. Support for running ELKS/Linux. Hard disk boot support. Fixed disk and video bugs in BIOS. CRT hardware cursor support added. Direct video memory access speed improvements. Improved Makefile for compiling without SDL.

January 30th, 2014: GitHub repository for 8086tiny is now online. See Download page.

January 26th, 2014: Revision 1.03. Hercules CRTC resolution reprogramming now supported, needed by some applications e.g. ETEN Chinese System.

January 24th, 2014: Revision 1.02. Source code tidy-up to remove compiler warnings.

January 23rd, 2014: Revision 1.01. License changed to MIT License.

January 21st, 2014: Initial release 1.00.