Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices

To add more functionality to the PCI device driver we wrote, we simulated a test PCIe device on QEMU, allowing us to implement features we wanted, such as DMA and interrupts. For the specific implementation of this PCIe test device, please refer to How to Implement a PCIe Device in QEMU. The Vendor ID and Device ID of this QEMU simulated PCIe device differ from the Hardware ID we matched in our original PCI driver, so we need to modify the driver’s INF file to install this PCI driver on the QEMU simulated PCIe device.Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices After modifying the INF file, recompiling the driver, and re-signing it, we copied the driver to the QEMU Windows virtual machine and installed the driver. In the device manager, we can see the effect as follows; the Hardware Ids displayed in the device properties are the IDs we specified in QEMU. It can be seen that the driver itself did not modify a single line of code; we only modified the INF file, allowing us to install this PCI driver on another PCIe device. Currently, our PCI driver only handles the PCI protocol-related parts and does not deal with device-specific logic, making this driver quite generic. This also illustrates the benefits of standardizing hardware through protocols, significantly reducing the workload of developing drivers for various devices.Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices Since the PCIe device we simulated has only one PCI BAR, we can see from the device manager that there is only one Memory Resource for this device.Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices Below is the log of the driver installation, and the Vendor ID and Device ID obtained from the driver are also the same as those set in QEMU.Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices In the future, we will expand the functionality of this simulated PCIe test device, and accordingly, we will also need to extend the functionality of this PCI driver.

Leave a Comment