Building Powerful Platforms with Windows CE

by ;
Edition: 1st
Format: Paperback
Pub. Date: 2001-03-29
Publisher(s): Addison-Wesley Professional
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $64.99

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Introduction

Throughout the 1980s and 1990s, technological advances that gave rise to the Internet and wireless communications began to mount a serious challenge to the limited role of a personal computer (PC). Initially visualized as a more personalized extension for large mainframe computers, concealed in mysterious rooms with raised floors and noisy air conditioners, the personal computer soon became the center of home and office computing. Today we are witnessing the emergence of yet another type of computer: portable information appliances, offering even more personalized computing than the personal computer anchored to one’s desktop. These devices are made more powerful not by ever increasing CPU speed and available storage, but by their ability to function as a distributed computer, accessing the world’s most powerful asset, information.

Digital cable and digitized music, voice, and video are some examples of this information, which is made more valuable by access through portable information appliances. Just imagine what would happen if televisions, music entertainment systems, telephones, and camcorders could all work together. New usage models would appear, effectively creating a scenario in which the functionality of these systems acting collectively would exceed their usefulness when acting individually. For example, entire movies could be shot, edited, and produced via an array of interconnected, portable information appliances that worked together to provide online distribution, without the need for physical media. When usage models such as these become reality, they will challenge traditional ways of doing business.

The technological objectives in the engineering of a portable information appliance are quite different from those of a desktop PC. Portable information appliances must be compact, lightweight, and economical, and they must provide a slew of new features–most importantly, connectivity with other information appliances. Established operating systems like Windows, UNIX, MacOS, and Linux, designed for desktops with ever increasing processing and storage capabilities, are often unsuitable for such appliances. A smaller, lightweight, and highly flexible operating system is required.

Microsoft’s solution in this space is the Windows CE operating system. Designed and implemented for devices with limited computing and storage resources, it offers a variety of features that make it possible to create highly specialized, portable information appliances. A small sample of such devices would include industrial controllers, phones, music players, televisions, game consoles, camcorders, organizers, and even compact laptops.

Using Windows CE to create a custom platform is a process that we callBuilding Powerful Platforms with Windows CE. Microsoft’s premier tool for building custom platforms is aptly called Windows CE Platform Builder. This book takes a focused look at the use of this tool and, in exploring its features, outlines the process by which CE is modified to support your platform’s distinguishing features.

We would like to think that this book has something for everyone, and though this may be true, you will undoubtedly find it most useful if you are an engineer working to adapt CE to function on a custom platform. If you are a software engineer dedicated to writing software for a particular device, traditionally known as embedded-systems engineering, your job will be to get CE up and running as soon as possible. Our prime directive in writing this book is to accelerate this process, by giving you an understanding of CE from the perspective of an embedded-systems software engineer. If we are successful, you will be as familiar with CE as you are with your custom platform, and you will be well equipped to avoid any unexpected gotchas.

We have taken great pains to go beyond simply documenting the use of Platform Builder. We treat Platform Builder as a tool that you can use effectively only if you’re equipped with an understanding of certain principles and practices. To this end we have created a set of 12 chapters that will provide you with expertise in a particular principle or practice. Chapter 1 introduces Windows CE–its motivation, goals, architecture, design, and implementation. In Chapter 2 we discuss the often ignored project management aspects of creating a custom platform with Windows CE. This chapter walks the technical lead and/or project manager through the discrete steps involved in completing a CE custom platform project.

Chapter 3 introduces Windows CE Platform Builder. It describes how to use Platform Builder to quickly create a custom build of the Windows CE kernel. In Chapter 4 we demystify the more challenging aspects of creating and debugging a boot loader by analyzing the Platform Builder sample boot loader source code and the various options available for debugging boot loader code. Development of the OEM Adaptation Layer (OAL), the mechanism used by CE to access the hardware of your custom platform, is covered in Chapter 5. Chapters 6 through 9 dissect how to design, implement, and debug Windows CE device drivers.

To put it all together, Windows CE uses a complex and powerful process to build the operating system. This build process is explored in Chapters 10 and 11. In Chapter 12 we detail a little-used feature of Windows CE, the Device Driver Test Kit (DDTK), which can be used to implement automated testing and can be of significant value in the manufacturing process for your custom device.

