Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
This question is not about bus drivers but it is related.
I was wondering if it is possible(by developing a bus driver) to expand the PCI bus and hang synthetic devices off the PCI bus such that my bus driver would be responsible for configuration space accesses (and implementing the PCI protocol) for all synthetic devices hanging off bus X and everything below it where bus X is the root of my hierarchy.
Basically, I do not want the system provided PCI bus driver handling my hierarchy.
Thanks,
RK
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Kernel Debugging | 30 January 2023 | Live, Online |
Developing Minifilters | 20 March 2023 | Live, Online |
Internals & Software Drivers | 17 April 2023 | Live, Online |
Writing WDF Drivers | 22 May 2023 | Live, Online |
Comments
In practical terms, the answer is no.
Remember that the PCI bus driver and all PCI client drivers do I/O accesses directly. This is very different from USB, for example, where client drivers don't touch hardware, and because of that it's very easy to replace the whole mechanism.
Yes, you could create your own bus driver, expose fake device IDs, and load client drivers. That's common, and with KMDF it's not even hard. But you couldn't load any existing client drivers, because all of those drivers expect to do direct memory-mapped I/O to their devices. Since your bus driver wouldn't own any resources, you couldn't allow drivers to do that.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
That is the correct answer.
Having said that: Windows architecture allows for the possibility of creating drivers for "other" backplane architecture buses, beyond PCI. This is because the HAL and the bus driver are responsible for translating all device resources (including, ports, registers, and DMA resources). So, it it theoretically possible for you to deal-out port and/or memory resources that are in some (existing) address space, where client drivers would access them directly. These could even, again theoretically be in some reserved hardware address space.
The necessary APIs to do this have never been fully documented, and (given that there's exactly one implementation of the architecture) it's not even clear if the architecture is complete or if the existing architectural boundaries have been uniformly obeyed. IOW, who knows if all the abstraction stuff "works" (anymore, or if it ever did).
There are some ragged architectural issues involving the use of the HAL register and port functions, as well... they make assumptions tied to how PCI works, instead of being fully abstract.
In any case, this is not something I've ever done, though I admit the possibility has intrigued me for a while.
So, to repeat, the answer to your question is:
Peter
Peter Viscarola
OSR
@OSRDrivers
Tim / Peter, thank you very much for the quick responses. Appreciate the help