Running a DOS program in XP

  • Thread starter Scot Sutherland
  • Start date
S

Thread Starter

Scot Sutherland

I have an old DOS program that I need to use on a new PC that is preloaded with XP. The program reads/writes to a serial port, but communications fail (as predicted) in XP.

Does anyone know of a utility or shell command(s) that will allow this program to work?

Thanks in advance,
Scot Sutherland
 
S

Steve Myres, PE

Is your program small enough to fit on a floppy, expecially with DOS system files? If so, create a DOS boot disk and run the program from floppy. You could install the program on the hard disk and still boot from floppy, except that most versions of DOS will not recognize the partition sizes common with today's large hard drives. If you want to invest that much effort, you could create a HD partition just so you can use part of the drive under DOS. You will also need to make sure that the partition is formatted with a file system understood by your DOS version.
 
Try bochs @ http://bochs.sourceforge.net/

It carries a GNU license, so it's basically free. It is an x86 emulator which will run dos. I am currently using it with APX.EXE, the old Automate programming software, which also communicates via serial (and won't work under 2000), and it works with it.

Only downside is, it takes a little computer know-how to set it up.
 
You can find DOS emulators on the Net. Just look it up on Google or Yahoo. There are quite a few out there. I am sure you can find on ethat suits your application...

Jamie
 
M

Michael Griffin

If you are feeling adventurous, you could try Bochs. This is completely free.
http://bochs.sourceforge.net/

I haven't experimented with it yet, so I can't make a recommendation. It is an IA86 emulator and includes emulation of the serial port, which can be a real serial port. That is, the emulated port can be associated with the actual serial port in your PC.

The main development work for Bochs is for using Linux as the host OS, but there are Windows and Mac versions as well. One of their screen shots shows DOS running inside Bochs which is in turn running on Windows 2000, which is
similar to what you want to do.

If you get this to work, you may still have a problem if your serial protocol is very sensitive to timing. Any sort of emulation by a multi-tasking host OS is going to introduce timing irregularities. In this case there is probably no substitute for real DOS (or Windows 98) in a dual boot set-up.

--

************************
Michael Griffin
London, Ont. Canada
************************
 
D

Donald Pittendrigh

Try creating a virtual machine with VMWare and loading it with your desired version of DOS.

Regards
Donald P
 
I have many DOS programs running on XP. Not all my old programs, but many. For example, GE Logicmaster 90 and Mitsubishi Medoc run fine.

My serial port is a USB to RS232 converter. These things typically install as Com 4 and above. Go in to device manager and make it Com 1 or 2. Most DOS software is happy with these. Also disable your internal modem.

Then proceed to your program and set it to run in Windows 98 compatible mode. You can also fiddle around with font sizes, full screen mode etc etc to get the program to look how you want it.
 
I am trying this, and have enough "know-how" to have gotten bochs running happily with DOS 6.22.

Can you send me the changes you made to the bochsrc.txt file to get the com port to work? I get no communication with the port at all.

I know the port is working because I can still access it from a command line in w2k...

Many thanks. Feel free to rely to this list or just reply to me at: [email protected]

steve
 
I have not succeeded in setting up bochs 2.11. I need to run some MS-DOS 6.22 programmes under Windows xp and make them communicate through the serial port. First, how do you create a virtual disk and then istall ms-dos 6.22 on it? What setting do you use for the serial port?

Thank you
Sam
 
I don't manage to make old DOS software communicate through the serial port to machinery such as automate. What configuration line did you put into bochsrc.txt file to make com1 communicate?
 
You need an utility for creating disk images like this one http://www.assysm.com/winimage/winima61.exe). With this basically you create the image, select a set of files ( system files and utilities in MSDOS case) and insert them. It will create a zipped image which you'll have to unzip in order to make it useable. Bochs have a site with some OS's images (obviously msdos is not there but freedos is, which I've started using since MSDOS became harder to find through the usual channels ). Once you have the image you need to configure bochs to boot from a floppy. It's configured either using the text mode menu or by editing the file bochsrc.txt. here's an example of the commands

megs: 8
romimage: file=BIOS-bochs-latest, address=0xf0000
vgaromimage: VGABIOS-lgpl-latest
boot: floppy
floppya: 1_44=f:\cd1\freedos\fdb8_144.dsk, status=inserted
floppyb: 1_44=f:cific.imz status=inserted
then you can create a "hard disk" drive using the bximage utility that comes with bochs. You have to define the desired hard disk size and it will tell you the designated geometry and create the image.

example of a 5 MB hard disk

ata0-master: type=disk, path="c.img", mode=flat, cylinders=10, heads=16, spt=63

then you reboot bochs (or configure it on the fly using the graphical interface (read it buttons on top of the screen)), proceed to partition the "hard disk" using the fdisk utility that comes with msdos, format the disk and transfer the system files onto it. Finally you need to tell bochs to boot from the "hard disk" by changing the boot: option in the file bochsrc.txt to hard disk.

Anyways i think that unless you need COM1 you will have to recompile bochs because it comes with that options hard coded. I didnt reach that stage because bochs failed to execute a DOS application using borlands BGI.

I guess that we want (wanted in my case) to do similar things..i tried everything on XP (yuk) to make a DOS program using the serial port work but everything failed miserably, even those programs that promised the thick and the thin. Our program re-vectors the serial port interrupt handler to our own handler and will control the UART registers directly. It's connected to an instrument that will transmit a set of values (a 20 chars string) with intervals of about 20 mS. Needless to say that the program has been working alright on W9X but i could never get it to work on XP..I tried directio (a commercial product that would supposedly work but then the fine print says that it cannot guarantee that the interrupts will be served right on time and that you could end up losing events..and that is exactly what happens)..allowio led to similar results..actually it worked better (its a freware product if i recall correctly)..we were able to receive something but it would miss lots of characters making it unusable. I tried making very basic dos terminal programs and communicate the XP pc with another pc and it wouldnt work reliably... solution..make that computer a dual boot computer and install W98 too or get a windows native application.

Regards, H.E.V MetroStar S.R.L.
 
M

Michael Griffin

I think the serial port works properly on every OS except Windows. Dig around in the documentation, and you'll see they mention this (serial ports are difficult to do properly under Windows). I used Bochs to get some difficult DOS software to run on a computer that has Windows XP, but I didn't need the serial port for it.

You can download a disk image with FreeDOS already set up from the same place you get Bochs. I found this worked just as well as MS-DOS for what I needed.

--

************************
Michael Griffin
London, Ont. Canada
************************
 
I've successfully used a program called Tame Dos. I run the program in a batch file, calling tame before the dos program is called. Allows my terminal emulator program to work.

Regards

Reemul
 
N

Natalia Dumstorf

I'll try Bochs, but I really don't know how to set up parameters. I need to use APX.EXE program under XP machine. Please help with instructions how to do it.

Thanks a lot,

Natalia
502.634.8833.ext.220
 
M

Michael Griffin

I've used Bochs to get a DOS program to run on MS-Windows XP. However, at the time, the serial port didn't work when hosted on MS-Windows (it worked when hosted on all other operating system though). I don't see any signs that this has changed since then. Supposedly the reason for this was that serial communications is quite difficult with MS-Windows.

I found Bochs relatively easy to set up. If you are running a DOS program, you will need DOS (Bochs "just" emulates the hardware). I used FreeDOS without any problems.
 
Run on similar issue with a DOS point of sale application. After trying some other sw we tested n commercial solution called COMM Extender (ADONTEC). Perfect! No complicated configuration needed and succeeded out of the box.
 
Top