NTVDM on windows 10 x64

Emulation of old PCs, PC hardware, or PC peripherals.

NTVDM on windows 10 x64

Postby leecher » 2016-6-08 @ 14:42

I just wanted to announce that I managed to compile and patch Microsoft Windows NTVDM on 64bit Windows and it seems to work at least for realmode applications and even supports console graphics.
This might become handy for users that want to benefit from the good console and shell integration of NTVDM compared to DosBox (i.e. run 32bit console programs from DOS-applications).
In case you are interested, take a look at https://github.com/leecher1337/ntvdmx64
Maybe some of you are interested to further improve the port (i.e. the DPMI stuff still needs some work).

Regards
leecher
Newbie
 
Posts: 7
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby Jorpho » 2016-6-08 @ 15:09

I guess that's kind of neat, but its reliance on stolen code might make it of dubious utility and I doubt Microsoft will be persuaded to included it in future versions (especially since "the DPMI stuff still needs some work"). Why exactly doesn't this work on Windows 7 or 8? And does it run 16-bit Windows programs?
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: NTVDM on windows 10 x64

Postby leecher » 2016-6-08 @ 15:23

Yeah, it's just a proof-of-concept, that's why I just published patches and nothing more to ensure that there are no legal problems with the release itself.
I guess that the DPMI stuff is fixable, it was just too frustrating to debug without yoda.

It works on Windows 10 because I tested it there and some API calls and internal structs used in the loader code may be a bit different there, but it wouldn't be too hard to port, I guess, I just didn't know if it is necessary to port it to older Windows versions.
No WOW-Support for 16bit Windows, that would be too much work for a simple PoC.
leecher
Newbie
 
Posts: 7
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby collector » 2016-6-08 @ 19:57

Very interesting. Too bad about WOW, but understand about too much work. Certainly would be nice for those 16-bit installers.
User avatar
collector
l33t
 
Posts: 4056
Joined: 2003-1-15 @ 10:39

Re: NTVDM on windows 10 x64

Postby Azarien » 2016-6-21 @ 19:42

More specifically, it's a set of patches to the sourcecode of original Microsoft NTVDM from NT4 in order to work on 64bit Windows.

This is a serious problem. Eventually, all of Microsoft's code would have to be rewritten from scratch.
Azarien
Member
 
Posts: 423
Joined: 2015-5-14 @ 07:14

Re: NTVDM on windows 10 x64

Postby Stiletto » 2016-6-21 @ 22:41

Azarien wrote:
More specifically, it's a set of patches to the sourcecode of original Microsoft NTVDM from NT4 in order to work on 64bit Windows.

This is a serious problem. Eventually, all of Microsoft's code would have to be rewritten from scratch.


eh? I'm not sure you understand this thread. How is the inability for compiled illegal leaked Windows NT4 sourcecode to work in 64bit Windows a serious problem?
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 3900
Joined: 2002-7-01 @ 21:57

Re: NTVDM on windows 10 x64

Postby Azarien » 2016-6-25 @ 14:33

Stiletto wrote:eh? I'm not sure you understand this thread. How is the inability for compiled illegal leaked Windows NT4 sourcecode to work in 64bit Windows a serious problem?


As I understand, he is trying to reuse leaked and modified NT4 code on Windows 10. This is asking for legal problems, and if this project is going anywhere it should focus solely on writing new code.
Azarien
Member
 
Posts: 423
Joined: 2015-5-14 @ 07:14

Re: NTVDM on windows 10 x64

Postby Stiletto » 2016-6-25 @ 15:27

Azarien wrote:
Stiletto wrote:eh? I'm not sure you understand this thread. How is the inability for compiled illegal leaked Windows NT4 sourcecode to work in 64bit Windows a serious problem?


As I understand, he is trying to reuse leaked and modified NT4 code on Windows 10. This is asking for legal problems, and if this project is going anywhere it should focus solely on writing new code.


oh, hah, I misunderstood you. Quite amazingly, too. My bad.

Well... he's not distributing compiled binaries and the sourcecode he's released is just a patch upon the illegal source, so it's about as legal as it can get in this situation. Still, I largely agree with you. It's a neat hack, but also troubling.
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 3900
Joined: 2002-7-01 @ 21:57

Re: NTVDM on windows 10 x64

Postby leecher » 2018-1-14 @ 00:33

I now managed to get it working on Windows 7.
Additionally I wanted to work on WOW16, I got it so far that i can convert 16bit to 32bit calls, but unfortunately the 16bit appliations crash randomly mustly during startup. As there is no reproducable pattern behind it, this is pretty hard to debug. Maybe a bug with memory management, der LDT or even the CCPU?
Is there any experienced programmer willing to help me with this?
leecher
Newbie
 
Posts: 7
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby filipetolhuizen » 2018-1-21 @ 13:45

leecher wrote:I now managed to get it working on Windows 7.
Additionally I wanted to work on WOW16, I got it so far that i can convert 16bit to 32bit calls, but unfortunately the 16bit appliations crash randomly mustly during startup. As there is no reproducable pattern behind it, this is pretty hard to debug. Maybe a bug with memory management, der LDT or even the CCPU?
Is there any experienced programmer willing to help me with this?

Well, I don't know if it helps, but I'd be happy to test it. And congrats for your breakthrough.
User avatar
filipetolhuizen
Oldbie
 
Posts: 1117
Joined: 2006-10-24 @ 02:25
Location: Curitiba, Brazil

Re: NTVDM on windows 10 x64

Postby leecher » 2018-1-22 @ 20:51

Hi,
If you are interested in the DOS-part, you can download it from the project page. emendelson also made a build publically availabe in the issue tracker issue #7.
For WOW16, this implements a cooperative multitasking scheduler, but the scheduling doesn't take place in NTVDM, but is issued to the kernel scheduler, i.e. by invoking NtYieldExecution() syscall. Now I think the problem is that NTVDM on x64 in turn already runs in WOW32 and therefore it may be incapable of doing the scheduling of a WOW16 process (WOW32 i.e. also usees the WOW-Structure offset in the TEB for its stuff already so that I have to use another TLS-Pointer for Wow16 stuff).
So I guess there is no scheduling taking part leading the CCPU to concurrently execute 2 threads at the same time causing random crashes. The interaction with the scheduler is not so easy to understand, I'm not sure if cooperative scheduling on the CCPU would be possible without relying on the mechanisms of the kernel task scheduler...
Did someone take a look at this how it works?
leecher
Newbie
 
Posts: 7
Joined: 2010-11-07 @ 17:10
Location: Vienna


Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 2 guests