How to Create a Device Driver (Windows Embedded CE 6.0)
1/6/2010
After you create an OS design, you can create a device driver for a specific target device to operate under the Windows Embedded CE operating system (OS). You create your driver once you have identified the hardware that you want use with the OS.
Hardware and Software Assumptions
- The sample driver code demonstrated in the following steps is merely a starting point and does not actually work with specific hardware. You must modify the driver code in order for it to function correctly for your target device.
- You are creating a power-managed stream interface driver. For more information about stream interface drivers, see Stream Interface Driver Development Concepts. For more information about power management, see Power Management.
- You are familiar with using the Platform Builder command line build tool. For more information, see Build Tool.
- You are familiar with the driver development tools for Windows Embedded CE. **
Step | Topic |
---|---|
1. Familiarize yourself with the code structure for Windows Embedded CE device drivers. |
|
2. Familiarize yourself with driver development for Windows Embedded CE. |
|
3. If you have not already done so, in the Platform Builder integrated development environment (IDE), create an OS design. |
|
4. Copy the power management development sample driver to your OS design. For example, copy %_WINCEROOT%\Public\Common\Oak\Drivers\PM\Test\Devsample to %_WINCEROOT%\Platform\<your OS design>\drivers\<your driver name>. |
Not applicable |
5. Rename the power management development sample driver files to names that correspond with the intended functionality of your driver. |
Not applicable |
6. Edit the |
Not applicable |
7. Add |
Not applicable |
8. Modify the source code for your driver to implement the correct stream interface functions. The power management development sample includes support for the stream interface functions. The XXX prefix for these functions has been replaced with PDX. |
|
9. If your driver requires functionality in addition to the functionality provided by the stream interface functions, you may choose to implement custom I/O control codes. |
|
10. Verify that the entry points for your driver are exposed correctly. The functions should either be declared using a .def file or by using the The sample .def file for the power management development sample driver is located at %_WINCEROOT%\Public\Common\Oak\Drivers\PM\Test\Devsample\Pmdevsample.def. For more information on the |
Not applicable |
11. Add registry information for your driver to the Platform.reg file for your OS design. For example, you can add the following code example to the Platform.reg file to specify the correct registry information for your driver.
|
|
12. Modify the Platform.bib file for your OS design to include your driver. For example, you can add the following code example to the Modules section of the Platform.bib file to specify the correct location of your driver.
|
|
13. Edit the dirs file for your OS design to include your driver. |
|
14. From %_WINCEROOT%\Platform\<your OS design>\Drivers\<your driver name> in your OS design, build your driver. |
|
15. In the IDE, build your run-time image to include your driver. |
|
16. Test your driver using the Windows Embedded CE 6.0 Test Kit (CETK). |
|
See Also
Tasks
Troubleshooting a Device Driver
Concepts
Layered Drivers vs. Monolithic Drivers
Stream Interface Driver Development Concepts
Other Resources
Device Driver Development How-to Topics
Device Driver Development Overview
Build Tool
Sources File