Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15497666
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类:

2009-03-24 15:23:33

Most Windows CE device drivers consist of a platform dependent driver (PDD) and a model device driver (MDD). A monolithic driver combines all PDDs and MDDs into one driver. A layered driver does not combine them.

MDDs have the following characteristics:

  • Contain code that is common to all drivers of a given type.
  • Call PDD functions to access the hardware.
  • Link to the PDD layer and define the device driver service provider interface (DDSI) functions that the MDD expects to call in that layer.
  • Expose device driver interface (DDI) functions to the operating system (OS).

    Other parts of the OS can call these functions. Related devices can share the same DDI. Monolithic drivers also expose the DDI functions.

  • Handle interrupt processing.
  • 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).

PDDs have the following characteristics:

  • Consist of hardware platform specific code.
  • Might require modification for your hardware platform.
  • Are designed to work with specific MDD implementations.
  • Expose the DDSI functions that the MDD calls.

    Monolithic drivers do not expose the DDSI functions.

The following list shows considerations for choosing between implementing a layered driver or a monolithic driver:

  • A layered driver might only require modification to the PDD.
  • A layered driver adds overhead to function calls in a device driver because the MDD calls into the PDD.
  • A monolithic driver improves driver performance because it combines the MDD and PDD into one layer, which removes the MDD's function calls into the PDD.
  • A monolithic driver is more difficult to migrate to future versions of Windows CE because most device drivers that Windows CE includes are divided into a PDD and an 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.

阅读(1474) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~