The true potential of Windows CE lies in its ability to provide a robust, low-cost platform for system integration on custom, non-PC hardware: handhelds, wireless devices, TV applications, terminals, smartcards, even household appliances. Building Powerful Platforms with Windows CE goes beyond Microsoft's documentation to deliver the real-world detail developers need to minimize risk, improve performance, and get to market fast. The authors begin with a detailed overview of Windows CE, its motivation, goals, architecture, design, and implementation. Next, they review the crucial, often-ignored project management issues associated with custom platform development. They introduce Microsoft's Windows CE Platform builder, demonstrate how to quickly create custom builds, and demystify Microsoft CE's confusing boot loader. The book includes a full chapter on building CE Hardware Abstraction Layers, and exceptional step-by-step guidance on designing, implementing, and debugging CE device drivers. Finally, the authors take you further inside the Windows CE build process, show how to extend Platform Builder; and explain how to use Microsoft's Device Driver Test Toolkit to streamline testing.
Table of Contents
(NOTE: Each chapter concludes with a Summary.)
Introduction to the Book.
About the Authors.1. Windows CE Architecture.
Common Executable Format.
Processes and Threads.
Creating Processes and Threads.
Communicating between Processes.
Handling Low Memory Conditions with WM_HIBERNATE.
Graphics, Windowing, and Events Subsystem.
Graphical Device Interface.
Window and Dialog Management.
Manipulating the Registry.
RAPI2. Road Map to Managing a Windows CE Project.
Orbiter: A Windows-Based Terminal.
Is Windows CE the Right Choice?
Windows CE Licensing and Development Model.
Training Your Team.
Identifying Prototyping Opportunities.
Architecture and Design.
Platform Task Discovery.
Public Task Discovery.
Specifying the System.
Creating a Technical Specification.
Creating a Schedule.
Creating and Allocating Tasks.
Adding Duration to Tasks.
Using Milestones to Create a Visible Schedule.
Maintaining a Live Schedule.
Strategies for Version Control and Automated Builds.
Managing New Projects.
A Brand-New Product.
Feature Enhancements to an Existing Product.
A New Product with Platform-Specific Changes.
Windows CE Device Driver Test Kit.
Benchmarking the Device.3. Platform Builder Basics.
Exploring Components in Platform Builder.
Platform Builder Catalog.
Creating a New Platform with the Platform Wizard.
Building and Executing the Platform.
Creating Applications for Your Platform.
Windows CE Project Wizard.
Building the Application.
Testing the Application during Rapid Development.
Running Windows CE on a CEPC.
Debugging Capabilities of CESH.
Integrating New Components into the Image.
Customizing the Build Using Environment Variables.
Extending the Platform Builder Catalog.
Component Files in Depth.
Adding a Component to the Catalog.
Creating a New Board Support Package.
BSP File Directives.
Finishing the New BSP: Appliances.4. The Windows CE Boot Loader.
Windows CE Boot Loaders.
Designing a CE Boot Loader.
Beginning with the Sample Code.
Processor Configuration Code.
Platform Configuration Code.
Initializing the Contents of RAM.
Loading the CE Image.
Jumping into the CE Kernel Image.
OEM Boot Loader Functions.
Serial Port Input/Output Functions.
Ethernet Boot Loader Functions.
Whether or Not to Ship the Boot Loader in Production Code.
Building the Boot Loader.
Romimage Build Tool.
Running the Build.
Debugging the Boot Loader.
Output through LEDs and Sound.
Serial Port and Parallel Port Output.
ROM Emulator Products.
In-Circuit Emulator.5. OAL Development.
OAL Development: Phase 1.
Building the OAL.
Kernel Startup Routine and OEMWriteDebugLED.
OEMInitDebugSerial, OEMWriteDebugByte, OEMWriteDebugString, OEMReadDebugByte, and OEMClearDebugCommError.
OAL Development: Phase 2.
Ethernet Kernel Debugging Functions.
Interrupt Service Routines.
OAL Development: Phase 3.
Persistent Registry.6. Writing Device Drivers: Introductory Concepts.
When to Write a CE Device Driver.
Onboard and Installable Devices Compared.
Device Driver Models.
Device Driver Architecture.
Microsoft Products Required for Driver Development.
Sample Device Driver Source Code.7. Writing Device Drivers: Driver Models.
Stream-Interface Device Driver Model.
Device Manager and Driver Control Programs.
When to Write a Stream-Interface Driver.
Device File Names.
Required Entry Points.
Application-Initiated Loading. AHEADS = Native Device Driver Model.
Native Device Driver Model Architecture.
Required Entry Points.
Building a Native Device Driver.
USB Device Driver Model.
USB Device Driver Model Architecture.
Required Entry Points.
Providing Application Services.
NDIS Device Driver Model.
NDIS Device Driver Model Architecture.
Building the Device Driver.
Building from the Command Line with the Platform Builder.
Building with the Platform Builder IDE.
Building with eMbedded Visual C++.
Device Driver Installation.
Cabwiz.exe CAB Files.
Ceappmgr.exe INI Files.
User Requested.8. Writing Device Drivers: Implementation Practices.
The Interrupt Service Thread.
Accessing the Physical Resources of Your Device.
Managing Buffer Pointers.
Sharing Memory between Drivers and Applications.
Shared Memory Approaches Compared.
API Readiness.9. Debugging Device Drivers.
Log-Level, Application-Level, Kernel-Level, and Hardware-Level Debugging.
Driver (DLL) Debugging.
Breakpoint and Single-Stepping Issues.
Platform Builder Remote Connections.
Building a Device Driver for Debugging: Method 1.
Step 1: Selecting Modules from the Catalog Window.
Step 2: Modifying Platform.bib.
Step 3: Modifying Platform.reg.
Step 4: Setting Up a Stub Project.
Building a Device Driver for Debugging: Method 2.
Step 1: Removing Modules from the Catalog Window.
Step 2: Creating a Driver Project.
Step 3: Adding the Driver Source Modules to the Project.
Step 4: Modifying the DLL Entry.
Step 5: Modifying Platform.bib.
Step 6: Modifying Platform.reg.
Debugging Use Cases.
Custom Platform Serial/Parallel Port Debugging Configuration: Use Case 2.
Standard Platform Serial Port Debugging Configuration: Use Case 3.
Tracking Processes and Threads.
Log Tracer.10. The Windows CE Build Process.
Components and Modules Revisited.
The Directory Structure of Platform Builder.
Setting Up the Build Process.
How Wince.bat Works.
Building a Project.
Generating the Windows CE System: Sysgen.bat.
Windows CE Initialization Files.
The CE Component Filter.
How Sysgen.bat Works.
Building OEM Source Code: Build.exe.
Building the Release: Buildrel.bat.
Making the Windows CE Image: Makeimg.exe.
Windows CE Localization.
Merging Initialization Files.
Creating the Final Image.11. Building a Sample Windows CE Project.
Brewster: A Coffee Maker for the Millennium.
The Brewster Makefile.
Specifying System Modules and Components.
Modifying the Initialization Files.
Adding Source Code to Brewster.12. Device Driver Test Kit.
Tux Test Harness.
Passing Information to the Test Harness.
The Test Function.
Executing a Test.
Running the Test in Multiple Threads.
Running Tests from Tux.
Logging Tux Test Results.
Creating a Kato Object.
Starting a Level.
Sending Traces for Logging.
Filtering Logs with Verbosity.
Ending a Level.
The Tux Demo Program.Appendix A: Windows CE Modules and Components. Appendix B: A Makefile Primer.
Command-Line Options.Appendix C: CE Developer Resources.
Windows CE System Integrators.
CE Reference Platform Vendors.
ROM Emulation Tools.
PCMCIA Documentation Sources.Appendix D: An Introduction to Writing Windows CE Display Drivers by Jeff Spurgat</I>.
Fundamentals of Graphics and Display Hardware.
Display Driver Overview.
Graphics Primitive Engine Classes.
Improving the Display Driver Classes.Bibliography. Index.
Building Powerful Platforms with Windows CE is a comprehensive, practical guide on the use of the Microsoft Windows CE<©> Platform Builder. Drawing on the authors' extensive industry experience, this book provides proven methods and real-world advice for the complete system integration of Windows CE on various platforms. It also examines how to adapt Windows CE to support a platform's unique features.
This book describes the Windows CE architecture in depth, explaining the rationale behind its design. It shows how to use the Platform Builder to quickly create a custom build of the Windows CE kernel and explores the complex and powerful Windows CE build process. Extensive information is provided on designing, implementing, and debugging Windows CE device drivers. A utility called the Driver Mapper is presented as an example device driver that doubles as a valuable tool for debugging device drivers on standard CE devices (e.g., H/PC<©>, H/PC Pro<©>, and Palm-sized PC<©> devices.
Other valuable features include the following:
- A project leader and manager's guide to the steps involved in completing a CE custom platform project
- Creating and debugging a CE boot loader
- Modifying the Platform Builder's OEM Adaptation Layer (OAL) sample source to work with a newly developed platform.
- An introduction to writing CE display drivers.
- Automated testing with the Windows CE Device Driver Test Toolkit (DDTK)
- A simplified, automated build process for creating ROM images
If you want to get Windows CE running on your platform, you will find this hands-on guide an indispensable resource for accelerating your progress and saving you much frustration!
James Y. Wilson is Director of Software Engineering at Cruise Technologies, Inc., and has over ten years experience in developing Windows NT, 9X drivers and embedded system software from conception to delivery. Aspi Havewala has extensive experience in developing and debugging device drivers for Windows NT and 9x in real-time applications. He is Section Manager/Lead Engineer developing Windows CE systems for Motorola's Land Mobile Products Sector. The authors developed the first CE-based wireless Windows terminal.