A neat little MS-DOS emulator
#1
Don't know if anyone other than myself is interested, but TAKEDA, toshiya has a site full of computer emulators, including a really cool, *small* MS-DOS emulator.

It is a single-file emulator which runs DOS EXEs directly, with no need for any subdirectories or configurations.
The download ZIP actually contains many builds, each emulating a different CPU.  32-bit and 64-bit versions are included for each emulator.

It is for Windows only (runs fine on Windows 7 Pro), and runs text-mode DOS programs with no graphics or sound.

It's a command-line program, but you can drag-and-drop an EXE file onto it to run.

I use it to make various DOS compilers and interpreters run under Win.  It even works with SOME multi-file compiler suites, such as Quick C and Small C.  It can be much more handy than firing up DOSBox just to quickly check something in QB or GWB.

It has a command-line switch which allows you to make a single-file Windows executable of your DOS program.

(One problem, though: Some DOS programs (e.g.QBasic) can have trouble finding a file you want to open (even though the file open dialog shows it!), so you must "take the long way" to it by navigating to the directory which holds the file.

http://takeda-toshiya.my.coocan.jp/
(The site is in Japanese with a little English, but it's easy to find one's way around.)


[Image: 2022-07-22-130953.png]

free ssl image hosting
Reply
#2
Very interesting! But how did you start GW Basic, for example? It doesn't work for me.

[Image: MS-DO-Takeda-S2022-07-22.jpg]
Reply
#3
You need to run msdos.exe and pass the name of your DOS executable to it on the command-line: "start msdos.exe GWBASIC.EXE".


The simplest way is to drag GWBASIC.EXE onto msdos.exe using your file browser:


[Image: 2022-07-22-195801-dir-in-FC.png]


OR you can run it from the command prompt:

Each of these directories contains a file called "msdos.exe":

[Image: 2022-07-22-195640-dir-in-PS.png]


The directory name tells you what type of emulator is contained in the directory.  For instance, "i486_x64\msdos.exe" emulates DOS running on a 80486.  The "_x64" means that msdos.exe in that directory is a 64-bit Windows program.

You only need ONE of those msdos.exe files, so choose the msdos.exe version you think will work best and copy it to where ever you need it.

To run GWBasic from the command prompt, type "start msdos.exe gwbasic.exe", and GWBasic will start in its own text window:

[Image: 2022-07-22-200432-started.png]



If you forget the "start" command and type only "msdos.exe gwbasic.exe", then Basic will start in your current command line or PowerShell window.  It should work, but it might look messy depending on your chosen window size:

[Image: 2022-07-22-201249-GWB-in-PS.png]



One more thing I forgot to mention in my last post: this emulator is ONLY for running DOS EXEs directly. It does not provide a COMMAND.COM type of interface the way DOSBox does.

(I hope this is easy enough to follow.  If not, I will try to clarify. I'm not a great explainer or teacher.)
Reply
#4
Thanks for the explanations, it works now. Basically, but for me only two options are shown below. I've tried all the ways to start.

  start ./msdos.exe gwbasic.exe
Screenshot after entering.


[Image: GW-Basic2022-07-23-140305.jpg]
Reply
#5
Hmmm.  There should be an arrow after the word RUN for F2.  Your screenshot shows a question mark, which implies an unknown character.  GWBasic is a fairly simple DOS program.  If that is an English version of GWBasic, perhaps the function key hints do not display properly under German Windows due to differences in the character sets?

The function keys should work.  Does "LIST " appear when you press F1, and does F2 run your Basic program?

Try F3, which should autotype LOAD".


If everything else works, and you know which keys to use, then that line is not so important.

OR... if you are comfortable using a hex editor, you could change the Carriage Return (hex value 0D) after RUN to a space (hex value 20) and see if more of the line appears.


[Image: 2022-07-23-103433-A.png]

(Hmmm #2.  You'll have to click the image to see the whole thing.  The forum image preview is not cooperating....)

(FYI I used Dav's XE binary file editor for this screenshot: https://staging.qb64phoenix.com/showthread.php?tid=152, but any decent hex editor can get the job done.)
Reply
#6
BONUS!

msdos.exe has a command-line option, "-c" which combines msdos.exe and your chosen DOS executable into a single file called "new_exec_file.exe", which will run your DOS EXE as a stand-alone Windows EXE.

To use: type "msdos.exe -c YOURDOSFILE.EXE" (replace YOURDOSFILE.EXE with the name of your DOS executable, say, for instance, GWBASIC.EXE.

Once new_exec_file.exe is created you can rename it to whatever you like, then double-click on it to run it, just as you would for a Windows program.

[Image: 2022-07-22-210619-MSDOS-c-option.png]
Reply
#7
Doesn't help. The keyboard shortcuts all work, F1 through F9.

Maybe it's because I have a German system? Well, it doesn't matter, otherwise everything works like it did in the good old days. Thanks!
I know hex editors. I just downloaded it now. 

HxD - Freeware Hex-Editor und Disk-Editor

I have to look at your addendum again, but now I have to go away for a moment.

[Image: GWBasic-Hex2022-07-23.jpg]
Reply
#8
Strange behavior: I added "msdos.exe" and "gwbasic.exe" to the path.

This works under the command line "cmd", see screenshot. It doesn't work in the Powershell!(?) Perl, GCC and so on works as expected. - See below. Peculiar!

[Image: GWBasic-in-cmd-klappt-es.jpg]

In the Powershell:

[Image: MSDos-Pfad-geht-nicht-23-07.jpg]
Reply
#9
Correction, it works! Of course I did a restart at the time too, but it didn't work. . .
Reply




Users browsing this thread: 3 Guest(s)