Comm port issue.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
cybercat
Posts: 5
Joined: 30. Sep 2017, 18:20

Comm port issue.

Post by cybercat »

I have a fedora 24 OS installed and with all EOL updates. I have installed VirtualBox Ver 5.1.26 and it appears to be working fine. I have a very old (16 Bit) app which will not run on the new Win 7 and up. It is a Micro Computer control program which works well on a dedicated Win2k machine that I want to get rid of. I created a Win2k VM and it generally works as expected. I can run many of the typical programs (editors, basic compiler, etc). When I run my control program (under the VM) all appears to run but it uses COMM1 and it does not appear to run like it does when run directly from my native Win2k machine. I have setup 'device serial port' under the Win2k VM to use 'host device'. This should, in theory, pass through the /dev/ttyS0 device on Linux and be able to communicate with attached hardware as a Win2k OS would. I look in the Win2k (VM version) devices section and it says that it is 'working property' and has the drivers etc shown as OK. The issue is that the Hardware does not respond in the way that it does when running from the Hardware Based machine. Can someone assist me in determining what is wrong?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Comm port issue.

Post by mpack »

cybercat wrote:I have a very old (16 Bit) app which will not run on the new Win 7 and up.
Actually it will, if you install a 32bit version of the host OS and enable NTVDM in "Optional Features". Even Win10-32bit has this. This is far preferable IMHO to asking a VM to control anything physical.

What OS does the 16bit app require? I.e. is it a DOS app, or is it Win3.x?
cybercat
Posts: 5
Joined: 30. Sep 2017, 18:20

Re: Comm port issue.

Post by cybercat »

Thanks. I have used both Win2k and WinXP on Physical Hardware to carry out this process so far. The program is a compiled 16 EXE and runs well on Win2k and WinXP Physical Machines, but will not run on Win7 and up, whether Win7 is a 32 bit version or 64 bit Version. Windows has 'cut off' allowing the use of old 16 bit software as of Vista/Win7; or al least that has been my experience. So you are saying that if one invokes NTVDM in any of the newer OSes from Windows that one can continue to run 16 Bit apps, do I understand that is what you are saying?
If that is true (which I do not doubt), does the NTVDM interfere in any way with the other 32 Bit and 64 Bit programs? This may be the answer to my problem. Where do I find this Optional Features thing? And thank you again for your assistance.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Comm port issue.

Post by socratis »

I don't know how you enable NTVDM, I tried it on my Win7 VM but apparently I don't have any 16-bit applications. But I did find the following from Microsoft that you may find useful: Optimize How Windows 7 Runs 16-Bit and MS-DOS-Based Programs.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Comm port issue.

Post by mpack »

socratis wrote:I don't know how you enable NTVDM
On Windows 10? Like I said, it needs to be a 32bit OS, then run "OptionalFeatures.exe", open the "Legacy Components" branch, check "NTVDM".

I migrated directly from XP to Win10, I had Win7 at work but that was 64bit. So I don't know for sure how to do it on Win7-32bit, but I was under the impression that NTVDM was part of the default Win32 install until Win8.x, so you should't need to do anything except install Win7-32bit.

Hmm. And I don't seem to have a Win7-32bit VM either. Actually, it strikes me that one of the retired PCs in my office ran Win7-32bit. I have a couple of 16bit apps I can try - I'll report later.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Comm port issue.

Post by mpack »

cybercat wrote:The program is a compiled 16 EXE and runs well on Win2k and WinXP Physical Machines
That doesn't really answer my question. DOS and Win3 both used 16 bit exe files, and both run on 32bit Windows hosts. Is the app designed for DOS text, or is it using the Windows GUI? I can't offer a complete list of viable alternatives until I know what the app requires.
cybercat wrote:Windows has 'cut off' allowing the use of old 16 bit software as of Vista/Win7; or al least that has been my experience.
No, that is based on an urban myth. A misunderstanding that keeps getting passed around. 32bit windows have a fallback to 16bit. 64bit Windows fall back to 32bits, not 16bit. This behaviour of 64bit Windows did not begin with Win7 (i.e. the same was true in XP-64bit), it's just that the Win7 era was when people like you started migrating to 64bit, so that's when it started being noticed.
cybercat wrote:if one invokes NTVDM in any of the newer OSes from Windows that one can continue to run 16 Bit apps, ...
does the NTVDM interfere in any way with the other 32 Bit and 64 Bit programs? This may be the answer to my problem.
As I said, the NTVDM feature is only available for 32bit versions of Windows hosts. Hence you would be unable to run 64bit apps on the same host.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Comm port issue.

