4 ms·
I still use an older machine to test the Digital Mars C/C++ compiler, as current Windows will no longer run DOS executables. So this is pretty annoying. But as
by WalterBright 5y ago
I still use an older machine to test the Digital Mars C/C++ compiler, as current Windows will no longer run DOS executables.
So this is pretty annoying. But as far as I can tell, FreeDOS does too much, it creates a dos environment in a separate window. What I'd like is:
dosbox app arguments...
where dosbox emulates DOS just enough to run console apps. This would enable me to test the compiler conventionally.
So, what's needed is an 8086 emulator and a minimal DOS emulator. Is there a way to use FreeDOS like that?
- rnd0 5y agoI prefer DOSBox-X to DOSBox because it's easier to run; but it sounds like neither one is what you want. Have you heard of or tried "MS-DOS Player"? It seems to convert binaries into a format that Windows can understand. I think you have to do it on a per-file basis so it might be more of a headache than it's worth; but it's out there! http://takeda-toshiya.my.coocan.jp/msdos/index.html http://takeda-toshiya.my.coocan.jp/msdos/index.html (original site) https://virtuallyfun.com/wordpress/2011/02/11/ms-dos-player-2/ https://virtuallyfun.com/wordpress/2011/02/11/ms-dos-player-... [edit]There's also winevdm which can run 16 bit windows binaries on 64 bit windows. It has DOS support but it's incomplete and it points back to MS-DOS player in it's readme... https://github.com/otya128/winevdm https://github.com/otya128/winevdm
- WalterBright 5y agoThe seem to do far more than can work for my case :-( I wonder how long it would take to write an 8086 emulator and just intercept the file I/O DOS calls. Would anyone else be interested in such a program?
- andrewf 5y agoI've used emu2 to run ancient MASM out of a Makefile. It should work under WSL. (Edit: it doesn't propagate exit codes afaict) https://github.com/dmsc/emu2 https://github.com/dmsc/emu2
- WalterBright 5y agoWell, in order to function in the test suite, the exit codes have to propagate! Arggh!
- andrewf 5y agoI was wrong, I looked at the source and forgot all the CP/M-inherited syscalls are supposed to lack an exit code. The MS-DOS 2 exit-with-return-call method works, and it looks like WSL2 can propagate that from its' Linux VM into Win32-land. C:\Users\andrew\emu2>bash -c "ndisasm x.com" 00000000 B8214C mov ax,0x4c21 00000003 CD21 int 0x21 C:\Users\andrew\emu2>bash -c "./emu2 ./x.com" C:\Users\andrew\emu2>echo %ERRORLEVEL% 33
- WalterBright 5y agoah, good