News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

PCI addressing from DOS

Started by Dubhe, November 11, 2008, 02:19:21 AM

Previous topic - Next topic

Dubhe

Hi!

I am supporting a legacy product and I need to access a Quad UART PCI card from DOS. The BIOS has put the UART base addresses at 3418h, 3410h, 3408h and 3400h. It seems that I can only access the I/O range of 0-3FFh using the OUT command. Is there any other way to get to those higher addresses?
Thanks!

--Jon

MichaelW

3FFh implies that only I/O address lines A0-A9 are being decoded. Can you change the address range in the BIOS setup or by jumper? Can you try the card in a different slot, or in a different system?
eschew obfuscation

BogdanOntanu

Form Intel manuals describing the IN / OUT instructions I understand that you can always access ports 0-65536 from the CPU's point of view. As Michael say it is possible that the motherboard or more likely the card does not decode the whole address range. This is common because decoding has costs.

Accessing PCI directly is relatively easy and you will find a lot of information on the web or on the hobby OS development forums, but this might not be your real problem. The PCI interface allows you to obtain information about a device current configuration but the relevant actions will be performed at the device's I/O or mapped I/O address ranges and by some rules that are specific to the device itself.

New devices have a tendency to have memory mapped areas and DMA buffers that might require 32 bits access and hence you might need at least a hobby 32 bit OS or  Windows or Linux and not a real mode OS as DOS in order to access this.

You should read the manuals more carefull before making assumptions.
Here is the quote from Intel manuals for IN instruction:
Quote
Description
Copies the value from the I/O port specified with the second operand (source operand) to the
destination operand (first operand). The source operand can be a byte-immediate or the DX
register; the destination operand can be register AL, AX, or EAX, depending on the size of the
port being accessed (8, 16, or 32 bits, respectively). Using the DX register as a source operand
allows I/O port addresses from 0 to 65,535 to be accessed; using a byte immediate allows I/O
port addresses 0 to 255 to be accessed.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Dubhe

Thank you for your replies. So it appears that my problem is not what I thought.

The code that I am using works fine on the motherboard based COM1:, just not on the expansion board COM5:-COM8: ports. I will research more. I have an inquiry into the expansion board manufacturer, but no responses yet...

Thanks again!

--Jon

MichaelW

There was a discussion of the PCI BIOS here:

http://www.masm32.com/board/index.php?topic=3441.0

The link that sinsi posted:

http://members.datafast.net.au/dft0802/

Still works and is a good source of information.

And you may be able to get the vendor ID for the maker of the card here:

http://www.pcidatabase.com/

And with the vendor ID you may be able to get other useful information about the card and its configuration.

eschew obfuscation