Excerpt-system architecture for native Device Drivers

Source: Internet
Author: User

The sample device drivers encoded with the Windows CE platform builder come in two forms: Monolithic And Layered . Source code for a monolithic driver consists of both interrupt service thread code and platform specific code. in contrast, layered device drivers split the code into an upper layer called the Model Device Driver (MDD) and a lower layer called the platform dependent Driver (PDD ). the MDD layer contains code that is common to all drivers of a given type. the PDD layer consists of the code that is specific to a given hardware device or platform. the mdd cils specific PDD routines to access the hardware or hardware specific information. when using a layered driver, the OEM reuses the common MDD Code provided by Microsoft in the Windows CE platform builder, and only writes New PDD code that is specific to the OEM's hardware. or, if porting one of Microsoft's sample drivers to new hardware, the OEM only needs to port the PDD layer; the MDD layer can be used as-is.

The layered driver style is not required and may not be appropriate for all drivers. in particle, splitting device driver code into two layers imposes additional function call overhead in the device driver's operation. for performance critical situations, a monolithic driver may be more appropriate.

The following validation shows the integration of monolithic and layered drivers within the Windows CE operating system.


Microsoft provides the MDD for a layered driver. The MDD is common to all platforms and functions, both as source code and as a library. It performs the following tasks:

·Links to the PDD layer and defines the ddsi functions it expects to call in that Layer

·Exposes different sets of functions-ddi functions-to the Operating System

·Handles complex tasks, such as Interrupt Processing

Each MDD handles a specific set of devices, such as audio hardware or touch screens.

As shown in the previous authentication, the device driver interface (DDI) is a set of functions exposed by an MDD layer or monolithic driver and called by other OS modules. the device driver Service Provider Interface (ddsi) is a set of functions exposed by the PDD layer of a layered device driver and called by the MDD. classes of related device drivers can share the same DDI-for example, the DDI exposed by stream interface drivers is the set of Stream interface functions. all stream interface drivers expose those same functions, although certainly their implementations and behavior can be different from one stream interface driver to the next.

In contrast, ddsi layers are rarely the same from one PDD implementation to another. PDD implementations are designed to work with specific MDD implementations, and as such can vary widely from one layered device driver to the next. an exception is in cases where a single MDD layer is capable of using multiple PDDs, in which case the PDDs cocould expose the same set of ddsi functions. for example, a serial port MDD layer that supported multiple PDDs for controlling different types of serial port hardware, such as a 16550 UART based serial port and an infrared serial port, might require its PDDs to expose the same set of ddsi functions. in some of the sample device drivers provided with the Windows CE platform builder version 3.0, the DDI and ddsi implementations are declared in files called DDI. H and ddsi. h In the drivers 'sample Code Directories.

In general, the MDD requires no changes. if you choose to modify the MDD, be aware that Microsoft does not test, warrant, or support custom MDDs. you are responsible for all further MDD maintenance if Microsoft supplies an updated MDD in order to fix bugs or to support later versions of Windows CE. in addition, if you revise the MDD, you must provide support to any ihvs who use those changes.

Unlike the MDD layer, the PDD layer must be written specifically to your target platform. the PDD generally consists of functions that perform specific discrete tasks. these functions serve to isolate the MDD from the specifics of the hardware. because the PDD is hardware-dependent, you must create a customized PDD for your platform hardware, or port one of Microsoft's sample PDD layers to your hardware. to assist you, Microsoft provides several sample PDD layers for varous built-in devices.

You can forego the MDD and PDD layers by implementing your device driver as a monolithic driver. for example, if performance is a critical factor, a monolithic driver might be a better choice than a layered driver because a monolithic driver avoids the overhead associated with the function CILS that take place between the MDD and PDD layers. you might also choose to implement a monolithic driver if the capabilities of the device in question are well matched to the tasks that the functions in the MDD layer perform. in such a case, implementing a monolithic driver might be simpler and more efficient than implementing a layered driver. however, regardless of whether you implement a monolithic driver or a layered driver, you can base your implementation on the source code for any of the sample layered drivers.

Finally, some of the sample device drivers are implemented as stream interface drivers, Which just means that they use the stream interface functions as their DDI. they exist as ordinary DLLs and are loaded as needed. the audio driver and serial port driver are good examples of a device driver using the stream interface model. because these drivers have an MDD and PDD that you can use as a basis for your development efforts, they are stored here in the native device driver section, rather than inDeveloping stream interface device drivers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.