Can't access I/O ports with dosemu 1.0.2

Brad Rodriguez
2002-12-27T15:52:33Z

I'm trying to run some legacy DOS software that requires direct access to
the I/O ports and interrupts, using DOSEMU. Although DOSEMU works, I can't
access the hardware ports. I've tried everything I could find in the
Quickstart, the README, and the HOWTO, with on luck...hence this email.

Details: I'm using Red Hat 8.0. I first attempted the ready-to-use binary
distribution of DOSEMU 1.0.2.1, per the instructions in README.bindlist,
with the FreeDos distribution currently on the dosemu.org site. I
installed this as my normal user into a subdirectory and it ran fine, but
didn't give I/O access. It didn't take much reading to discover that I
needed to run DOSEMU suid root in order to access I/O ports.

I tried changing the ownership of the executable, and giving it setuid
status, but that didn't work. I tried running it as the root user; but
that wasn't allowed (I got a message saying I have to run as normal user).
So I concluded that I needed to do a full installation.

I downloaded the 1.0.2 source package and followed the instructions in
Quickstart (2) to compile DOSEMU, (2a) to install systemwide, and (4) to
configure for a systemwide suid-root installation. I've copied the
distributed dosemu.conf to /etc/dosemu.conf and made only the following
changes:

$_irqpassing = "3 4"

$_ports = "range 0x2f8,0x2ff range 0x320,0x327 range 0x378,0x37f range
0x3f8,0x3ff"

(The software I'm using requires direct hardware access to the LPT1, COM1,
and COM2 ports, and also uses a LeBurg EPROM emulator at 0x320-0x327.)
I've also copied the distributed dosemu.users.secure to /etc/dosemu.users
and added the following line for my own user account, right after the "root
c_all" line:

brad c_all

Finally I've copied the distributed global.conf, unchanged, to
/var/lib/dosemu/global.conf.

Again, DOSEMU runs and seems to execute DOS programs -- I'm using xdosemu
under Gnome -- but the programs cannot read the I/O ports. I've tried
directly reading the I/O ports using Pygmy Forth 1.4 for DOS, and the ports
all read as 0xFF. Writing to them seems to have no effect. I haven't
tried writing a hardware diagnostic for the interrupts yet, but I have
tried to run Procomm and it doesn't seem to talk to the serial port.

The DOS software I'm trying to run is:
MPE Ltd. Xshell3 IDE and XZ8 cross compiler
New Micros MaxTerm serial communications program
LeBurg EPEM32 EPROM emulator
Procomm 2.4.1 (for testing)
Pygmy Forth 1.4 (for testing)
Qedit 2.1 (for testing)

None of these use DPMI.

I'm guessing that I've missed a configuration setting somewhere. Can
anyone shed some light? Are there some simple diagnostics that I can
perform to tell me if DOSEMU is configured properly?

Regards,
Brad Rodriguez bj@zetetics.com