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/
I have PCI-E board which adds 4 serial ports to the system. So I'm developing bus driver for this hardware.
My idea to create 4 PDOs devices, provide necessary resources and use standard serial driver from WDK examples (with minimal changes if necessary).
But I have some issue with resource rebalancing.
I do the following:
1) The bus driver receives a memory from the Pnp manager in EvtDevicePrepareHardware.
2) This region of memory is divided into several sub-regions and distributed between child devices in EvtDeviceResourceRequirementsQuery.
3) The child device driver maps the provided memory in the EvtDevicePrepareHardware function.
The problem is that the Pnp manager starts rebalancing resources because the bus driver and child device driver own overlapping areas of memory.
In Device Manager, I can see that a bus device and child devices may own overlapped resources.
How to allocate overlapped resources to child devices to avoid resource rebalancing?
This is source code (from bus driver) which provides resources to child devices in regions EvtDeviceResourceRequirementsQuery:
serialNo = ...
status = RtlIoEncodeMemIoResource(&descriptor, CmResourceTypeMemory, 0, PAGE_SIZE, baseAddr.LowPart + (serialNo - 1) * 0x40, baseAddr.LowPart + (serialNo - 1) * 0x40 + 0x40);
descriptor.ShareDisposition = CmResourceShareShared;
descriptor.ShareDisposition = CM_RESOURCE_MEMORY_READ_WRITE;
status = WdfIoResourceListAppendDescriptor(reslist, &descriptor);
Thanks in advance!
|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!|
|Writing WDF Drivers||7 Dec 2020||LIVE ONLINE|
|Internals & Software Drivers||25 Jan 2021||LIVE ONLINE|
|Developing Minifilters||8 March 2021||LIVE ONLINE|