* Can't access I/O ports with dosemu 1.0.2
@ 2002-12-27 15:52 Brad Rodriguez
0 siblings, 0 replies; 5+ messages in thread
From: Brad Rodriguez @ 2002-12-27 15:52 UTC (permalink / raw)
To: linux-msdos
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Can't access I/O ports with dosemu 1.0.2
@ 2002-12-27 16:20 Stas Sergeev
2002-12-27 21:08 ` Brad Rodriguez
0 siblings, 1 reply; 5+ messages in thread
From: Stas Sergeev @ 2002-12-27 16:20 UTC (permalink / raw)
To: linux-msdos
Hello.
Brad Rodriguez wrote:
> 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).
Upgrade your dosemu.
> $_ports = "range 0x2f8,0x2ff range 0x320,0x327 range 0x378,0x37f range
> 0x3f8,0x3ff"
If any of that range is listed in
/proc/ioports, then dosemu will not
allow its usage to avoid the conflicts.
So you have to disable the in-kernel
support for that devices.
> The software I'm using requires direct hardware access to the LPT1
Yes, LPT is a weak part of dosemu unless
you do a simple printing.
> COM1, and COM2 ports
Why would the one require a direct
access to the COM ports? The support
for those is fairly complete under
dosemu.
> Are there some simple diagnostics that I can
> perform to tell me if DOSEMU is configured properly?
-D9+Tci log would do.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Can't access I/O ports with dosemu 1.0.2
2002-12-27 16:20 Can't access I/O ports with dosemu 1.0.2 Stas Sergeev
@ 2002-12-27 21:08 ` Brad Rodriguez
2002-12-27 21:23 ` Bart Oldeman
0 siblings, 1 reply; 5+ messages in thread
From: Brad Rodriguez @ 2002-12-27 21:08 UTC (permalink / raw)
To: linux-msdos
Thanks for your reply.
Stas Sergeev wrote:
> Brad Rodriguez wrote:
>
>> 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).
>
> Upgrade your dosemu.
Upgrade it to what? I'm using the current "stable release" from the
dosemu.org site.
>> $_ports = "range 0x2f8,0x2ff range 0x320,0x327 range 0x378,0x37f range
>> 0x3f8,0x3ff"
>
> If any of that range is listed in
> /proc/ioports, then dosemu will not
> allow its usage to avoid the conflicts.
> So you have to disable the in-kernel
> support for that devices.
I see that COM1, COM2, and LPT1 are all listed in /proc/ioports, so I'll
have to learn how to disable the kernel support. But 0x320-0x327 (the
EPROM emulator) is not listed in /proc/ioports and I don't seem able to
access those ports either.
>> The software I'm using requires direct hardware access to the LPT1
>
> Yes, LPT is a weak part of dosemu unless
> you do a simple printing.
Unfortunately, I'm not using it to print. One software package uses it to
read a security dongle. I also have a second EPROM emulator that attaches
to the parallel port and whose driver does a lot of bit-banging on that port.
> Why would the one require a direct
> access to the COM ports? The support
> for those is fairly complete under
> dosemu.
Perhaps I don't understand how these are supported under DOSEMU. The
programs I am using are not using BIOS calls to access the serial port. As
far as I know, they include their own serial I/O drivers that talk directly
to the bare metal. (Come to think of it, they probably also speak to the
interrupt controller chip, and I don't know *how* I can allow that without
completely corrupting the system.)
>> Are there some simple diagnostics that I can perform to tell me if
>> DOSEMU is configured properly?
>
> -D9+Tci log would do.
Thanks. At the risk of posting an overlong message, here's the output. To
my newbie eyes it looks like it's getting its config files from my private
$HOME directory rather than /etc. And I see a message about "not enough
privilege to define config variable c_user" which makes me wonder.
CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing /home/brad/dosemu/conf/global.conf file.
CONF: config variable version_3_style_used set
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /home/brad/dosemu/conf/dosemu.conf
CONF: closed include file /home/brad/dosemu/conf/dosemu.conf
CONF: entered user scope, includelevel 0
CONF: opened include file /home/brad/dosemu/conf/dosemurc
CONF: closed include file /home/brad/dosemu/conf/dosemurc
CONF: left user scope, includelevel 0
CONF: config variable skip_dosrc set
CONF: variable _X_keycode replaced by user
debug flags: -a+c
debug flags: -dARWDCvXkiTsm#pQgcwhIExMnPrSgZ
CONF: Disabling use of pentium timer
CONF: dosbanner on
CONF: timint on
CONF: CPU set to 386
CONF: 1024k bytes XMS memory
CONF: 2048k bytes EMS memory
CONF: EMS-frame = 0xe000
CONF: dosemu running on remote_xterm
CONF: Keyboard-layout keyb-user
CONF: Keyboard-layout auto
device: /dev/fd0 type 2 h: 0 s: 0 t: 0 floppy A:
CONF: DPMI-Server on
CONF: IRQ 3 for irqpassing uses SIGIO
CONF: IRQ 4 for irqpassing uses SIGIO
CONF: not allowing speaker port access
CONF: IPX support off
CONF(LPT0) f: (null) c: lpr o: -Plp %s t: 20 port: 378
CONF: range of I/O ports 0x02f8-0x02ff
CONF: range of I/O ports 0x0320-0x0327
CONF: range of I/O ports 0x0378-0x037f
CONF: range of I/O ports 0x03f8-0x03ff
device: /home/brad/dosemu/freedos type 4 h: -1 s: -1 t: -1 drive C:
CONF: config variable c_system unset
CONF: not enough privilege to define config variable c_user
debug flags: 9+Tci
CONF: Keyboard-layout auto
CONF: Forceing neutral Keyboard-layout, X-server will translate
CONF: mostly running as USER: uid=500 (cached 500) gid=500 (cached 500)
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 64Kb at 0xF0000 for 'r' (Dosemu reserved area)
PORT: registered "VGAEmu VGA Controller" handle 0x06 [0x03c0-0x03cf] fd=-1
PORT: registered "VGAEmu CRT Controller" handle 0x07 [0x03d4-0x03d5] fd=-1
PORT: registered "VGAEmu Input Status #1/Feature Control" handle 0x08
[0x03da-0x03da] fd=-1
PORT: registered "VGAEmu Mono/Hercules Card" handle 0x09 [0x03b0-0x03bf] fd=-1
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
PORT: registered "8254 Timer0" handle 0x0a [0x0040-0x0040] fd=-1
PORT: registered "8254 Timer1" handle 0x0b [0x0041-0x0041] fd=-1
PORT: registered "8254 Timer2" handle 0x0c [0x0042-0x0042] fd=-1
PORT: registered "8254 Ctrl02" handle 0x0d [0x0043-0x0043] fd=-1
PORT: registered "CMOS RAM" handle 0x0e [0x0070-0x0071] fd=-1
PORT: registered "8259 PIC0" handle 0x0f [0x0020-0x0021] fd=-1
PORT: registered "8259 PIC1" handle 0x10 [0x00a0-0x00a1] fd=-1
PORT: registered "8042 Keyboard data" handle 0x11 [0x0060-0x0060] fd=-1
PORT: registered "8042 Keyboard command" handle 0x12 [0x0064-0x0064] fd=-1
PORT: registered "Speaker port" handle 0x13 [0x0061-0x0061] fd=-1
PORT: registered "DMA - XT Controller" handle 0x14 [0x0000-0x000f] fd=-1
PORT: registered "DMA - XT Pages" handle 0x15 [0x0081-0x0087] fd=-1
PORT: registered "DMA - AT Controller" handle 0x16 [0x00c0-0x00de] fd=-1
PORT: registered "DMA - AT Pages" handle 0x17 [0x0089-0x008a] fd=-1
PORT: registered "Adlib (+ Advanced) Emulation" handle 0x18 [0x0388-0x038b]
fd=-1
PORT: registered "Midi Emulation" handle 0x19 [0x0330-0x0331] fd=-1
PORT: 0x3b8 can't be mapped to handle 0x5(0x9)
PORT: 0x3bf can't be mapped to handle 0x5(0x9)
PORT: 0x3ce can't be mapped to handle 0x1(0x6)
PORT: 0x3cf can't be mapped to handle 0x1(0x6)
PORT: 0x3d4 can't be mapped to handle 0x1(0x7)
PORT: 0x3d5 can't be mapped to handle 0x1(0x7)
PORT: 0x3da can't be mapped to handle 0x1(0x8)
PORT: 0x3ba can't be mapped to handle 0x5(0x9)
PORT: 0x3da can't be mapped to handle 0x5(0x8)
PORT: 0x3d4 can't be mapped to handle 0x5(0x7)
PORT: 0x3d5 can't be mapped to handle 0x5(0x7)
CONF: reserving 64Kb at 0xE0000 for 'E' (EMS page frame)
TIME: using 9154 usec for updating ALRM timer
DOS termination requested
SPEAKER: sound OFF!
Thanks again,
Brad
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Can't access I/O ports with dosemu 1.0.2
2002-12-27 21:08 ` Brad Rodriguez
@ 2002-12-27 21:23 ` Bart Oldeman
0 siblings, 0 replies; 5+ messages in thread
From: Bart Oldeman @ 2002-12-27 21:23 UTC (permalink / raw)
To: Brad Rodriguez; +Cc: linux-msdos
On Fri, 27 Dec 2002, Brad Rodriguez wrote:
> Stas Sergeev wrote:
> > Upgrade your dosemu.
>
> Upgrade it to what? I'm using the current "stable release" from the
> dosemu.org site.
Stas' opinion is that the development version is more stable than the
stable version. YMMV -- 1.1.x has its own problems but DPMI and sound are
better among other things. For your problem it should not matter much.
> >> $_ports = "range 0x2f8,0x2ff range 0x320,0x327 range 0x378,0x37f range
> >> 0x3f8,0x3ff"
> >
> > If any of that range is listed in
> > /proc/ioports, then dosemu will not
> > allow its usage to avoid the conflicts.
> > So you have to disable the in-kernel
> > support for that devices.
>
> I see that COM1, COM2, and LPT1 are all listed in /proc/ioports, so I'll
> have to learn how to disable the kernel support. But 0x320-0x327 (the
> EPROM emulator) is not listed in /proc/ioports and I don't seem able to
> access those ports either.
Try to run dosemu as root and see if that works. It looks like a
permission problem.
Bart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Can't access I/O ports with dosemu 1.0.2
@ 2002-12-27 22:14 Stas Sergeev
0 siblings, 0 replies; 5+ messages in thread
From: Stas Sergeev @ 2002-12-27 22:14 UTC (permalink / raw)
To: linux-msdos
Hello.
Brad Rodriguez wrote:
> I see that COM1, COM2, and LPT1 are all listed in /proc/ioports, so
> I'll have to learn how to disable the kernel support.
Probably you can simply hack the
dosemu's ports.c and replace a
/proc/ioports there with /dev/null.
I don't know for sure will such a
cheat work or will it be safe, but
at least you can try.
As for disabling the in-kernel support,
you have to reconfigure/recompile
your kernel without a parport support,
or, which is better, if the support is
modular, just unload the relevant
modules and that should do the trick.
> But 0x320-0x327 (the
> EPROM emulator) is not listed in /proc/ioports and I don't seem able to
> access those ports either.
Yes, I also think it is a permissions
problem.
>> Yes, LPT is a weak part of dosemu unless
>> you do a simple printing.
> Unfortunately, I'm not using it to print.
And unfortunately dosemu doesn't have
a proper LPT support.
>> Why would the one require a direct
>> access to the COM ports? The support
>> for those is fairly complete under
>> dosemu.
> Perhaps I don't understand how these are supported under DOSEMU. The
Yep.
> programs I am using are not using BIOS calls to access the serial port.
> As far as I know, they include their own serial I/O drivers that talk
> directly
> to the bare metal. (Come to think of it, they probably also speak to
> the interrupt controller chip, and I don't know *how* I can allow that
> without completely corrupting the system.)
Please just stop making problems where
they don't exist. The LPT is problematic,
yes, but the PIC and Serials are fully
supported (except that the speed of the
emulated serial is not always sufficient).
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-12-27 22:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-27 16:20 Can't access I/O ports with dosemu 1.0.2 Stas Sergeev
2002-12-27 21:08 ` Brad Rodriguez
2002-12-27 21:23 ` Bart Oldeman
-- strict thread matches above, loose matches on Subject: below --
2002-12-27 22:14 Stas Sergeev
2002-12-27 15:52 Brad Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox