6.2 The Role Of The I/O Manager

When the I/O request reaches the I/O manager, the I/O manager locates the driver and creates an IRP (I/O request packet), that is a data structure which contains information describing an I/O request. For an operation such as read, write, and so on, the IRP created by the I/O manager also contains a buffer in the kernel memory to be used by the driver to store the data read from the device or the data to be written to the device. The IRP created by the I/O manager is then passed to the correct driver's dispatch routine. The driver receives the IRP, and the IRP contains the major function code (IRP_MJ_XXX) that describes the operation (open, read, or write) to be performed. Before initiating an I/O operation, the driver performs a check to make sure everything is OK (for example, the buffer provided for read or write operations is large enough) after which it initiates the I/O operation. The driver normally goes through the HAL routines if it is required to perform I/O operations on the hardware device. Upon completion of its work, the driver then returns the IRP to the I/O manager, either to let it know that the requested I/O operation has been completed or because it must be passed to another driver for further processing in the driver stack. The I/O manager frees the IRP if the job is complete or passes the IRP to the next driver in the device stack to complete the IRP. Upon completion of the job, the I/O manager returns the status and the data to the user mode application.

At this point, you should have an understanding of the role of the I/O manager. For detailed information on the I/O system and device drivers, refer to the book "Windows Internals, Part 1: 7th Edition" by Pavel Yosifovich, Alex Ionescu, Mark E. Russinovich, and David A. Solomon.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.240.21