[COLUG] Dosbox serial ports

Dave Maxwell dmaxwell at columbus.rr.com
Tue Dec 4 13:42:06 EST 2007


On Tue December 4 2007, charles morrison wrote:
> I have a few programs which I wish to run under Linux which are written
> in Quick Basic. The program of interest loads, starts, and runs under
> Dosbox. Unfortunately, it uses the serial port. Also, unfortunately,
> laptops come with USB ports.
>
> There are patches available for Dosbox for serial port drivers, but I
> have found nothing for a USB serial port.

Linux makes very little distinction between how a serial port is connected 
once it has become a TTY.  Unlike DOS and to a lesser extent Windows, Linux 
isn't encumbered with expecting to find serial ports at particular ports and 
IRQs.  Apps that use serial ports really aren't allowed to see or diddle such 
low level resources.  It usually suffices to simply specify the 
correct /dev/tty(xx) device in the appropriate config file. The same may be 
true of those DOSBox patches.

> My thinking is to redirect Dosbox I/O using a pipe command or
> redirecting I/O. So far, I have been unsuccessful at figuring out how to
> do it, since the O part requires going from a Dos Com1 to a Linux
> /dev/ttyUSBx using a dos command, and the I part requires taking input
> from a Linux /dev/ttyUSBx and redirect to a Dos Com1.
You may have luck with something like:

directserial=true
comport=1
realport=ttyUSB1 (or whatever devicename the usb device has)
defaultbps=9600
parity=N
bytesize=8
stopbit=1 

in the DOSBox conf file.

> Any ideas would be appreciated.

You might also get away with symlinking ttyS1 or 2 to the USB device and 
telling DOSBox to use that.

> Here are answers to unasked questions:  No, I'm not buying an old
> laptop. No, I can't carry a desktop where ever I go into a customer's
> plant. No, I don't want to use windows. No, it doesn't work under WINE,
> either. Yes, I have put renaming into the Dos partition for WINE and in
> the USB drivers to recognize the USB to serial adapter and rename it as
> Com1. Gambas only compiles Visual Basic programs, not Quick Basic (so
> I've been told). No, I have not tried any other Dos emulators.

I'm successfully using dosemu to communicate with a solar panel datalogger 
that only has DOS software.  DOSBox' primary reason to exist is to enable 
quickly and easily playing old DOS games.  The developers freely admit that 
they have very little interest in any other application.  My googling on the 
subject mentions that DOSBox handles serial interrupts in a fairly squirrley 
fashion for instance.

DOSemu is harder to setup than DOSBox but I've had better luck with it on 
nongame applications.  You may want to explore that option.  DOSemu also 
appears to be much more configurable in terms of talking to real hardware.

Dave


-- 
People are like onions -- you cut them up, and they make you cry.


More information about the colug432 mailing list