You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This is a simple DOS emulator for the Linux text console, supporting basic DOSsystem calls and console I/O.
Using the emulator
To run a DOS.exe or.com file, simply load it with
emu2 myprog.exe
The emulator accepts some options in the command line and more options asenvironment variables, this allows child process (programs run by your DOSprogram) to inherit the configuration.
Options (should be placedbefore the DOS program name):
-h Shows a brief help.
-b addr Load header-less binary at given address (to load ROMs or test data).
-r <seg>:<ip> Specify a run address to start execution (only for binary loaded data).
The available environment variables are:
EMU2_DEBUG_NAME Base name of a file to write the debug log, defaults tothe exe name if not given.
EMU2_DEBUG List of debug options to activate, from the following:cpu,int,port,dos,video.
EMU2_PROGNAME DOS program name, if not given try to convert the unixname to an equivalent DOS path.
EMU2_DEFAULT_DRIVE DOS default (current) drive letter, if not given useC:
EMU2_CWD DOS current working directory, if not given tries to convertthe current directory to the equivalent DOS path inside theDOS default drive, orC:\ if not possible.
EMU2_DRIVE_n Set unix path as root of driven, by default all drivespoint to the unix working directory.
EMU2_APPEND Sets a list of paths to search for data files on open,emulating the DOSAPPEND command. Only files with arelative path are included in the search, and the searchis relative to the current working directory if no driveletter is specified in the append path.For example, if set to "TXT;C:\IN", when opening thefile "CAT.TXT" the file is searched as "CAT.TXT","TXT\CAT.TXT" and "C:\IN\CAT.TXT" in turn.
EMU2_CODEPAGE Set DOS code-page to the specified string. Set to '?' toshow list of included code-pages, multiple aliasesseparated with commas. Set to a file name to read themapping table from a file with the unicode value foreach byte. You can download mapping tables fromftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/The code-page setting affects keyboard input and screenoutput, but does not change the DOS NLS information.The default code-page is CP437.
EMU2_LOWMEM Limits main memory to 512KB, this fixes some old DOSprograms with a bug that checks available memory using"signed" comparison instructions (JLE instead of JBE).This is needed at least for MASM versions 1.0 and 1.10.
EMU2_ROWS Setups the VGA text mode to the given number of rows,from 12 to 50 at the program start. Some full-screen DOSprograms will retrieve this info and adjust the screenproperly, some other will ignore this and setup the textmode again.
Simple Example
For a simple example, we can run the Turbo Pascal 3, available from the antiquesoftware collection as a filetp302.zip.
The last is necessary as you will want to to modify the program files afterwards.
The main file is named "TURBO.COM", there is also a "README.COM" to read furtherinfo, try that:
$ emu2 README.COM
You can press exit to return to the command line. Now, you can configure the compiler,as the README said, just loadTINST.COM, press "S" (screen type), "0" (default), "N"(screen does not blink) and "Q" to quit.
$ emu2 TINST.COM TURBO Pascal installation menu. Choose installation item from the following:[S]creen type | [C]ommand installation | [M]sg file path | [Q]uit Enter S, C, M or Q: Choose one of the following displays: 0) Default display mode 1) Monochrome display 2) Color display 80x25 3) Color display 40x25 4) b/w display 80x25 5) b/w display 40x25Which display? (Enter no. or ^Q to exit):Does your screen blink when the text scrolls? (Y/N):
Finally, we are ready to run the program:
$ emu2 TURBO.COM----------------------------------------TURBO Pascal system Version 3.02A PC-DOS Copyright (C) 1983,84,85,86 BORLAND Inc.---------------------------------------- Default display mode Include error messages (Y/N)? Logged drive: C Active directory: \ Work file: Main file: Edit Compile Run Save Dir Quit compiler Options Text: 0 bytes Free: 62024 bytes >
Try loading a program, use "e" to edit, type "window.pas", and you are in the editor:
Line 1 Col 1 Insert Indent C:WINDOW.PAS program TestWindow; {$C-} { WINDOW DEMONSTRATION PROGRAM Version 1.00A This program demonstrates the use of windows on the IBM PC and true compatibles. PSEUDO CODE 1. MakeWindow - draws window boxes on the screen 2. repeat UpdateWindow 1 - scrolls the window contents up or down for each window. UpdateWindow 2 UpdateWindow 3 until a key is pressed 3. Reset to full screen window INSTRUCTIONS 1. Compile this program using the TURBO.COM compiler. 2. Type any key to exit the program. }
To exit the editor, type "CONTROL+K" and "D", in the prompt you can now type "R" tocompile and run the program.
Advanced Example
For a more advanced example, we can install and run Turbo Pascal 5.5, available from the sameantique software collection as a filetp55.zip.
First, make a new directory and unzip the file:
$ mkdir tp55$ cd tp55$ unzip ../tp55.zip$ lsDisk1 Disk2
As you see, the program was distributed in two disks, and must be installed before running.
To install, let's first copy all the contents to one directory:
$ mkdir all$ cp -r Disk1/* Disk2/* all/
And now, run the emulator giving the correct paths to simulate a floppy drive:
Type enter, enter again to install from drive "A", again to install on a hard-drive, go downto "Start Installation" and enter again. The install program shows an error, this is becausewe copied all the content to one drive. Simply type "S" to skip all errors.
After the installation is finished, we must run the install again, to copy the missing filesfrom before, with the same command line: