[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pci] PCI Addres Translation ?



Let me start this one and others can add as and if required. First of all,
Gustaw, what happens is that all PCI devices map their address and I/O space
from their BaseAddressRegisters (BAR0, BAR1, BAR2, BAR3). Some devices have
both memory and I/O space requirements and that is handled by a bit in the
BAR register (bit0 actually). If that bit is set, this is an I/O space
access, if not set, this is memory. You can examine all of the PCI devices
in a Linux computer with the command "lspci" to LiStPCI and it will accept
argument such as -x to display the PCI registers in hex if you wish.

In your computer, be it in linux, or real DOS, a memory access is a memory
access. If your BIOS (or operating system) has correctly setup the Base
Address Registers (BAR's) of your PCI device, then you can write and read to
that device. It is physically mapped into memory (or I/O space as described
above).

Now, lets go on to BUS-MASTERING. A PCI device which is a Bus Master may
read and write to memory available to it. "Available" may mean many things
depending on such concepts as protected mode descriptor settings, which I
think is beyond the scope of this discussion. Lets keep it simple. Assuming
that your device has the appropriate privilege level, it can initiate a
memory write or read to any address. If another device on the PCI bus claims
that transaction (such as the PCI device the bridges your CPU to your main
memory), then you can write to your computer main memory. You may also write
to another PCI peripheral device.

Now, in three short paragraphs, I have oversimplified an extremely
complicated subject. To really understand what is happening, you will need
to spend considerable time studying both PCI hardware and software. If
anyone else wants to amplify and help Gustav, please feel free.

Charles



----- Original Message -----
From: <gustaw47@poczta.onet.pl>
To: <pci@opencores.org>
Sent: Sunday, June 02, 2002 3:12 PM
Subject: [pci] PCI Addres Translation ?


> Hello
>
> I have one more question:
> how to translate logical addres (e.g. used in Linux 386 program, or Real
> DOS [ES:DI] or [ES:EDI] ) to its phisical representation (DA0..31) on
> PCI ?
> It is necessary to perform BUS-MASTERING (my PCI card must write
> some data directly to PC's RAM memory).
>
> Thanks in advance
> Gustaw Mazurek
> --
> To unsubscribe from pci mailing list please visit
http://www.opencores.org/mailinglists.shtml
>


--
To unsubscribe from pci mailing list please visit http://www.opencores.org/mailinglists.shtml