Layered Drivers vs. Monolithic Drivers (Windows CE 5.0)
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.
See Also
Device Drivers and the Platform Builder IDE | Driver Development Tools | How to Use the CETK to Test a Driver
Send Feedback on this topic to the authors