[COLUG] Running legacy QBasic DOS software under dosemu "How to"

charles morrison charlie2 at ledgible.com
Fri Dec 21 19:05:20 EST 2007


To the Qbasic mail list: :-)

Problem review:

My problem was that I was trying to run Legacy software which was 
compiled using QBasic many years ago. This is a problem for many people 
who are servicing equipment manufactured as short as 10 years ago, which 
use serial ports to "talk to" or configure it. Many times, the equipment 
is in the middle of a plant or a large field, where it is not practical 
to locate or transport a desktop computer, making a laptop very 
convenient or necessary. Since today's computers do not commonly have 
hardware serial ports, and purchasing agents refuse to buy them if 
found, then using legacy software on USB serial ports is a very 
desirable combination.

To make my legacy software run, I was first forced to use udev rules to 
make Linux recognize the USB serial port when plugged in. This creates 
problems because the USB port will be assigned a variable port depending 
upon what other equipment is plugged in which is USB based, and the 
order in which they are plugged in. To use DOS based software requires 
that COM1 and COM2 be well defined and not move. To make this work, I 
added a line to //etc/udev/rules/10-local.rules/ which is:  
/SUBSYSTEMS=="usb-serial", DRIVERS=="mct_u232", SYMLINK+="COM1", 
GROUP="dialout", MODE="777". /This rule detects my Belkin USB to serial 
converter and creates a symlink named COM1. No matter what device node 
(ttyUSB0-ttyUSBx) is assigned to my USB converter, it will be called 
/dev/COM1.

I tested this using /echo "text" > /dev/COM1/ under both Linux and 
dosemu, which worked.

I installed dosemu using Kubuntu's adept package manager. dosemu under 
Gutsy includes Freedos with it, so you do not need to install the other 
dosemu-freedos which is in the repository. If you try, you will get a 
breakage in the install, and an error message will be displayed.

Then edit the file //etc/dosemu/dosemu.conf/ file by changing the $_COM1 
definition line to: 

## Serial port settings

# use e.g. "/dev/mouse", "/dev/ttyS0", "/dev/ttyS1", ...
# Note: all "/dev/ttyXX" may be suffixed by the IRQ
# used (instead of the default one), such as "/dev/ttyS2 irq 5"
# or "/dev/ttyS3 irq 9". Default: ""

* $_com1 = "/dev/COM1"*
# $_com2 = "/dev/ttys0"
# $_com3 = ""
# $_com4 = ""

At this point, dosemu will start in a terminal window with the command 
/dosemu/. If you made a mistake configuring the COM1, an error message 
will be printed in the Linux window. You will have to restart the udev 
rules after making a change using /sudo udevcontrol reload_rules./

Issuing a /dosemu/ command will give you a dos prompt. Dosemu assigns 
drive letters for directories, and the assignments are printed on the 
screen for you when it starts. If you wish to change them, simply change 
them in the same configuration file as the COM1 definition.

My goal was to run legacy software compiled under qbasic. At this point, 
all that is needed is your DOS compiled program and put it into the c 
drive under dosemu directory and then start it as you would in a command 
prompt under windows:  (application).exe (enter).

In my case, it did not start due to the program having been edited using 
VB for DOS. To make it run under Linux, all that was necessary was to 
compile it again under QBasic for DOS. QBasic for DOS runs under Linux 
under dosemu, very well.

To load QBasic for Dos, I loaded it onto a Windows computer since it is 
on 5 1/4" floppies, and then just copied the directory structure to my 
dosemu directory. Then start it using /qb. /My application used some 
calls that are not natively included without using /qb /L/ to start. 
Then my basic program could be loaded, edited and compiled to an 
executable as if under Windows.

So I am writing this "How To" so that others in the Linux community can 
get their DOS application running with Kubuntu Linux on a new computer, 
and support that legacy hardware which is sure to be around for many years.

Charlie Morrison
Noobie

-- 
Charlie Morrison
American LED-gible, Inc
1776 Lone Eagle Street
Columbus, OH  43228  USA
614-851-1100
FAX  614-851-1121
We use ISO 26300 document standards available through Open Office at http://www.openoffice.org






More information about the colug432 mailing list