Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
Eternal nothingness is fine if you happen to be dressed for it.
-- Woody Allen
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the Automation List department...
Running a DOS program in XP
Software, including programming, OS issues, etc. topic
Posted by Scot Sutherland on 2 February, 2004 - 12:09 pm
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


Posted by Steve Myres, PE on 2 February, 2004 - 11:40 pm
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.


Posted by lxman on 2 February, 2004 - 11:44 pm
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.


Posted by Steve on 23 February, 2004 - 8:10 pm
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: 8oin4fn02@sneakemail.com

steve


Posted by sam on 18 March, 2004 - 9:27 pm
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


Posted by HEU-Talk21 on 22 March, 2004 - 1:09 pm
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.


Posted by Michael Griffin on 22 March, 2004 - 11:40 pm
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
************************


Posted by Anonymous on 19 March, 2004 - 6:09 pm
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?


Posted by Natalia Dumstorf on 15 February, 2006 - 11:15 am
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


Posted by Michael Griffin on 17 February, 2006 - 11:20 pm
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.


Posted by Robert Scott on 2 February, 2004 - 11:57 pm
Try this:

http://www.direct-io.com

Robert Scott
Real-Time Specialties
Ypsilanti, Michigan
Embedded Systems Consulting


Posted by Richard Mahn on 3 February, 2004 - 1:10 am
I think you only hope is a virtual PC such as http://www.microsoft.com/windowsxp/virtualpc/ running DOS. I've played with a demo of the previous version and was quite suprised how well it worked. I didn't try to run DOS and access serial ports directly, but it wouldn't be very DOSish if it can't.


Posted by Jamie on 3 February, 2004 - 1:05 am
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


Posted by Donald Pittendrigh on 3 February, 2004 - 11:56 am
Try creating a virtual machine with VMWare and loading it with your desired version of DOS.

Regards
Donald P


Posted by Michael Griffin on 3 February, 2004 - 11:53 am
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
************************


Posted by BobB on 3 February, 2004 - 12:03 pm
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.


Posted by Reemul on 4 May, 2004 - 4:55 pm
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

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!