Page 1 of 1
PCI set-up
Posted: Fri Jan 19, 2007 1:56 pm
by xsix
There are devices plugged into the pci slots. So when POST starts it assigns memory ant I/O addresses to them automatically? so if some_card information says that BAR0 is address where i should write into, so i read BAR0 value from that device and just do IN and OUT instructions with it(of course if it is I/O address) ?
Re: PCI set-up
Posted: Fri Jan 19, 2007 3:34 pm
by Candy
xsix wrote:There are devices plugged into the pci slots. So when POST starts it assigns memory ant I/O addresses to them automatically? so if some_card information says that BAR0 is address where i should write into, so i read BAR0 value from that device and just do IN and OUT instructions with it(of course if it is I/O address) ?
If all is initialized, you just use the addresses as mentioned in the BARs. If it's not, you set them, recursively, to available locations. You determine how big the BAR is by setting it to all ones and determining the bits that can't be set (that's the size). You always assign it an aligned address. Bridges get the entire range of the devices that are attached to them, plus any for their own BAR's (if applicable). You set/read all this using PCI configuration space, which you access using the PCI registers which are fixed in IO space.
If you ever make such a ****up that you map some IO space on top of the PCI configuration space, your computer is probably ready for the scrapheap. You might want to watch out with that
.