Driver Structure

来源:互联网 发布:北风网java视频教程 编辑:程序博客网 时间:2024/06/17 07:03
1,Driver Loading and Initialization
NT drivers are dynamically loaded,in NT 4,drivers are almost loaded during system bootup, When a driver is loaded,the IO Mangaer calls its DriverEntry entry point.It is during DriverEntry processing that a driver performs internal initilization and locates and initializes hardware that it will control.On return from DriverEntry with success,the IO Manager begins passing IO requests to the driver.


2,Request Processing for Device Drivers
Dispatch Routine Processing:For example,when the IO Manager has an IRP with  an IRP_MJ_READ function code for a particular driver to process,it calls driver's dispatch
read entry point.As parameters to the driver's dispatch entry point,the IO Manager  passes a point to the device object to which the request is directed and a pointer to the 
IRP that describes the request. 


3,Dynamic unloading:

A driver indicates to the IO Manager that it can be dynamically unloade by supplying a pointer to an unload entry point in its Driver Object.



4,A driver's DriverEntry entry point is called by the IO Manager only once,regardless of the number of devices the driver will control.DriverEntry is called at IRQL PASSIVE_LEVEL in the context of the system process.
The typical steps that a driver performs at the DriverEntry include the following:
(1)locate physical hardware devices that the driver will control
(2)Create one or more Device Objects
(3)Claim hardware resources to be used by the driver .
(4)Export other driver entry points.
(5)Connect to interrupts and register a DpcForIsr
(6)For DMA devices,describe the device's characteristics and get an Adapter Object
(7)Do whatever initialization and setup is necessary to make the devices under the device's control ready for processing

0 0
原创粉丝点击