PC Emulator for Unix and X Windows As the title suggests, this is a Unix/X windows program which is designed to emulate a standard 8086 based PC. In its current form it runs most text based programs. The programs I have tried and found to work are as follows: MSDOS 5.0 MSDOS 6.2 WordPerfect 5.1 Borland C++ 2.0 Turbo Debugger 2.51 Turbo Assembler 2.51 BBCBasic 4.61 MSDOS QBasic MSDOS GWBASIC Virtually all program that came with MSDOS 5 Hitchhiker's Guide to the Galaxy PC Magazine's ANSI.COM SemWare's QEdit 2.1 Norton Utils 4.50 Advanced Edition Norton Utils 6.0 Xtree Professional 1.1 PowerMeter Utils Autoroute (ancient version) Minitab 8.0 Microsoft Diagnostics This is all the programs I could lay my hands on which were text based and could run on an 8086 The emulator runs at about 8-10MHz 80286 speed on a Sun SparcStation 10/40 (without the -mviking flag) and at about 6MHz 8088 speed on a 33MHz 80486 box running Linux. I have included a Postscript representation of my project report. It's a bit out of date now, but it's the closest thing I've got to documentation! I'll do some kind of latex thing for the next release.... Be warned that the program is only at alpha testing stage and I can't guarantee that it will run on your system. The program rather hogs the cpu but unmapping the window (iconifying it) will put it to sleep. The most recent version of this program will always be in ftp.cs.bris.ac.uk currently in the directory /users/hedley Architectures tested: Computer OS Comments ----------------------------------------------------------------------------- PC 486/33 Linux 0.99.14w Runs quite well. A bit pointless though :) Sun 3/60 SunOS 4.1.x Takes an age to compile and not really worth the effort... SparcStation 10 SunOS 4.1.3 Runs well. Takes > 20MB RAM to compile though HP 755/99 HPUX Runs OK (>25MB RAM to compile...) Sun 4 Solaris 2.3 Runs OK RS6000 ??? Had a few problems getting it to compile. Getting there slowly though. SGI Indigo IRIX 4.?.? Doesn't work if compiled with optimisation using the standard compiler. Haven't tried it using gcc yet... As you can see this list is quite small. The main limiting factor is the range of machines I have access to. If anyone else can get it running on other architectures then please contact me! Warning: This program is not secure! Do not make is suid or sgid anything unless you wish to compromise the security of your system! EMULATOR LIMITATIONS etc Some parts of the PC architecture are emulated better than others. The BIOS has been partly implemented - enough to get MSDOS to boot and to allow most programs to run. Anyhow, most decent programs bypass the BIOS for screen access. BIOS Disk calls for drive A have been mostly emulated, although formatting doesn't work. Some of the hardware has been emulated but not much. Timer interrupts are generated by the system but there is now way (at present) to reprogram the timer. The Programmable Interrupt Controller has been emulated in part to respond to the End Of Interrupt command and reads from and writes to the mask register should work OK. None of the VGA hardware has been emulated at present (apart from screen updating) although this will change in the near future. Mode changes must therefore be done through the BIOS. The keyboard has been mostly emulated. The program converts X11 keysyms to raw PC scan codes and then generates an interrupt 9 as per usual. There is a BIOS routine which takes these scan codes and generates the correct BIOS ASCII/scan code pair. The keysyms used can be found in the module 'xstuff.c'. In the future these keysyms will be read in from a file at run time. THANKS Thanks go to the following: Andy Norman at HPLabs, Bristol (ange@hpl.hewlett-packard.co.uk) for the HP port. Dieter Becker (becker@med-in.uni-sb.de) for help with the Solaris port Klaas Esselink (esselin1@ksla.nl) for help with the RS6000 port Please report bugs/comments etc to me (hedley@cs.bris.ac.uk) and I'll do my best to sort them out (no guarantees though). After June 25th I will be leaving University and will not be able to check email very frequently - please be patient if you want a response - I will reply eventually. Have fun... David