0

My PC has Win-7 Embedded and I'm trying to connect to PCIe switch BAR.

At first when windows detects the PCIe switch it is not configured to use the requested BAR. After my program change the switch settings it is required to restart windows in order to detect and use the BAR, If Hot-Plug functionality is enabled at the BIOS it is possible to only rescan the Device Manager and the BAR is detected by Windows without any restart. The problem is that I don't want to use Hot-Plug because it can cause various problems.

Is it possible to detect the BAR without restart and without using Hot-Plug?

I also noticed that windows automatically assign the BAR memory address, Is it possible to manually assign the BAR memory address?

Thanks

Shai B.
  • 1
  • 1
  • Why do you want to assign the BAR manually? Generally every OS assigns the BAR address during Bus scan and that's fine. So there must be some reason/use case for your query. Also what do you mean by connect to BAR? Are you trying to do BAR read/write and you are seeing error? – Shaibal Sep 09 '17 at 22:05
  • I noticed that Windows assign automatically memory address to the BAR. I want to assign specific address that it is possible to document. The connect to BAR meaning is to configure one BAR and to be able to read and write using it. My problem is not read/write error, the problem is that windows doesn't assign memory space to the BAR after my program configure it in the PCIe switch. @Shaibal – Shai B. Sep 10 '17 at 08:08
  • Please see this website which says that drivers "must" not touch the config space header where BAR address resides. https://learn.microsoft.com/en-us/windows-hardware/drivers/pci/accessing-pci-device-configuration-space – Shaibal Sep 11 '17 at 15:35
  • Thanks @Shaibal This answers the question regarding allocating different memory addresses to the BAR then the addresses that Windows gives, because the configuration of these addresses resides in the configuration space header. However it is still not certain how to force windows to reallocate memory address to the BAR after the device was already discovered without any BAR. – Shai B. Sep 17 '17 at 04:44

0 Answers0