VOGONS

Common searches


First post, by BillLee

User metadata
Rank Newbie
Rank
Newbie

I have "inherited" a DOS application that uses direct access (using inp/outp) to the parallel port registers for reading and writing to the port.

I am trying to run this application on my Fedora Linux system using DOSBox-X. I have no way to recompile the DOS application, I am supplied with a DOS executable.

My system has a PCI board providing the parallel port. This means that the address of the port register are different from the "standard" 0x3bc, 0x378, etc. The proper address can be obtained via 'lspci -v' on the Linux system. The DOS application has a configuration capability that lets me set the proper address.

I have written and tested a simple C program (non-DOS) that uses inp/outp to assure that the PCI parallel port can be accessed. What I have run into is that the Linux system first requires a call to ioperm in order to access the port, and the application must be running in root for proper authority.

How do I execute this DOS program under DOSBox-X given the Linux constraints I mentioned?

Thanks for the help.

-----------------
DOSBox-X v0.03.20
Fedora 33 Linux
System is Dell desktop
KDE 5.20.5

PCI Parallel board: StarTech PEX1P2

Reply 1 of 2, by javispedro1

User metadata
Rank Member
Rank
Member

I am not sure if you can configure DOSBox-X to forward I/O access to real IO ports.
However, it is likely trivial to implement, specially if you already know C. I see they tried to do that already for Adlib passthrough and for LPT passthrough in Windows (but it is all commented out).

Under Linux, DOSEMU was designed exactly for the situation you are describing, and can be configured to redirect any IO port access.
See the $_ports setting http://dosemu.org/docs/README/1.4/config.html#AEN343 , or the old guides http://www.dosemu.org/docs/README-tech/0.99/R … DME-tech-3.html .
I have no idea if dosemu2 supports this, but dosemu(1.x) did , even in x86_64.

However, there may be a much better option.
Is your parallel port card usable from the host Linux? Do you have already installed drivers for it? Do you have a /dev/lp0 (or lp1, parport0, etc.) device file ?
It looks like you have some options to make it work from Linux -- https://duckduckgo.com/?q=asix+ax99100+linux
If you don't have/find linux drivers, and since from your description it seems the PCI part is already configured by the BIOS,
you could even try configuring the standard parport module with the specific IO ports you found via lspci, as in https://www.kernel.org/doc/html/v5.16/admin-g … de/parport.html

Once you get the port working in the host, then you can just use the parallel port emulator from DOSBox(-X), pointing it to the corresponding parallel port on the host.
E.g. https://dosbox-x.com/wiki/Guide%3ASetting-up- … X#_linux_host_2
Your DOS software would then write to the standard LPT1 IO ports , but they would be emulated by DOSBox and redirected to the card's parallel port.
It is also likely easier to convince your DOS software to use the standard ports that whatever ports the PCI interface has decided to use.

Reply 2 of 2, by _Rob

User metadata
Rank Member
Rank
Member

You should really post this in the DOSBox-X forum thread.

In any case, what Linux device does this adapter show up as? e.g. a traditional parallel port is normally /dev/parport0 while a USB adapter may show as /dev/usblp0.
What does "ls -l" of the device show? What are the permissions and ownership? Is it owned by the "lp" group, like a traditional parallel port, and if so, did you add your user to the "lp" group?

Then as @javispedr01 mentioned, have a look at the DOSBox-X wiki page on printing, in particular the "realport" setting to redirect IO from the guest to the host.