"Fossies" - the Fresh Open Source Software Archive

Member "pcemu/README" (22 Jan 2001, 9287 Bytes) of package /linux/privat/old/pcemu-1.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2                        PC Emulator for Unix and X Windows
    3 
    4 As the title suggests, this is a Unix/X windows program which is
    5 designed to emulate a standard 8086 based PC.
    6 
    7 In its current form it runs most text based programs. The programs I have
    8 tried and found to work are as follows:
    9 
   10 MSDOS 5.0                         MSDOS 6.2
   11 WordPerfect 5.1                   Borland C++ 2.0
   12 Turbo Debugger 2.51               Turbo Assembler 2.51
   13 BBCBasic 4.61                     MSDOS QBasic
   14 MSDOS GWBASIC                     Virtually all program that came with MSDOS 5
   15 Hitchhiker's Guide to the Galaxy  PC Magazine's ANSI.COM
   16 SemWare's QEdit 2.1               Norton Utils 4.50 Advanced Edition
   17 Norton Utils 6.0                  Xtree Professional 1.1
   18 PowerMeter Utils                  Autoroute (ancient version)
   19 Minitab 8.0                       Microsoft Diagnostics
   20 
   21 This is all the programs I could lay my hands on which were text based
   22 and could run on an 8086
   23 
   24 The emulator runs at about 8-10MHz 80286 speed on a Sun SparcStation
   25 10/40 (without the -mviking flag) and at about 6MHz 8088 speed on a
   26 33MHz 80486 box running Linux.
   27 
   28 I have included a Postscript representation of my project report. It's
   29 a bit out of date now, but it's the closest thing I've got to
   30 documentation!  I'll do some kind of latex thing for the next
   31 release....
   32 
   33 The program rather hogs the cpu but unmapping the window (iconifying
   34 it) will put it to sleep.
   35 
   36 The most recent version of this program will always be in ftp.cs.bris.ac.uk
   37 currently in the directory /users/hedley
   38 
   39 INSTALLING THE EMULATOR
   40 
   41 Edit the Makefile to change the OPTIONS, CFLAGS and XROOT to be
   42 appropriate for your system (I am assuming you are using GNU GCC,
   43 although any ANSI C compiler should work just as well). Ensure you are
   44 using the best (speed) optimisations possible (e.g. -O2 -fomit-frame-poiner)
   45 
   46 Edit the file mytypes.h and ensure that the types for INT8, UINT8,
   47 INT16, UINT16 etc are correct. Hopefully nothing need be changed in
   48 this file, but you never can tell... I have assumed that 'char's are 8
   49 bit bytes, 'short's are 16 bit words and 'long's are 32 bit words. If
   50 your compiler treats these differently to the above then you will have
   51 to edit this header file.
   52 
   53 Type 'make' and go away and have a cup of tea! Compiling 'cpu.c' takes
   54 a while (and quite a bit of memory!).
   55 
   56 Get a floppy disk of the same size/type as you specified in the Makefile
   57 (i.e. if you chose -DBOOT720, then you'll need a 3.5" 720k disk). Install
   58 MSDOS on it. Copy the files 'config.sys', 'emufs.sys' and 'lredir.exe' from
   59 the 'programs' directory onto this floppy disk. Shove it in your Unix box
   60 and type cp /dev/fd0 DriveA This should create a 720k (or whatever) file
   61 which the emulator can boot from.  If you do not have access to a Unix box
   62 with a floppy disk on it, then you can use the supplied 'dumpdisk' program
   63 to create a disk image. All you need is access to a PC. Simply put in a
   64 bootable MSDOS disk into the drive and type dumpdisk A (or dumpdisk B if in
   65 drive B). The program will copy the entire disk to a file called
   66 'drivea'. You must then transfer it to your Unix box...
   67 
   68 You then need to convert the vga font (vga.bdf) into a font format
   69 your X server can understand (either SNF or PCF) using either
   70 'bdftosnf' or 'bdftopcf' and install the resulting font file somewhere
   71 where your X server can find it. Then type 'mkfontdir' to rebuild the
   72 fonts.dir file and then type 'xset fp rehash' to tell your X server
   73 about the new font. If you type 'xlsfonts' you should see 'vga' as one
   74 of the fonts listed. If not, then something has gone wrong. I may or
   75 may not be able to help - it depends on your local setup. The emulator
   76 will run without the font as it uses the standard 8x16 X11 font -
   77 although most programs which use the extended character set will look
   78 pretty terrible. A warning will be displayed if the correct VGA font
   79 cannot be found. If you are using openwindows, you will have to type
   80 'convertfont' and then 'bldfamily'
   81 
   82 You should now be in a position to run the emulator
   83 
   84 By default, the emulator requires the disk image called 'DriveA' to be in
   85 the current directory or else it will complain. If you don't like this,
   86 then you can change the file the emulator boots from by altering your
   87 .pcemurc file (see below) or by changing the default at compile time (by
   88 modifying the Makefile)
   89 
   90 Once run, the emulator should come up with the usual MSDOS banner and
   91 request the current date and time (which should already be
   92 correct). You can now run PC programs, mount Unix directories as
   93 drives etc. You will already have one drive redirection - drive C: is
   94 the Unix root directory. To mount further directories as drives, you
   95 must use the program 'lredir'. Consult the file 'lredir.readme' for
   96 instructions...
   97 
   98                         The .pcemurc file
   99 
  100 At present this file allows a few things to be changed at run time. If this
  101 file is found (either in the current directory or in your home directory),
  102 then it is read and parsed and the values overwriting the equivalent
  103 compile time options. Currently the only options supported at present are:
  104 
  105 bootfile diskfile       
  106 
  107 where diskfile is the disk image you want to boot from (no quotes or
  108 anything are needed and the filename must not contain white spaces).
  109 
  110 boottype type
  111 
  112 where type is either 360, 720, 144 or 12. This tells the emulator the type
  113 of disk the disk image file represents (360k, 720k, 1.44MB, 1.2MB
  114 respectively).
  115 
  116 updatespeed n
  117 
  118 where n is an integer > 0
  119 This is the rate at which the screen memory gets checked for changes (and
  120 hence the update speed at which the screen gets updated for non-BIOS
  121 writes). n is measured in internal interrupt ticks of which there are ~72.8
  122 per second (depends on the resolution of the system timer).
  123 
  124 cursorspeed n
  125 
  126 where n is an integer
  127 This specifies how fast the cursor should flash. Flashing the cursor can
  128 take a fair amount of bandwidth and so on slow/heavily loaded networks it
  129 may be best to slow down the cursor flashing. Setting n to 0 or less will
  130 disable cursor flashing - the cursor will be permanently on.
  131 
  132 An example .pcemurc file can be found in this directory.
  133 
  134 If you have problems compiling or running the emulator, then please contact
  135 me giving details of what went wrong (along with your computer type
  136 etc).
  137 
  138 Architectures tested:
  139 
  140 Computer        OS              Comments
  141 -----------------------------------------------------------------------------
  142 PC 486/33       Linux 0.99.14w  Runs quite well. A bit pointless though :)
  143 Sun 3/60        SunOS 4.1.x     Takes an age to compile and not really worth
  144                                 the effort...
  145 SparcStation 10 SunOS 4.1.3     Runs well. Takes > 20MB RAM to compile though
  146 HP 755/99       HPUX            Runs OK (>25MB RAM to compile...)
  147 Sun 4           Solaris 2.3     Runs OK
  148 RS6000          ???             Had a few problems getting it to compile.
  149                                 Getting there slowly though.
  150 SGI Indigo      IRIX 4.?.?      Doesn't work if compiled with optimisation
  151                                 using the standard compiler. Haven't tried
  152                                 it using gcc yet...
  153 
  154 As you can see this list is quite small. The main limiting factor is the range 
  155 of machines I have access to. If anyone else can get it running on other
  156 architectures then please contact me!
  157 
  158 Warning: This program is not secure! Do not make is suid or sgid anything
  159 unless you wish to compromise the security of your system!
  160 
  161 EMULATOR LIMITATIONS etc
  162 
  163 Some parts of the PC architecture are emulated better than others. The
  164 BIOS has been partly implemented - enough to get MSDOS to boot and to
  165 allow most programs to run. Anyhow, most decent programs bypass the
  166 BIOS for screen access. BIOS Disk calls for drive A have been mostly
  167 emulated, although formatting doesn't work.
  168 
  169 Some of the hardware has been emulated but not much. Timer interrupts
  170 are generated by the system but there is now way (at present) to
  171 reprogram the timer. The Programmable Interrupt Controller has been
  172 emulated in part to respond to the End Of Interrupt command and reads
  173 from and writes to the mask register should work OK.
  174 
  175 None of the VGA hardware has been emulated at present (apart from
  176 screen updating) although this will change in the near future. Mode
  177 changes must therefore be done through the BIOS.
  178 
  179 The keyboard has been mostly emulated. The program converts X11
  180 keysyms to raw PC scan codes and then generates an interrupt 9 as per
  181 usual. There is a BIOS routine which takes these scan codes and
  182 generates the correct BIOS ASCII/scan code pair. The keysyms used can
  183 be found in the module 'xstuff.c'. In the future these keysyms will be
  184 read in from a file at run time.
  185 
  186 THANKS
  187 
  188 Thanks go to the following:
  189 
  190 Andy Norman at HPLabs, Bristol (ange@hpl.hewlett-packard.co.uk) for the HP
  191 port.
  192 Dieter Becker (becker@med-in.uni-sb.de) for help with the Solaris port
  193 Klaas Esselink (esselin1@ksla.nl) for help with the RS6000 port
  194 
  195 Please report bugs/comments etc to me (hedley@cs.bris.ac.uk) and I'll
  196 do my best to sort them out (no guarantees though). After June 25th I
  197 will be leaving University and will not be able to check email very
  198 frequently - please be patient if you want a response - I will reply
  199 eventually.
  200 
  201 Have fun...
  202 
  203 David
  204 
  205 
  206