Link to home
Start Free TrialLog in
Avatar of Francois_Tremblay
Francois_Tremblay

asked on

How to run an old dos program ( dos4wg ) on a 64 bit OS

Hi!

I have a Windows 2008 64 bits server.  I also have a really old Fortran programs that was build using Watcom and the DOS4WG.exe program.

However, this programs does not work anymore because DOS4WG.exe is a 16 bits applications, and therefore it does not run anymore on that OS.

We tried DOSBOX to validate the problem, and our programs runs fine in that emulator.  However, for our problem, we need to be able to call the programs multiple times from scripts.

So we see two possible solutions...

1) Have a DOS4WG.exe 32 bits version, which I was not able to find so far ( or something similar that I could adapt my code for )
2) Using scripts to automatically launch DOSBOX, mount drives and launch commands

I got the code and it compiles fine with the latest version of Open Watcom Fortran compiler.

Thanks for your advices!
Avatar of John
John
Flag of Canada image

For certain a 16-bit program will not run on a 64-bit machine and there is no way to make it so natively.

So you need to run DOS in some sort of emulator. You chose DOSBOX (fine); I use VMware.  So far, so good.

Now, you say run scripts to launch DOSBOX, mount drives and launch commands. Have you done this? My DOS 6.3 machine talks to 32-bit XP, but does not talk to 64-bit Windows 7. I have not figured out yet (a) will this even work? and then (b) if so how?  I don't think it will work.

I am not certain how to answer your question, but if you have not tested option 2, I don't know how it can work. .... Thinkpads_User
Avatar of Francois_Tremblay
Francois_Tremblay

ASKER

Hi again!

We already have a VM  ( Hyper-V ), but it's exactly where we don't wan to go.  We got a very nice server running fast on Windows Server 2008 with 64 bits application ( mainly Matlab ).  A small part of our engineering process use the legacy code.

We want to run several hundred thousands of run and , sadly, we need the input from the legacy part at each run.  They are meshed together.  

For this reason, a VM is of no help.  We could simply run it on a Windows XP box, but we would not have the power of our 12 cores, higher clocks, etc.

It's why we are looking at a way of running this in the 64 bits environment.  We also have a project to migrate the old code but it's going to take time and we would like to have a nice little workaround for the time being.

SOLUTION
Avatar of John
John
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Darius Ghassem
Darius Ghassem
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here is what we found out.

DOSBOX configuration file contains an [AUTOEXEC] section.  This way, we can mount and run our script in that emulator and it works fine.

We just need to build a small wrapper to launch that DOSBOX process instead of our application directly from Matlab.

We also noticed that this old legacy code was done in Watcom with some Fortran 66 in it.  We will redo the code so that the input/output are not so strongly integrated, no common variables everywhere and do apply some very modern concepts called object oriented programming ( for what can be done in Fortran ).

To give you an idea, the people that worked on that were ph.Ds that retired a long time ago.

At least in the meantime we got something working.