Coder Social home page Coder Social logo

clayne / 8086tiny Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ecm-pushbx/8086tiny

1.0 0.0 0.0 1.53 MB

ecm's repository for 8086tiny: a tiny PC emulator/virtual machine

License: MIT License

C 35.91% Makefile 0.90% Assembly 63.07% Shell 0.12%

8086tiny's Introduction

8086tiny

8086tiny is a completely free (MIT License) 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 under 25K). 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, 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 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). Forking this repository is highly encouraged!

Any questions, comments or suggestions are very welcome in our forum at 8086tiny.freeforums.net.

ecm's fork

In this fork, I implemented proper Trace Flag handling for debuggers, interrupt-lockout for mov or pop to ss, and idling with the HLT instruction. I also fixed the shift/rotate count handling so that the machine is always detected as an 8086, as most 186 instructions are still missing. (This is still an option in the source but now defaults to being detected as an 186.) All 186 instructions were added. The invalid opcode condition now invokes interrupt 6, except for the 0Fh-prefixed emulator extension instructions with a second byte below 20h. (Codes 00h to 04h are in use.)

Further, the BIOS's interrupt handlers were modified to be more compatible. Data has been aligned, and several corner cases are handled more properly. The two forms of 186+ push instructions with immediates were implemented, which are used by FreeCOM (a bug). (Now all of the 186 instructions were added.) Three bugs in the emulator were fixed, two of which affected some of the shift and rotate instructions, one the DAA and DAS instructions.

A DOS driver and coupled emulator interface add XMS 2.00 handling to the machine, including HMA, UMB, and XMS extended memory. This driver is limited: A20 is always on, HMAMIN is assumed as zero, and XMS blocks cannot be locked. XMS memory can only be accessed by the driver. UMBs can only be allocated if the requested size exactly matches a block's full size (86-DOS systems compatible to MS-DOS 5 generally do it that way). Further, the UMB area is assumed by the DOS driver. (This is 128 KiB (2000h paragraphs) between segments D000h and EFFFh.) When the system is rebooted, the DOS driver's initialisation frees all prior allocations.

8086tiny's People

Contributors

adriancable avatar andreiw avatar ecm-pushbx avatar smiletheory avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.