PyXT is an emulator for the IBM PC XT and clones of that era. It aims to be "100% compatible" by emulating various hardware devices (8088, 8253, etc.) as well as de facto hardware standards of the time (MDA, PPI, etc.).
Always having had an interest in how old DOS-based machines worked I decided that writing an emulator would be a good way to learn.
It has also proven to be an interesting challenge in both learning x86 assembly and keeping Python code running fast.
To run PyXT you will need a system BIOS image and some form of character generation.
You also will need Pygame and six.
This will start PyXT using the monochrome display adapter and the MDA character ROM.
python -m pyxt --bios [BIOS IMAGE] --display mda --mda-rom [CHARACTER ROM] --diskette [DISK IMAGE]
This will start PyXT using the color graphics adapter and the included FreeDOS CPI files (US encoding).
python -m pyxt --bios [BIOS IMAGE] --display cga --cpi-file files\cpidos11\BIN\CPI\ega.cpi --cpi-codepage 437 --diskette [DISK IMAGE]
Additionally the --debug
flag can be used to enable debug logging as well as the interactive debugger.
The --skip-memory-test
flag can be used to speed up the boot process by setting the soft reset flag (BIOS data area 0040:0072).
BIOS images need to be padded to 64k to be loaded at F000:0000 (0xF0000) in conventional memory. I have had success dumping the BIOS from a physical box using these steps (for F0000-FFFFF): http://www.mess.org/dumping/dump_bios_using_debug
All available command line options can be listed by running: python -m pyxt --help
PyXT can currently complete the POST with the following BIOSes:
FreeDOS can also be booted via the Svarog86 distribution 360KB diskette image.
To enable Python cProfile profiling across a session of PyXT, set the environment variable:
PYXT_PROFILING
to a non-blank value:
C:\PyXT>SET PYXT_PROFILING=1
Setting it back to a blank value will disable it:
C:\PyXT>SET PYXT_PROFILING=