leecher1337 / ntvdmx64

Run Microsoft Windows NTVDM (DOS) on 64bit Editions
804 stars 81 forks source link

ntvdm.exe parameters meaning and how can I change them? #157

Open gorgzilla opened 2 years ago

gorgzilla commented 2 years ago

Hello again,

I'm using a ccpu + minnt build, I installed it on 2 almost identical machines (Win10 x64 Pro), on one machine it's running fine on the other my 16bit app runs very slow and often times I have to kill ntvdm.exe after I closed the program. What I noticed is in the "good" machine ntvm.exe looks like this in the taskmanager: "ntvdm.exe -i8 -ws" on the bad one it's this: "ntvdm.exe -i1 -w"

How can I change those parameters and what do they mean? Thx (sorry for bugging you)

leecher1337 commented 2 years ago

Here is documentation for Commandline switches for your reference:

Switch Meaning
-w VDM for WOW (Win16 apps, not DOS)
-ws VDM for WOW (Win16 apps, not DOS), Separate WOW VDM
-o Disallow Streaming IO
-i Session ID (gets Assigned by loader)

So I guess, Separate WOW VDM is the settings you are searching for. Iirc., default behvaiour can be controller via Registry: http://www.winfaq.de/faq_html/Content/tip0500/onlinefaq.php?h=tip0652.htm Not sure, if this still works, but you may give it a try.

Wow16 support tends to be slow anyway, as the Task Switching that has to be emulated, isn't the fastest, as we unfortunately cannot rely on Windows' own Task Scheduler as with 32bit Windows, as this functionality is not present on 64bit Windows.

If anybody is willing to contribute a better Task switching code than the one I'm using now, I'd be happy to see improved code patches here.

gorgzilla commented 2 years ago

Thank you so much, I couldn't find that for the life of me. This particular 16bit application cranks one core up to 100% since windows XP and onward in certain situations. I tested it in a VM with Windows 98 and the problem doesn't exist there, and it runs way faster. I read that this is some kind of scheduling issue that never got fixed in NTVDM. I did some reading and apparently this is a common problem with many 16bit apps, nobody has a solution for this unfortunately. This 100% cpu load problem seems to be the culprit of why it behaves so differently on every machine and causes NTVDMX64 sometimes to "hang".

leecher1337 commented 2 years ago

WineVDM has a similar scheduler code but a faster emulation, have you tried it with it? It usually can coexist with NTVDMx64 without issues, so you can try it out. WineVDM installed = Win16 runs in WineVDM, DOS runs in NTVDMx64 WineVDM uninstalled = Win16 runs in NTVDMx64 again Some stuff works better with NTVDMx64, some other stuff works better with WineVDM, it's always good to try it out which one best suits your needs :-)

gorgzilla commented 2 years ago

I tried WineVDM at first, it did not work at all unfortunately. With NTVDMX64 the app works, except the hang of NTVDM when the app is closed. I just wrote a little script that kills the NTVDM process after the app is closed.