News for hackers. Stuff that matters.
Re:Wine on Windows 10 by codetrotter on Wednesday August 07, 2019 @06:09AM (#20633319)
Looking at the install.inf file, I saw that they first remove a key from the registry with the name VDM in it. So I wondered what VDM means.

> Virtual DOS machines (VDM) refer to a technology that allows running 16-bit/32-bit DOS and 16-bit Windows programs when there is already another operating system running and controlling the hardware.

https://en.wikipedia.org/wiki/Virtual_DOS_machine

So how come otvdm is needed I wondered.

Same Wikipedia article explains it.

> NTVDM is a system component of all IA-32 editions of the Windows NT family since 1993 which allows execution of 16-bit Windows and 16-bit / 32-bit DOS applications. It is not included with 64-bit versions. The Windows NT 32-bit user-mode executable which forms the basis for a single DOS (or Windows 3.x) environment is called ntvdm.exe.

But why did Microsoft not include VDM in 64-bit systems? I thought MS was all about that backwards compatibility.

Re:Wine on Windows 10 by Crinus on Wednesday August 07, 2019 @08:10AM (#20633920)
AFAIK including the full VDM wasn't technically possible due to amd64 architecture limitations (no real mode support when in long mode - at least not without use of virtualization but that wasn't a thing at the time). They probably could have implemented partial support but i guess they wanted to keep the full VDM for 32bit versions of Windows (which were the majority for a good number of years anyway and thus more important for backwards compatibility).

OTVDM emulates a 386-ish CPU so it isn't affected by that (i think there is also some code to use virtualization instead but i'm not sure). It is much slower though, but it should still be much faster than the target hardware that 16bit Windows applications had. Perhaps it might be an interesting project to port DOSBox' more advanced JIT CPU emulation code to this.

Re:Wine on Windows 10 by makomk on Wednesday August 07, 2019 @06:23AM (#20633387)
Virtual 8086 mode isn't available when running a 64-bit OS, so the virtual DOS machine code simply won't work there. This is less of a problem with most 16-bit Windows applications since the limited 16-bit functionality they need is still possible under a 64-bit OS but making this work requires some extremely hairy kernel code.
Re:Wine on Windows 10 by monocasa on Wednesday August 07, 2019 @01:26PM (#20636855)
You could just run it in an emulator. And microsoft has written a virtual 8086 emulator for virtual PC. Virtual 8086 mode was just a virtual machine anyway.
Re:Wine on Windows 10 by skissane on Wednesday August 07, 2019 @07:29PM (#20640319)
NTVDM used to contain an x86 emulator included for running DOS programs under Windows NT on non-x86 platforms (Alpha, MIPS, PowerPC). There is no reason in principle why they couldn't have used that existing code on x86-64. But, I assume they decided that the cost of doing that (in developer time/etc) wasn't worth the benefit. (Running DOS programs has little commercial relevance any more, and the small minority who still have a need for that are better served by more fully-fledged virtualisation solutions such as Hyper-V, VMware or VirtualBox.)
Re:Wine on Windows 10 by jeroenhd on Wednesday August 07, 2019 @06:14AM (#20633339)
MS is already running a similar system to translate 32-bit applications to 64-bit mode (WOW64). Keeping compatibility with 16-bit would have big consequences for the NTVDM. The alternative would be to run NTVDM on top of WOW64 but such a system would be a recipe for disaster.

I don't think the compatibility with 16-bit systems is worth the headache/expense. As long as 32-bit Windows exists, you can still run the few relevant and compatible DOS applications so I doubt anyone is missing much aside from a few nostalgic gamers.

Re:Wine on Windows 10 by dsfyu404ed on Wednesday August 07, 2019 @09:02AM (#20634266)
>I doubt anyone is missing much aside from a few nostalgic gamers.

There's tons of 16-bit SCADA stuff in the world that it would be nice to not have to run on a ~20yo version of windows.

Re:Wine on Windows 10 by jeroenhd on Wednesday August 07, 2019 @09:43AM (#20634603)
I hope those scada systems aren't running on regular Windows. If they are, they should be running on Win10 LTSB on 32-bit so they should keep working till at least 2025 if XP's level of compatibility was good enough to run them.

If they can't be run on that, there's still MS-DOS licenses being sold and FreeDOS might also serve them in a pinch. If a system is not maintained for long enough that it's still running in compatibility mode, you might ask well just disconnect the network cable and run Windows 3.11/95/98. Microsoft is not at fault for the manufacturer not maintaining their systems.

Re:Wine on Windows 10 by monocasa on Wednesday August 07, 2019 @01:27PM (#20636871)
What if the manufacturer doesn't exist anymore?
Re:Wine on Windows 10 by jeroenhd on Wednesday August 07, 2019 @02:29PM (#20637456)
In that case you either were aware of the risk of your device breaking down in the future and have started looking into migrations or workarounds the moment the news hit, you took the risk that didn't happen and now have to deal with the consequences or you just didn't plan ahead enough.

Just keep running the older version of Windows that worked with the device. Add a couple of layers of configurations, firewalls, VPNs, traffic monitoring and whatnot inbetween to reduce the risk and don't connect the device to the internet. Your solar panel farm doesn't need to access Gmail or run Windows 10.

Your obscure SCADA device is your responsibility. The switchover to 32bit had been announced 20 years ago and the switchover to 64bit 10 years ago.

Also, if the manufacturer doesn't exist anymore, where are you going to source replacement parts?

Re:Wine on Windows 10 by dsfyu404ed on Wednesday August 07, 2019 @01:46PM (#20637018)
Or you're using hardware from the 70s that they dropped from software support in the 90s and the software version you need won't run on anything newer than Win2k.
Re:Wine on Windows 10 by ygra on Wednesday August 07, 2019 @09:20AM (#20634422)
Aren't there still 32-bit versions of Windows 10? AFAIR only the server versions are 64-bit only by now.
Re:Wine on Windows 10 by kevin_thibedeau on Wednesday August 07, 2019 @01:45PM (#20637005)
Installing 32-bit OS on a 64-bit UEFI system can be a problem.