Four different appendices are provided for additional background on topics of interest to CE developers. Appendix A lists the CE modules that help to document how the functionality of the overall operating system has been partitioned. Appendix B provides a primer on the use of the Nmake tool and the creation of the files needed to manage the build process for any software project. Appendix C provides a list of resources that are helpful in jump-starting the process of making CE operational on your custom platform. This appendix is referenced at various places throughout the book. Appendix D provides an excellent overview of the process of creating CE display drivers.

Document Conventions

Upload versus Download

The terms upload and download are used throughout this book. The Microsoft documentation that accompanies the Windows CE Platform Builder (CEPB) does not distinguish between the uploading and downloading of data and uses these terms interchangeably. In this book we have opted to use both the terms upload and download to describe more accurately what is happening when data is flowing from one location to another. To minimize any confusion on this matter, we will explain how these terms are used in the context of this book.

At times the location of data may correspond to a development workstation, while at other times the device (or target platform) is the focus of your CE development efforts. Consider for a moment that we are describing the flow of data with respect to your development workstation. If data is being sent to your CE device, it is flowing away (upstream) from its source (the development workstation), so it is said to be uploading. In contrast, if data is being received from its source (the CE device), it is flowing into your development workstation (downstream), so it is said to be downloading. The key to remembering the difference is to realize that you can only upload to and download from.

Text Conventions

The following table describes the typographic conventions used throughout the book. These conventions do not apply to listings or figures.

<

Author Biography

James Y. Wilson is an independent software consultant for Quantum Computing, Inc. Aspi Havewala has developed device drivers and application software for all major Windows platforms.

Table of Contents

