windows driver 开发工具认识

(1).WDF 与 WDK 名词解释

From: http://xpddk.bokee.com/viewdiary.13310658.html

WDF驱动模型
如 所周知,自Windows 2000开始,开发驱动程序必以WDM为基础的,但其开发难度之大,根本不能奢望像用户模式应用程序开发那样容易。为改善这种局面,微软推出了新的驱动程 序开发环境。要预先指出的是,这不是另起炉灶改弦更张,而是以WDM为基础进行了建模和封装,显著特点是降低了开发难度。因为:
1、   将原来普通程序设计中基于对象的技术应用到了驱动开发中。WDM中虽也有对象模型,但与真正的基于对象技术根本就不是一回事。为了实现基于对象的技术,微软精心设计了对象模型并进行了封装。属性、方法、事件等等“一个都不能少”。
2、     无论内核模式的驱动程序或者用户模式的驱动程序,都采用同一套对象模型构建,采用同一个基础承载。这个基础就是WDF。WDF虽然已经是经过封装和定义的 对象模型,但对内核模式和用户模式对象来说,WDF又是两者的父对象。换言之两者都是继承了WDF才得到的,或者都是从WDF派生而来的。相对于内核模 式,派生出的对象称为“KMD框架”即KMDF;相对于用户模式,派生出的模型称为“UMD框架”即UMDF。无论何种模式的框架,其内部封装的方法、执 行的行为其实还是用WDM完成的。
3、   更重要的,也是微软反复炫耀的是封装了驱动程序中的某些共同行为:例如即插即用和电源管理就属于这种共同行为。因为大多数驱动程序中都需要处理即插即用 和电源管理问题,据说这大概要上千行的代码,况且,没有相当水平还不一定能处理好。为了一劳永逸,WDF干脆将即插即用和电源管理封装了进了对象之内,一 举成了对象的缺省(默认)行为。
4、   改变了操作系统内核与驱动程序之间的关系,WDM驱动程序中,一方面要处理硬件,另一方面要处理驱动程序与操作系统内核的交互。现在WDF则将驱动程序 与操作系统内核之间进行了分离,驱动程序与操作系统交互工作交给框架内封装的方法(函数)完成,这样驱动开发者只需专注处理硬件的行为即可。这不仅避免了 顾此失彼两面不周的弊端,也由于双方的分离,对操作系统内的某些改动,硬件制造商配套驱动程序的开发都有莫大的好处。
5、   两种模式的驱动程序(KMDF、UMDF)都使用同一环境进行构建,这一环境称为WDK。
      即KMDF,UMDF的开发环境为WDK。

Windows Device Kit (WDK): 把测试套件(test suites)集成进来,DDK 就成了WDK。WDK是针对微软操作系统系列的驱动器集成开发系统。它组合了Windows DDK和Hardware Compatibility Test (HCT) kits(硬件兼容性测试工具),同时提供了微软内部用来测试Windows操作系统稳定性和可靠性的测试套件。

6、   虽然经过封装并引入基于对象的技术,所开发的驱动程序在执行效率上并不比原来逊色。
Driver Development Kits: The Unified Release
I has been a couple of months since my last post, and with this entry I would like to spot some changes that I have noticed from Microsoft and that I had been asking since the Windows Server 2003 SP1 Beta. Previously to the soon to be released WDK (Windows Driver Kit), there were many kits needed for driver development on the Windows Platform:
 
  • DDK (Driver Development Kit), this is the main kit where you can develop most of the drivers. Previously it was paid, now it is free (thanks for listening Microsoft), get it here.
  • IFS Kit (Installable File Systems Kit), this kit is for kernel mode file system and file system filter driver models, used by many anti-virus products to develop file system watchers. I have always been paid, unless you have an MSDN subscription. Do not get it!!! Note to Microsoft: "Release the ISO image like you did with the DDK".
  • HCT Kit (Hardware Compatibility Test), this kit provides a test suite for platforms and devices covered by the "Designed for Windows" logo program. The HCT contains test cases for a wide variety of device classes. You can get it here for free!!
  • DCT Kit (Display Compatibility Kit), this additional test kit provides tests for compliance with the Microsoft DirectX 7, DirectX 8.1a, and DirectX 9.0c specifications, for hardware that runs with Windows XP and Windows Server 2003. You can get it here for free!!!
These packages were the standard ones required to build a driver of any kind and to test it. I would like to mention that there was not integration with Visual Studio, specifically Visual C++ 2002/2003/2005. Only there is a console build environment, however you can customize a project to build a driver from within Visual Studio.
 
During the last years Microsoft has been working on the WDF (Windows Driver Foundation), an approach to a single driver model for the creation of kernel mode and user mode drivers plus driver verification tools. These are its components:
 
  • KMDF (Kernel Mode Driver Framework): A framework for developing kernel mode drivers. You can get it here for free!!!
  • UMDF (User Mode Driver Framework): A framework for developing user mode drivers. You can get it here for free!!!
  • WDF Driver Verification Tools: Are included in the KMDF. 
But there is more, the WDK (Windows Driver Kit) is a fully integrated driver development system for the Microsoft Windows family of operating systems. It combines the Windows DDK and the Hardware Compatibility Test (HCT) kits, and also provides tests that Microsoft uses to test the stability and reliability of the Windows operating system. So the equation will be like this:
 
 
WDK = DDK (Driver Development Kit) + HCT Kit (Hardware Compatibility Test) + WDF (Windows Driver Foundation) + DTM (Driver Test Manager) + WDF Driver Verification Tools + IFS Kit (Installable File Systems Kit) + Free ISO image download - Visual Studio 2005 out of the box integration
 
I think this is a major step in in the evolution of driver development in the Windows Platform. Other OSs like Linux and some Unix flavors feature kernel sources but not a clear API documentation, build environment and driver quality tools like the WDK. The WDK will simplify many issues. However I believe that there is a lot of work to do in order to make driver development go mainstream (independent of the technical skills required). Kudos to Microsoft and to the DDK Team for listening.
 
 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值