Read without ads and support Scribd by becoming a Scribd Premium Reader.
 
This article gives a high-level understanding of the I/O concepts asdefined in the Windows Driver Model. It assumes knowledge of basic WDM Concepts.
1
 
I/O Flow through Device Stack
Driver
contains a collection of routines that can be called by the I/O Manager.The I/O Manager typically calls a driver routine at the following conditions:i. When a driver is loadedii. When a driver is unloaded or the system is shutting downiii. When a device is inserted or removediv. When a user-mode program issues an I/O request (which is routedthrough the device object)
v. When a shared hardware resource becomes available for driver use
I/O request packets (IRPs) are kernel mode structures that are used to facilitatecommunication between each of the WDM drivers as well as when theoperating system needs to communicate with the drivers.
Life-cycle of IRP:
I. With each user-mode request for I/O, the I/O Manager allocates an IRPfrom nonpaged system memory. The I/O Manager is responsible to passthe IRP to the appropriate driver.II. When the operation is complete, the driver stores a final status code in the
IRP and returns it to the I/O Manager.
III. The I/O Manager uses the information in the IRP to complete the requestand send the user the final status.
2
 
I/O stack location(s)
The I/O manager gives each driver in a chain of layered drivers an I/O stacklocation for every IRP that it sets up. Each I/O stack location consists of anIO_STACK_LOCATION structure. Each stack location corresponds to a particulardriver in the chain of layered drivers.The lowest-level driver in a chain of layered drivers can safely access only itsown I/O stack location in any IRP. A higher-level driver in a chain of layereddrivers can safely access only its own and the next-lower-level driver's I/O stacklocations in any IRP. Such a driver must set up the I/O stack location for thenext-lower-level driver in IRPs.However, when designing a higher-level driver, you cannot predict when (orwhether) a new driver will be added to the current format of chain just belowyour driver. However we can safely assume that any subsequently added(intermediate) driver will handle the same IRP major function codes(IRP_MJ_XXX) as the displaced next-lower-level driver did.
3
Search History:
Searching...
Result 00 of 00
00 results for result for
  • p.
  • Notes
    Load more