Accessing PCI Device Registers

Once the PCIDEV structure contains all the values, you need to set up your software to program the device. First, the IoSpace array contains the values you need to access the device registers. For example, let us suppose that the device registers are mapped to BAR0 as memory registers, and they are also mapped to BAR1 as I/O registers (this is quite common to provide a choice for programming style). You can choose to program in memory space or I/O space.
 
To access the registers in memory space, we need to map the address of the space to our process so we can access the physical device. The fields in IoSpace[0] tell us the physical memory address and the size of the space. This information is perfect for calling MapRtPhysicalMemory.
 
The alternative is using I/O space.