6-驱动程序开发-91.ppt
上传人:qw****27 上传时间:2024-09-12 格式:PPT 页数:93 大小:5.1MB 金币:15 举报 版权申诉
预览加载中,请您耐心等待几秒...

6-驱动程序开发-91.ppt

6-驱动程序开发-91.ppt

预览

免费试读已结束,剩余 83 页请下载文档后查看

15 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

微机接口技术本章主要内容Windows内核驱动程序概述两种类型的驱动程序WIN2000系统的分层结构执行部件内核驱动程序的分类内核模式驱动程序的分类内核模式驱动程序的分类内核模式驱动程序的分类内核模式驱动程序的分类WDM驱动程序操作系统设计目标9.1Windows驱动程序模型Abusdriverservicesabuscontroller,adapter,orbridge.Busdriversarerequireddrivers;thereisonebusdriverforeachtypeofbusonamachine.Microsoftprovidesbusdriversformostcommonbuses.IHVsandOEMscanprovideotherbusdrivers.AbusfilterdrivertypicallyaddsvaluetoabusandissuppliedbyMicrosoftorasystemOEM.Therecanbeanynumberofbusfilterdriversforabus.Lower-levelfilterdriverstypicallymodifythebehaviorofdevicehardware.TheyareoptionalandaretypicallysuppliedbyIHVs.Therecanbeanynumberoflower-levelfilterdriversforadevice.Afunctiondriveristhemaindriverforadevice.Afunctiondriveristypicallywrittenbythedevicevendorandisrequired(unlessthedeviceisbeingusedinrawmode).Upper-levelfilterdriverstypicallyprovideadded-valuefeaturesforadevice.TheyareoptionalandaretypicallyprovidedbyIHVs.WDM的新特点9.1.1WDM的基本结构系统为帮助软件管理硬件而创建的一个数据结构.WDM中包括物理设备对象(PDO)、功能设备对象(FDO)和过滤器设备对象(FiDO)三种。驱动程序分类功能驱动程序总线驱动程序过滤器驱动程序2526279.1.2I/O请求包(IRP)WDM中I/O请求包的运行机制如下:ThesubsystemcallsanI/Osystemservicetoopenanamedfile.TheI/Omanagercallstheobjectmanagertolookupthenamedfileandtohelpitresolveanysymboliclinksforthefileobject.Italsocallsthesecurityreferencemonitortocheckthatthesubsystemhasthecorrectaccessrightstoopenthatfileobject.Ifthevolumeisnotyetmounted,theI/Omanagersuspendstheopenrequesttemporarilyandcallsoneormorefilesystemsuntiloneofthemrecognizesthefileobjectassomethingithasstoredononeofthemass-storagedevicesthefilesystemuses.Whenthefilesystemhasmountedthevolume,theI/Omanagerresumestherequest.TheI/OmanagerallocatesmemoryforandinitializesanIRPfortheopenrequest.Todrivers,anopenisequivalenttoa"create"request.TheI/Omanagercallsthefilesystemdriver,passingittheIRP.ThefilesystemdriveraccessesitsI/OstacklocationintheIRPtodeterminewhatoperationitmustcarryout,checksparameters,determinesiftherequestedfileisincache,and,ifnot,setsupthenext-lowerdriver'sI/OstacklocationintheIRP.BothdriversprocesstheIRPa