Layered Drivers vs. Monolithic Drivers

来源:互联网 发布:卡通二维码制作软件 编辑:程序博客网 时间:2024/05/22 00:13
Layered Drivers vs. Monolithic Drivers 分层驱动与整体驱动

大多数wince驱动由PDD和MDD组成。一个整体驱动将PDD和MDD结合在一起。
PDD platform dependent driver ;MDD model device driver。
MDD有以下特点:
    包含给定类型器件的所有驱动的通用代码
    调用PDD函数来访问硬件。
    链接到PDD层,并定义MDD希望调用的驱动服务提供者接口DDSI函数。
    暴露驱动接口DDI函数给操作系统。OS的其他部分可以调用这些函数,相关的器件可以共享相同的DDI。整体驱动也暴露DDI接口。
    掌管中断处理
    Provide for reuse by developers.
    Can link to multiple PDDs.
    Generally require no changes.If changed, you might have trouble migrating drivers to future versions
    Contain any interrupt service threads (ISTs).
    
PDD有以下特点:
    由硬件平台特定代码组成
    需要修改,以适应你的硬件平台
    Are designed to work with specific MDD implementations
    暴露MDD调用的DDSI函数
    整体驱动不需要暴露DDSI函数
    

以下列表展示了选择分层驱动和整体驱动的考虑:

    分层驱动仅需修改PDD

    A layered driver adds overhead to function calls in a device driver because the MDD calls into the PDD.

    整体驱动提高驱动性能,因为他将MDD和PDD结合在一层,移除了MDD函数调用PDD的过程

    整体驱动更难移植到未来版本,因为许多驱动被分为PDD和MDD层。

    A monolithic driver can be simpler and more efficient, if the capabilities of your device are well matched to the tasks that the functions in the MDD layer perform.
    Regardless of whether you implement a layered driver or a monolithic driver, you can base your implementation on the source code for any of the sample drivers.

原创粉丝点击