Live data from Hacker News

EMU2: A simple text-mode x86 and DOS emulator

github.com

11–20 of 27 posts

Re: EMU2: A simple text-mode x86 and DOS emulator

#11
post #10

I've been passively writing this (to be clear, an x86 and DOS emulator, not this project) for a while so it's awesome to see someone already write it. My goal was to have a mechanism for bootstrapping a compiler, similar to the Stage0 [0] project, but with a lot more software already written for it and less focus on having it be verifiable. This was to eliminate one more external dependency for building my Linux dist…

I've been working on an original IBM PC emulator too as a hobby: https://github.com/davecom/DK86PC

There's a small community of people doing this that you might find helpful (if you haven't already) at vogons.org in the PC Emulation forum.

Re: EMU2: A simple text-mode x86 and DOS emulator

#12
post #8
post #7

"emulator for the Linux text console" Not portable. Oh, well. Nice idea.

If you read the code [0], the author is using the phrase "Linux text console" to mean the Unix tty interface (/dev/tty, ANSI escape sequences, TIOCGWINSZ ioctl, etc). So it probably is portable to other Unix-like systems such as *BSD, macOS, Cygwin, etc, without much effort. [0] https://github.com/dmsc/emu2/blob/master/src/video.c

I just built and ran it on macOS and it seemed to work fine.

Re: EMU2: A simple text-mode x86 and DOS emulator

#13
post #9
post #6

Earlier quoted context omitted.

I have literally used this emulator to run MASM in this way. I was traveling with an ARM Chromebook and wanted to mess with a retrocomputing project. dosemu was out because my host wasn't x86. dosbox was out because I wanted to run a process with filesystem access, not a whole system. qemu's system emulation has the same problem as dosbox, and qemu's user-mode emulation runs Linux programs, not MS-DOS programs.

In DOSBox you can mount host directories to MS-DOS drives with the "mount" command (and of course you can use Linux bind mounts and mount namespaces along with it).

Agreed. I wanted to script stuff like linking together 200 .OBJs, and running tests' stderr through sed to make it comparable with a known-good log. A DJGPP install + ancient Python inside DOSBox would've also done the job. Or even period-accurate DOS tools, but that'd cross my "is this retrocomputing or masochism?" threshold for this project.

Re: EMU2: A simple text-mode x86 and DOS emulator

#14
post #2

Is this just for a fun or is it actually better than dosemu2, dosbox and qemu in any way?

Suppose you have an ancient program written in MASM (Microsoft Assembler) and you want your Linux Makefile to be able to compile it (I mean run MASM from within the Makefile just as you would run gcc). Which emulator will get you there with the least amount of work?

dosemu does exactly that. It even has a dumb terminal mode for this exact purpose (-t).

Re: EMU2: A simple text-mode x86 and DOS emulator

#16
post #4

I once extracted data out of an old dos-software by controlling it with a script and walking through all possible outputs (this was for train schedules). This was surprisingly difficult. The biggest hurdle is getting the screen contents out of the emulator. Dosbox only gives you screenshots that are pixels. In the end I managed to do it by using dosemu2 inside tmux controlled by python. I wonder whether this could´ve…

You can also have qemu give you a ncurses-style text interface
Post reply on HN