Hello Guys,
I am trying to understand the PCIe configuration mechanism during Windows boot.
Now lets assume that the BIOS managed to configure all BARs with addresses within the MMIO memory window, that the BIOS has previously assigned in the system memory map.
This I do understand.
What I don’t understand is how are these mappings handed over to OS.
I have read (several times) Jake Oshins’ post “Arbitration and Translation”, all three parts (btw, great post).
http://blogs.msdn.com/b/doronh/archive/2010/05/06/arbitration-and-translation-part-3.aspx
What Jake says there is "
And that?s the second major truth. The BIOS sets most or all of it up anyhow.
So the arbiter interface and NT PnP, in general, have a way of asking about how a device was configured by the BIOS. When a device is first discovered, the PnP manager sends IRP_MN_QUERY_RESOURCES.
"
So what it looks like is that OS bus driver simply reads assignments from the BAR/INT PCI registers of the device.
What confused me though is that some other posts I have read claim that the OS actually reads the ESCD, created by the BIOS during configuration.
So how does it really work ? Is the arbiter getting updated about the PCI BAR addresses, assigned by BIOS after IRP_MN_QUERY_RESOURCES or is there some sort of BAR mappings database, passed from BIOS to OS during boot ?
Second question is :does PnP manager keep a database of PCIe devices MMIO mappings (e.g. BAR values)? What i mean is when you uninstall PCIe device driver and then reinstall it, BAR values are restored even if you have manually deleted them when the device was uninstalled (i have checked).
Thank you,
Sagi Bar
xxxxx@walla.co.il wrote:
I am trying to understand the PCIe configuration mechanism during Windows boot.
Now lets assume that the BIOS managed to configure all BARs with addresses within the MMIO memory window, that the BIOS has previously assigned in the system memory map.
This I do understand.
What I don’t understand is how are these mappings handed over to OS.
There’s nothing to “hand over” except the assigned physical address, and
those are already stored in the BAR.
What confused me though is that some other posts I have read claim that the OS actually reads the ESCD, created by the BIOS during configuration.
So how does it really work ? Is the arbiter getting updated about the PCI BAR addresses, assigned by BIOS after IRP_MN_QUERY_RESOURCES or is there some sort of BAR mappings database, passed from BIOS to OS during boot ?
How could you tell, and why would you care? All the PCI bus driver
needs is the physical address and the size, and it can get all of that
from the BAR. If it did read the ESCD, what additional information
could it glean?
Second question is :does PnP manager keep a database of PCIe devices MMIO mappings (e.g. BAR values)? What i mean is when you uninstall PCIe device driver and then reinstall it, BAR values are restored even if you have manually deleted them when the device was uninstalled (i have checked).
Uninstalling a PCIe device’s driver does not free its BAR. Just because
there is no driver assigned does not mean the device has to be killed.
However, if it DID free the BAR, now you have a hole in the mapping
space that is exactly large enough. When the device comes back, it will
naturally be placed back in that same neatly sized hold. Non_RAM
physical address space is not a dynamic resource – there isn’t much churn.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Hello Tim.
Thank you again for your swift answer (for so many times now
).
Your answered has clarified the issue to me.
Regards,
Sagi Bar