Preface xv
Introduction to the Book xv
Web References xviii
Acknowledgments xviii
About the Authors xix
Windows CE Architecture
1(36)
Cross-Processor Support
2(2)
Page Size
3(1)
Common Executable Format
3(1)
Processes and Threads
4(6)
Creating Processes and Threads
5(1)
The Scheduler
6(1)
Synchronization
7(1)
Communicating between Processes
8(2)
Memory Architecture
10(4)
Virtual Memory
11(1)
Slot Architecture
11(3)
Manipulating Memory
14(2)
Heap Memory
15(1)
Stack Memory
16(1)
Handling Low Memory Conditions with WM_HIBERNATE
16(1)
Graphics, Windowing, and Events Subsystem
16(6)
Graphical Device Interface
16(1)
Window and Dialog Management
17(1)
User Input
17(1)
Windows Messaging
17(1)
Power Management
18(4)
File System
22(7)
Object Store
23(1)
Storage Media
23(1)
Manipulating Files
24(1)
Manipulating Folders
25(1)
Manipulating Databases
25(2)
Manipulating the Registry
27(2)
Communications
29(8)
Serial
29(1)
TAPI
29(2)
RAS
31(1)
SLIP/PPP
31(1)
TCP/IP
32(1)
Winsock
33(1)
NetBIOS
33(1)
WNet
34(1)
WinInet
34(1)
Web Server
35(1)
RAPI
35(1)
Summary
36(1)
Road Map to Managing a Windows CE Project
37(32)
Orbiter: A Windows-Based Terminal
37(1)
Is Windows CE the Right Choice?
38(2)
Platform Requirements
39(1)
Windows CE Licensing and Development Model
40(1)
Development Environment
41(2)
CE Toolkits
41(1)
Development Tools
42(1)
Training Your Team
43(1)
Getting Started
44(1)
Identifying Prototyping Opportunities
45(2)
Architecture and Design
47(5)
Platform Task Discovery
48(1)
Public Task Discovery
49(1)
Specifying the System
50(1)
Creating a Technical Specification
50(2)
Creating a Schedule
52(8)
Creating and Allocating Tasks
53(6)
Adding Duration to Tasks
59(1)
Using Milestones to Create a Visible Schedule
59(1)
Maintaining a Live Schedule
60(1)
Task-Complete Demos
61(1)
Strategies for Version Control and Automated Builds
61(4)
Managing New Projects
65(2)
A Brand-New Product
65(1)
Feature Enhancements to an Existing Product
65(1)
A New Product with Platform-Specific Changes
65(2)
Testing
67(1)
Windows CE Device Driver Test Kit
67(1)
Benchmarking the Device
68(1)
Summary
68(1)
Platform Builder Basics
69(54)
Exploring Components in Platform Builder
70(5)
Platform Builder Catalog
70(5)
Creating a New Platform with the Platform Wizard
75(3)
Building and Executing the Platform
78(1)
Creating Applications for Your Platform
79(4)
Windows CE Project Wizard
80(2)
Building the Application
82(1)
Testing the Application during Rapid Development
82(1)
Running Windows CE on a CEPC
83(6)
Kernel Debugging
84(3)
Debugging Capabilities of CESH
87(2)
Integrating New Components into the Image
89(4)
Customizing the Build Using Environment Variables
93(9)
Extending the Platform Builder Catalog
102(7)
Component Files in Depth
102(5)
Adding a Component to the Catalog
107(2)
Creating a New Board Support Package
109(13)
BSP File Directives
117(1)
Finishing the New BSP: Appliances
118(4)
Summary
122(1)
The Windows CE Boot Loader
123(60)
Windows CE Boot Loaders
124(1)
Designing a CE Boot Loader
125(34)
Decomposition/Analysis/Modification
126(2)
Beginning with the Sample Code
128(2)
Startup Code
130(2)
Processor Configuration Code
132(6)
Platform Configuration Code
138(2)
Initializing the Contents of RAM
140(1)
Power-On Self-Test
141(3)
Loading the CE Image
144(1)
Downloading Code
144(3)
Jumping into the CE Kernel Image
147(3)
OEM Boot Loader Functions
150(3)
Serial Port Input/Output Functions
153(1)
LED Function
153(1)
Ethernet Boot Loader Functions
154(4)
Whether or Not to Ship the Boot Loader in Production Code
158(1)
Building the Boot Loader
159(14)
Sources File
160(1)
Boot bib
160(7)
Romimage Build Tool
167(5)
Running the Build
172(1)
Debugging the Boot Loader
173(8)
Output through LEDs and Sound
174(1)
Serial Port and Parallel Port Output
175(1)
Display Output
175(1)
ROM Monitor
176(1)
ROM Emulator Products
177(1)
On-Chip Debugging
178(1)
Logic Analyzer
179(1)
In-Circuit Emulator
180(1)
Summary
181(2)
OAL Development
183(36)
OAL Architecture
184(2)
OAL Development: Phase 1
186(12)
Sample OALs
186(2)
Building the OAL
188(1)
Kernel Startup Routine and OEMWriteDebugLED
189(4)
OEMInit
193(1)
Timer ISR
194(2)
OEMInitDebugSerial, OEMWriteDebugByte, OEMWriteDebugString, OEMReadDebugByte, and OEMClearDebugCommError
196(2)
OAL Development: Phase 2
198(12)
Ethernet Kernel Debugging Functions
198(2)
Interrupt Service Routines
200(7)
Nested Interrupts
207(2)
OEMIOControl
209(1)
OAL Development: Phase 3
210(7)
Module Certification
210(3)
Power Management
213(2)
Persistent Registry
215(2)
Summary
217(2)
Writing Device Drivers: Introductory Concepts
219(24)
When to Write a CE Device Driver
220(1)
Onboard and Installable Devices Compared
221(1)
Device Driver Models
221(1)
Device Classes
222(1)
Device Driver Architecture
223(4)
Microsoft Products Required for Driver Development
227(1)
Sample Device Driver Source Code
228(13)
Summary
241(2)
Writing Device Drivers: Driver Models
243(76)
Stream-Interface Device Driver Model
243(37)
Device Manager and Driver Control Programs
244(1)
When to Write a Stream-Interface Driver
245(2)
Registry Entries
247(2)
Device File Names
249(4)
Load Sequence
253(4)
Power Cycling
257(1)
Required Entry Points
257(22)
Application-Initiated Loading
279(1)
Native Device Driver Model
280(9)
Native Device Driver Model Architecture
281(3)
Required Entry Points
284(1)
Automatic Loading
284(3)
Building a Native Device Driver
287(2)
USB Device Driver Model
289(10)
USB Device Driver Model Architecture
290(1)
Automatic Loading
291(3)
Required Entry Points
294(4)
Providing Application Services
298(1)
NDIS Device Driver Model
299(4)
NDIS Device Driver Model Architecture
300(1)
Automatic Loading
301(2)
Building the Device Driver
303(4)
Building from the Command Line with the Platform Builder
303(3)
Building with the Platform Builder IDE
306(1)
Building with eMbedded Visual C++
306(1)
Device Driver Installation
307(11)
Application Manager
207(1)
Cabwiz.exe CAB Files
208(107)
Ceappmgr.exe INI Files
315(1)
User Requested
316(2)
Summary
318(1)
Writing Device Drivers: Implementation Practices
319(22)
Processing Interrupts
319(7)
The Interrupt Service Thread
322(4)
Accessing the Physical Resources of Your Device
326(5)
Platform-Independent Input/Output
329(2)
Managing Buffer Pointers
331(2)
Sharing Memory between Drivers and Applications
333(6)
Shared Memory Approaches Compared
338(1)
API Readiness
339(1)
Summary
340(1)
Debugging Device Drivers
341(64)
Background
342(2)
Remote Debugging
342(1)
Local Debugging
343(1)
Log-Level, Application-Level, Kernel-Level, and Hardware-Level Debugging
344(3)
Log-Level Debugging
344(1)
Application-Level Debugging
344(2)
Kernel-Level Debugging
346(1)
Hardware-Level Debugging
346(1)
Driver (DLL) Debugging
347(2)
Breakpoint and Single-Stepping Issues
349(1)
Debugger Transports
350(6)
Platform Builder Remote Connections
350(2)
Platform Manager
352(4)
Building a Device Driver for Debugging: Method 1
356(1)
Selecting Modules from the Catalog Window
356(1)
Modifying Platform.bib
356(1)
Modifying Platform.reg
356(1)
Setting Up a Stub Project
357(1)
Building a Device Driver for Debugging: Method 2
357(3)
Removing Modules from the Catalog Window
357(1)
Creating a Driver Project
358(1)
Adding the Driver Source Modules to the Project
358(1)
Modifying the DLL Entry
359(1)
Modifying Platform.bib
359(1)
Modifying Platform.reg
360(1)
Debugging Use Cases
360(23)
Custom Platform Ethernet Debugging Configuration: Use Case 1
361(17)
Custom Platform Serial/Parallel Port Debugging Configuration: Use Case 2
378(5)
Alternative Configurations
383(11)
Standard Platform Serial Port Debugging Configuration: Use Case 3
384(10)
Tracking Processes and Threads
394(5)
Zone Debugging
399(4)
Log Tracer
403(1)
Summary
404(1)
The Windows CE Build Process
405(42)
Components and Modules Revisited
405(1)
The Directory Structure of Platform Builder
406(4)
Setting Up the Build Process
410(6)
How Wince.bat Works
411(5)
Building a Project
416(1)
Generating the Windows CE System: Sysgen.bat
417(13)
Windows CE Initialization Files
419(5)
The CE Component Filter
424(5)
How Sysgen.bat Works
429(1)
Building OEM Source Code: Build.exe
430(6)
Building the Release: Buildrel.bat
436(2)
Making the Windows CE Image: Makeimg.exe
438(8)
Windows CE Localization
439(3)
Merging Initialization Files
442(2)
Creating the Final Image
444(2)
Summary
446(1)
Building a Sample Windows CE Project
447(44)
Brewster: A Coffee Maker for the Millennium
447(42)
The Brewster Makefile
450(16)
Specifying System Modules and Components
466(6)
Modifying the Initialization Files
472(16)
Adding Source Code to Brewster
488(1)
Summary
489(2)
Device Driver Test Kit
491(28)
DDTK Tools
492(1)
Tux Test Harness
492(1)
Test Scripts
493(1)
Test Discovery
493(1)
Passing Information to the Test Harness
494(3)
Housekeeping Messages
497(4)
The Test Function
501(2)
Executing a Test
501(1)
Running the Test in Multiple Threads
502(1)
Running Tests from Tux
503(1)
Suite Files
503(1)
Logging Tux Test Results
504(5)
Creating a Kato Object
504(2)
Starting a Level
506(1)
Sending Traces for Logging
507(1)
Filtering Logs with Verbosity
507(1)
Ending a Level
507(2)
The Tux Demo Program
509(6)
Summary
515(4)
Appendix A: Windows CE Modules and Components 519(10)
Appendix B: A Makefile Primer 529(6)
Defining Targets
529(1)
Macros
530(3)
Makefile Preprocessing
533(1)
Command-Line Options
533(2)
Appendix C: CE Developer Resources 535(4)
Usenet Newsgroups
535(1)
Publications
536(1)
Web Sites
536(1)
Mailing Lists
537(1)
Windows CE System Integrators
537(1)
Third-Party Tools
537(1)
CEPC Vendors
537(1)
CE Reference Platform Vendors
537(1)
ROM Emulation Tools
538(1)
Silicon Vendors
538(1)
PCMCIA Documentation Sources
538(1)
Appendix D: An Introduction to Writing Windows CE Display Drivers 539(16)
Jeff Spurgat
Fundamentals of Graphics and Display Hardware
539(2)
Display Driver Overview
541(1)
Graphics Primitive Engine Classes
542(3)
Improving the Display Driver Classes
545(9)
Summary
554(1)
Bibliography 555(2)
Index 557

