{"id":32968454,"url":"https://github.com/dmsc/emu2","last_synced_at":"2026-01-18T15:09:45.347Z","repository":{"id":19985201,"uuid":"88437791","full_name":"dmsc/emu2","owner":"dmsc","description":"Simple x86 and DOS emulator for the Linux terminal.","archived":false,"fork":false,"pushed_at":"2026-01-02T00:24:16.000Z","size":532,"stargazers_count":441,"open_issues_count":16,"forks_count":33,"subscribers_count":18,"default_branch":"master","last_synced_at":"2026-01-07T11:22:30.220Z","etag":null,"topics":["8086","console","dos","emulator","linux"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmsc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-04-16T19:33:22.000Z","updated_at":"2026-01-03T15:02:38.000Z","dependencies_parsed_at":"2022-07-12T21:40:30.428Z","dependency_job_id":"6a34fba8-f901-4380-bc31-b425f0df429c","html_url":"https://github.com/dmsc/emu2","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dmsc/emu2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsc%2Femu2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsc%2Femu2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsc%2Femu2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsc%2Femu2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmsc","download_url":"https://codeload.github.com/dmsc/emu2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsc%2Femu2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28539053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["8086","console","dos","emulator","linux"],"created_at":"2025-11-13T03:01:38.369Z","updated_at":"2026-01-18T15:09:45.341Z","avatar_url":"https://github.com/dmsc.png","language":"C","readme":"EMU2: A simple text-mode x86 + DOS emulator\n-------------------------------------------\n\nThis is a simple DOS emulator for the Linux text console, supporting basic DOS\nsystem calls and console I/O.\n\nInstallation\n------------\n\n    make\n    sudo make install\n\nThe above installs `emu2` into `$(DESTDIR)${PREFIX}/bin/emu2`, this is\n`/usr/bin/emu2` by default.\n\nUsing the emulator\n------------------\n\nTo run a DOS `.exe` or `.com` file, simply load it with\n\n    emu2 myprog.exe\n\nThe emulator accepts some options in the command line and more options as\nenvironment variables, this allows child process (programs run by your DOS\nprogram) to inherit the configuration.\n\nThe full usage is:\n\n    emu2 [options] \u003cprog.exe\u003e [args...] [-- environment vars]\n\nOptions (should be placed *before* the DOS program name):\n- `-h`        Shows a brief help.\n\n- `-b addr`   Load header-less binary at given address (to load ROMs or test data).\n\n- `-r \u003cseg\u003e:\u003cip\u003e`  Specify a run address to start execution (only for binary loaded data).\n\nThe available environment variables are:\n- `EMU2_DEBUG_NAME`    Base name of a file to write the debug log, defaults to\n                       the exe name if not given.\n\n- `EMU2_DEBUG`         List of debug options to activate, from the following:\n                       `cpu`, `int`, `port`, `dos`, `video`.\n\n- `EMU2_PROGNAME`      DOS program name, if not given try to convert the unix\n                       name to an equivalent DOS path.\n\n- `EMU2_DEFAULT_DRIVE` DOS default (current) drive letter, if not given use `C:`\n\n- `EMU2_CWD`           DOS current working directory, if not given tries to convert\n                       the current directory to the equivalent DOS path inside the\n                       DOS default drive, or `C:\\` if not possible.\n\n- `EMU2_DRIVE_`n       Set unix path as root of drive `n`, by default all drives\n                       point to the unix working directory.\n\n- `EMU2_APPEND`        Sets a list of paths to search for data files on open,\n                       emulating the DOS `APPEND` command. Only files with a\n                       relative path are included in the search, and the search\n                       is relative to the current working directory if no drive\n                       letter is specified in the append path.\n                       For example, if set to \"`TXT;C:\\IN`\", when opening the\n                       file \"`CAT.TXT`\" the file is searched as \"`CAT.TXT`\",\n                       \"`TXT\\CAT.TXT`\" and \"`C:\\IN\\CAT.TXT`\" in turn.\n\n- `EMU2_CODEPAGE`      Set DOS code-page to the specified string. Set to '?' to\n                       show list of included code-pages, multiple aliases\n                       separated with commas.  Set to a file name to read the\n                       mapping table from a file with the unicode value for\n                       each byte.  You can download mapping tables from\n                       ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/\n                       The code-page setting affects keyboard input and screen\n                       output, but does not change the DOS NLS information.\n                       The default code-page is CP437.\n\n- `EMU2_LOWMEM`        Limits main memory to 512KB, this fixes some old DOS\n                       programs with a bug that checks available memory using\n                       \"signed\" comparison instructions (JLE instead of JBE).\n                       This is needed at least for MASM versions 1.0 and 1.10.\n\n- `EMU2_DOSVER`        Changes the reported DOS version, allowing programs that\n                       checks this version to run.  You can specify a major\n                       version or a major dot minor, for example \"3.20\", \"2.11\"\n                       or \"5\".\n\n- `EMU2_ROWS`          Setups the VGA text mode to the given number of rows,\n                       from 12 to 50 at the program start. Some full-screen DOS\n                       programs will retrieve this info and adjust the screen\n                       properly, some other will ignore this and setup the text\n                       mode again.\n\n\nSimple Example\n--------------\n\nFor a simple example, we can run the Turbo Pascal 3, available from the antique\nsoftware collection as a file `tp302.zip`.\n\nFirst, make a new directory and unzip the file:\n\n    $ mkdir tp302\n    $ cd tp302\n    $ unzip ../tp302.zip\n    $ ls\n    ACCESS3.BOX   CALC.PAS      DEMO-BCD.PAS  GRAPH.P     SUBDIR.PAS    TURBO.COM\n    ART.PAS       CMDLINE.PAS   EXTERNAL.DOC  LISTER.PAS  TINST.COM     TURBO.MSG\n    CALCDEMO.MCS  COLOR.PAS     GETDATE.PAS   README      TINST.MSG     TURTLE.PAS\n    CALC.HLP      DEMO1-87.PAS  GETTIME.PAS   README.COM  TURBO-87.COM  WINDOW.PAS\n    CALC.INC      DEMO2-87.PAS  GRAPH.BIN     SOUND.PAS   TURBOBCD.COM\n    $ chmod +w *\n\nThe last is necessary as you will want to to modify the program files afterwards.\n\nThe main file is named \"TURBO.COM\", there is also a \"README.COM\" to read further\ninfo, try that:\n\n    $ emu2 README.COM\n\n![Image of README.COM](doc/readme.com.png)\n\nYou can press exit to return to the command line. Now, you can configure the compiler,\nas the README said, just load `TINST.COM`, press \"S\" (screen type), \"0\" (default), \"N\"\n(screen does not blink) and \"Q\" to quit.\n\n    $ emu2 TINST.COM\n\n                       TURBO Pascal installation menu.\n                 Choose installation item from the following:\n\n    [S]creen type |  [C]ommand installation  |  [M]sg file path  |  [Q]uit\n\n\n                             Enter S, C, M or Q: \n\n    Choose one of the following displays:\n\n      0)  Default display mode\n      1)  Monochrome display\n      2)  Color display 80x25\n      3)  Color display 40x25\n      4)  b/w   display 80x25\n      5)  b/w   display 40x25\n\n    Which display? (Enter no. or ^Q to exit):\n\n    Does your screen blink when the text scrolls? (Y/N):\n\nFinally, we are ready to run the program:\n\n    $ emu2 TURBO.COM\n    ----------------------------------------\n    TURBO Pascal system        Version 3.02A\n                                      PC-DOS\n                                            \n    Copyright (C) 1983,84,85,86 BORLAND Inc.\n    ----------------------------------------\n                                            \n    Default display mode                    \n                                            \n                                            \n                                            \n    Include error messages (Y/N)?           \n\n    Logged drive: C                         \n    Active directory: \\                     \n                                            \n    Work file:                              \n    Main file:                              \n                                            \n    Edit     Compile  Run   Save            \n                                            \n    Dir      Quit  compiler Options         \n                                            \n    Text:     0 bytes                       \n    Free: 62024 bytes                       \n                                            \n    \u003e                                       \n\nTry loading a program, use \"e\" to edit, type \"window.pas\", and you are in the editor:\n\n          Line 1    Col 1   Insert    Indent  C:WINDOW.PAS                          \n    program TestWindow;                                                             \n    {$C-}                                                                           \n    {                                                                               \n                  WINDOW DEMONSTRATION PROGRAM  Version 1.00A                       \n                                                                                    \n           This program demonstrates the use of windows on the IBM PC               \n           and true compatibles.                                                    \n                                                                                    \n           PSEUDO CODE                                                              \n           1.  MakeWindow        - draws window boxes on the screen                 \n           2.  repeat                                                               \n                 UpdateWindow 1  - scrolls the window contents up or                \n                                   down for each window.                            \n                 UpdateWindow 2                                                     \n                 UpdateWindow 3                                                     \n               until a key is pressed                                               \n           3.  Reset to full screen window                                          \n                                                                                    \n           INSTRUCTIONS                                                             \n           1.  Compile this program using the TURBO.COM compiler.                   \n           2.  Type any key to exit the program.                                    \n    }                                                                               \n                                                                                    \n                                                                                    \n\nTo exit the editor, type \"CONTROL+K\" and \"D\", in the prompt you can now type \"R\" to\ncompile and run the program.\n\n![Image of WINDOW.PAS running](doc/window.pas.png)\n\nAdvanced Example\n----------------\n\nFor a more advanced example, we can install and run Turbo Pascal 5.5, available from the same\nantique software collection as a file `tp55.zip`.\n\nFirst, make a new directory and unzip the file:\n\n    $ mkdir tp55\n    $ cd tp55\n    $ unzip ../tp55.zip\n    $ ls\n    Disk1 Disk2\n\nAs you see, the program was distributed in two disks, and must be installed before running.\n\nTo install, let's first copy all the contents to one directory:\n\n    $ mkdir all\n    $ cp -r Disk1/* Disk2/* all/\n\nAnd now, run the emulator giving the correct paths to simulate a floppy drive:\n\n    $ EMU2_DEFAULT_DRIVE=A EMU2_DRIVE_A=all emu2 all/INSTALL.EXE\n\n![Image of TP55 INSTALL.EXE](doc/tp55.inst-1.png)\n\nType enter, enter again to install from drive \"A\", again to install on a hard-drive, go down\nto \"Start Installation\" and enter again. The install program shows an error, this is because\nwe copied all the content to one drive. Simply type \"S\" to skip all errors.\n\nAfter the installation is finished, we must run the install again, to copy the missing files\nfrom before, with the same command line:\n\n    $ EMU2_DEFAULT_DRIVE=A EMU2_DRIVE_A=all emu2 all/INSTALL.EXE\n\n![Image of TP55 INSTALL.EXE at the end](doc/tp55.inst-2.png)\n\nAgain, press enter to the questions and go to \"Start Installation\", this time will complete\nwithout errors.\n\nYou can now compile from the command line, as:\n\n    $ emu2 tp/tpc.exe -- 'PATH=C:\\TP'\n    Turbo Pascal Version 5.5  Copyright (c) 1983,89 Borland International\n    Syntax: TPC [options] filename [options]\n    /B\tBuild all units\t\t/$A-\tNo word alignment\n    /Dxxx\tDefine conditionals\t/$B+\tComplete boolean evaluation\n    /Exxx\tEXE \u0026 TPU directory\t/$D-\tNo debug information\n    /Fxxx\tFind run-time error\t/$E-\tNo 8087 emulation\n    /GS\tMap file with segments\t/$F+\tForce FAR calls\n    /GP\tMap file with publics\t/$I-\tNo I/O checking\n    /GD\tDetailed map file\t/$L-\tNo local debug symbols\n    /Ixxx\tInclude directories\t/$Mxxx\tMemory allocation parameters\n    /L\tLink buffer on disk\t/$N+\t8087 code generation\n    /M\tMake modified units\t/$O+\tOverlays allowed\n    /Oxxx\tObject directories\t/$R+\tRange checking\n    /Q\tQuiet compile\t\t/$S-\tNo stack checking\n    /Txxx\tTurbo directories\t/$V-\tNo var-string checking\n    /Uxxx\tUnit directories\n    /V\tEXE debug information\n\n    $ emu2 tp/tpc.exe tp\\\\qsort.pas -- 'PATH=C:\\TP'\n    Turbo Pascal Version 5.5  Copyright (c) 1983,89 Borland International\n    TP\\QSORT.PAS(66)\n    66 lines, 4384 bytes code, 2668 bytes data.\n\n    $ emu2 tp/qsort.exe\n    ....\n\nAnd for the IDE, you can use:\n\n    emu2 tp/turbo.exe  -- 'PATH=C:\\TP'\n\n![Image of TP55 environment](doc/tp55.turbo.png)\n\n","funding_links":[],"categories":["Table of Contents","\u003ca name=\"vm\"\u003e\u003c/a\u003eContainerization and virtualization"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmsc%2Femu2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmsc%2Femu2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmsc%2Femu2/lists"}