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/
My device exposes it's memory (~512MB) via it's BAR. My goal is to map and pass virtual address to user whenever user wants to allocate device memory to r/w directly (No cache).
In preparehardware, I get the physical address from the BAR, and pass it to MmMapIoSpace(). This maps given physical address range to non-paged system space and returns virtual address.
In an IOCTL, I do the followings
a) Pass that virtual address with user specified size to get a MDL using IoAllocateMdl().
b) To prepare the MDL for non-paged virtual memory, call MmBuildMdlForNonPagedPool().
c) On success, call MmMapLockedPagesSpecifyCache() to get a virtual address
So that I can pass it to user.
Though I could successfully get mdl from IoAllocateMdl(), my driver bugchecks (0x50 - PAGE_FAULT_IN_NONPAGED_AREA, read operation) at MmBuildMdlForNonPagedPool(). Seems like some non-paged space got freed. Do I have to add any additional work after calling MmMapIoSpace()? I thought this should already map the whole physical space to non-paged system space and keep until we explicitly unmap.
What am I missing here? Any help would be greatly appreciated.
Thanks in advance,
It looks like you're new here. If you want to get involved, click one of these buttons!
|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 Mar 2020||OSR Seminar Space|
|Developing Minifilters||15 Jun 2020||LIVE ONLINE|
|Writing WDF Drivers||22 June 2020||LIVE ONLINE|
|Internals & Software Drivers||28 Sept 2020||Dulles, VA|