Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Microsoft Corporation
June 2000
Summary:This paper introduces the process of developing device drivers for Windows CE. It provides an overview of device-driver architecture, discusses the primary Windows CE device-driver models, and identifies associated APIs and design issues. (12 printed pages)
Introduction
A key aspect of the modular design of Windows CE is that
original equipment manufacturers (OEMs) and independent hardware
vendors (IHVs) can implement device drivers that support their own
hardware without additional support from Microsoft. The versatility
of Windows CE provides a rich opportunity to develop applications
for a wide range of devices, either built-in or installable.
Built-in devices are typically integral to a Windows CE-based
platform and are designed specifically for low-level, built-in
hardware, such as keyboards, display screens, and PC Card sockets.
Installable devices are third-party peripheral devices that can be
connected to a Windows CE-based platform at any time. The Windows CE Driver Development Kit supplies documentation
enabling you to create device drivers for most device classes in
Windows CE. The Driver Development Kit is packaged with the Windows
CE Platform Builder, which contains source code and libraries for
OEMs that build custom Windows CE–based platforms, plus source code
for a number of sample device drivers. OEMs are encouraged to use
these sample device drivers as the basis for their own device
drivers. This white paper provides an overview of device-driver
architecture and discusses the primary Windows CE device
driver. All device drivers in Windows CE are dynamic-link libraries
(DLLs) and primarily use the standard Windows CE APIs (Win32-based)
in their implementations. This is in contrast to drivers on Windows
2000 and Windows 98 where drivers use the Windows Driver Model
(WDM) interfaces and run either in user mode or kernel mode, with
special privileges based on what mode they are in. Understanding
the Windows CE driver model and developing device driver for
Windows CE is generally easier than for Windows 2000 and Windows
98, since the Windows CE driver architecture is significantly less
complex than WDM. Windows CE offers two primary device driver models, which are
unique to the Windows CE operating system, stream interface drivers
and native device drivers. These driver models are differentiated
only by the software interface they support and not by the devices
they serve. The model determines the software interface that any
given driver exports to applications or to other operating system
modules. In addition, Windows CE supports NDIS miniport and protocol
drivers for networking, and USB device drivers for USB-compliant
peripherals. NDIS miniport and protocol drivers must expose
specific NDIS APIs in order to work with the Windows CE networking
infrastructure. Programmers can choose whether to implement a USB
device driver as a stream interface driver or a native device
driver. Please refer to the NDIS and USB sections of this document
for more information. A device driver is code that communicates with a hardware
device. It links the device with the operating system, making the
device available to the operating system and applications through
an interface. Device drivers can access their devices directly if
the devices are mapped into system memory, or they may need to use
the services of lower-level drivers—ones that manage various data
ports on the platform—in order to access devices that connect to
Windows CE through some intermediate hardware connection such as a
serial port or USB port. Windows CE supports two primary device driver models: stream
interface drivers and native device drivers. Stream interface
drivers are ones that implement and expose the standard set of
stream interface functions for use by applications. The stream
interface functions closely map to the semantics of the Win32 file
I/O APIs, so any device that can be treated as if it were a special
file—that is, a producer or consumer of ordered streams of bytes—is
a good candidate for a stream interface driver. Native device
drivers are ones that implement and expose any interface other than
the stream interface functions. The APIs exposed by native device
drivers are most often specifically tailored to the underlying
device's functionality. The characteristics of these models are summarized in the
following table.
Device Driver Models
Device Driver Design
Device Manager
Creating Windows CE Drivers
Loading Windows CE Drivers
Interrupt Handling
Stream Interface Drivers
Native Device Drivers
Developing USB Device Drivers
NDIS Drivers
For More Information
Introduction
Device Driver Models