IO Manager and Device Driver

来源:互联网 发布:淘宝店运动壹号怎么样 编辑:程序博客网 时间:2024/06/06 05:16

1,

Driver Objects:It describes where a driver is loaded in physical memory,the driver's size,and its main entry points.

Device Objects:It resprents a physical or logical device that can be the target of an I/O operation.


2,The NT I/O Subsystem Is Asynchronous,



3, IRP(I/O request packet)

Windows NT describes I/O requests by using a packet-based architecture which is called IRP。

When an IO system service is issued(such as a request to creat or read from a file),the IO Manager services that request by building an IRP describing the request,and then passes a  pointer to that IRP to a device to begin processing therequest. An IRP contains all the information necessary to fully describe an IO request to the IO
Manger and device drivers.
Each IRP may be thought of as having two parts:A fixed part and an IO stack,The fixed part of the IRP contains information about the request that either does not vary from driver to driver,or it does not need to be preserved when IRP is passed from one driver to another.The IO stack contains a set of IO stack locations,each of which holds information specific to each driver that may handle the request.

For example:If an IO request were issued to write a file on a floppy disk,the stack of two drivers that would process this request would probably be File System Driver and
Floppy Disk Driver.



4,Windows NT provides driver writers with the following three different options for describing the requestor's data buffer associated with an IO operation
Direct I/O:The buffer may be described in its original location in the requestor's physical adress space by a structer called MDL
Buffer I/O:The data from the requestor's buffer may be copied from the requestor's address space into an intermediate location in system address space.
Neither I/O:The driver is provided with the requestor's virtual address of the buffer.


5,Understanding MDLs

A Memory Descriptor List(MDL) is capable of describing a signle data buffer that is contiguous in virtual memory but it is not necessarily physically contiguous.


6,Devices utilize different mechanisms to move data between the device and host memory.
Programmed I/O Devices:The driver for a PIO device is responsible for moving data between host memory and the device under,To get data to the device or retrieve data from the device,the driver  is required to manually move the data under program control.This data moviment consumes CPU cycles.
Busmaster DMA Devices:A busmaster DMA device autonomously transfers data between itself and host memory.
System DMA Devices:System DMA do not support scatter/gather

0 0
原创粉丝点击