Post by mpack »

mpack wrote: Hmm. And I don't seem to have a Win7-32bit VM either. Actually, it strikes me that one of the retired PCs in my office ran Win7-32bit. I have a couple of 16bit apps I can try - I'll report later.
I tested it on my office PC and sure enough, a Win7-32bit PC runs 16bit apps right out of the box. No need to enable any optional features.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Comm port issue.

Post by socratis »

Hey, thanks for the info. Not that I use that feature, but more just out of curiosity. I have a Win98 machine (bare minimum) and I tried to run some programs in Win7-32, but either they were crashing (most of them due to DLL entry points, expected), not running (I tried Command.com just for kicks ;) ), or running just fine (Notepad), so I guess that also supports your point, right?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
cybercat
Posts: 5
Joined: 30. Sep 2017, 18:20

Re: Comm port issue.

Post by cybercat »

socratis wrote:I don't know how you enable NTVDM, I tried it on my Win7 VM but apparently I don't have any 16-bit applications. But I did find the following from Microsoft that you may find useful: Optimize How Windows 7 Runs 16-Bit and MS-DOS-Based Programs.
I was unable to get a working copy of NTVDM. It appears that it has been relegated to the dustbin by Microsoft and is not active as far as I can discover. I really want to explore the VirtualBox approach as it is currently supported and fairly up to date.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Comm port issue.

Post by socratis »

Did you read mpack's comment?
mpack wrote:I tested it on my office PC and sure enough, a Win7-32bit PC runs 16bit apps right out of the box. No need to enable any optional features.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Comm port issue.

Post by mpack »

cybercat wrote: I was unable to get a working copy of NTVDM. It appears that it has been relegated to the dustbin by Microsoft and is not active as far as I can discover.
Do you understand what I mean when I said that the NTVDM feature only exists on 32bit versions of Windows? Please show some indication that you understand what this means, otherwise I suspect we're doomed to repeat the same few phrases forever.

If you do understand what it means then you should know that you don't need to look for NTVDM. The feature is built in up to Win7, and is only a click away in later Windows versions.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Comm port issue.

Post by mpack »

socratis wrote:I have a Win98 machine (bare minimum) and I tried to run some programs in Win7-32, but either they were crashing (most of them due to DLL entry points, expected), not running (I tried Command.com just for kicks ;) ), or running just fine (Notepad), so I guess that also supports your point, right?
Crashing due to DLL entry points, or erroring out due to not finding some DLL? I would not expect the former, but I had the latter too, and all you have to do is find the relevant DLL and put it in the same folder as the main app executable. Plus the fact that Windows even tried to execute the program proves that recognizes 16bit exes.

AFAIK, Command.com should run. The Win98 version of the command prompt, which it calls the MS-DOS prompt, is indeed just the DOS7 COMMAND.COM running inside an NTVDM process. Of course in all versions of DOS, command.com does a version check and will only run on the DOS version it was designed for.

Notepad was a straight up Win16 GUI app using only standard system DLLs (user, gdi etc), so it doesn't surprise me that it works fine.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Comm port issue.

Post by socratis »

mpack wrote:Crashing due to DLL entry points, or erroring out due to not finding some DLL?
Correct in both cases in your analysis. There were some process entry points that could not be found (usually in Kernel32.dll), but for not finding the DLLs, it worked if I put them in the same directory. Command.com doesn't run, but it may be because of the version check as you said. Even DxDiag.exe run (with some complaints about entry points), but it run nonetheless. Impressive.

Anyway I had enough fun with this ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
cybercat
Posts: 5
Joined: 30. Sep 2017, 18:20

Re: Comm port issue.

Post by cybercat »

mpack wrote:
cybercat wrote: I was unable to get a working copy of NTVDM. It appears that it has been relegated to the dustbin by Microsoft and is not active as far as I can discover.
Do you understand what I mean when I said that the NTVDM feature only exists on 32bit versions of Windows? Please show some indication that you understand what this means, otherwise I suspect we're doomed to repeat the same few phrases forever.

If you do understand what it means then you should know that you don't need to look for NTVDM. The feature is built in up to Win7, and is only a click away in later Windows versions.
Sorry for the delay in addressing your last point. I do not have any 32 bit Win7 or later OS media. Since it is unavailable for 64 bit systems I cannot try this 'click away' approach. I do understand the differences between the two versions 32 and 64 bit, yes!
Post Reply