Excerpts

IntroductionThroughout the 1980s and 1990s, technological advances that gave rise to the Internet and wireless communications began to mount a serious challenge to the limited role of a personal computer (PC). Initially visualized as a more personalized extension for large mainframe computers, concealed in mysterious rooms with raised floors and noisy air conditioners, the personal computer soon became the center of home and office computing. Today we are witnessing the emergence of yet another type of computer: portable information appliances, offering even more personalized computing than the personal computer anchored to one's desktop. These devices are made more powerful not by ever increasing CPU speed and available storage, but by their ability to function as a distributed computer, accessing the world's most powerful asset, information.Digital cable and digitized music, voice, and video are some examples of this information, which is made more valuable by access through portable information appliances. Just imagine what would happen if televisions, music entertainment systems, telephones, and camcorders could all work together. New usage models would appear, effectively creating a scenario in which the functionality of these systems acting collectively would exceed their usefulness when acting individually. For example, entire movies could be shot, edited, and produced via an array of interconnected, portable information appliances that worked together to provide online distribution, without the need for physical media. When usage models such as these become reality, they will challenge traditional ways of doing business.The technological objectives in the engineering of a portable information appliance are quite different from those of a desktop PC. Portable information appliances must be compact, lightweight, and economical, and they must provide a slew of new features-most importantly, connectivity with other information appliances. Established operating systems like Windows, UNIX, MacOS, and Linux, designed for desktops with ever increasing processing and storage capabilities, are often unsuitable for such appliances. A smaller, lightweight, and highly flexible operating system is required.Microsoft's solution in this space is the Windows CE operating system. Designed and implemented for devices with limited computing and storage resources, it offers a variety of features that make it possible to create highly specialized, portable information appliances. A small sample of such devices would include industrial controllers, phones, music players, televisions, game consoles, camcorders, organizers, and even compact laptops.Using Windows CE to create a custom platform is a process that we call Building Powerful Platforms with Windows CE. Microsoft's premier tool for building custom platforms is aptly called Windows CE Platform Builder. This book takes a focused look at the use of this tool and, in exploring its features, outlines the process by which CE is modified to support your platform's distinguishing features.We would like to think that this book has something for everyone, and though this may be true, you will undoubtedly find it most useful if you are an engineer working to adapt CE to function on a custom platform. If you are a software engineer dedicated to writing software for a particular device, traditionally known as embedded-systems engineering, your job will be to get CE up and running as soon as possible. Our prime directive in writing this book is to accelerate this process, by giving you an understanding of CE from the perspective of an embedded-systems software engineer. If we are successful, you will be as familiar with CE as you are with your custom platform, and you will be well equipped to avoid any unexpected gotchas.We have taken great pains to go beyond simply docum

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.