Home > Store

Building Powerful Platforms with Windows CE

Register your product to gain access to bonus material or receive a coupon.

Building Powerful Platforms with Windows CE

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

Description

  • Copyright 2000
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-61636-X
  • ISBN-13: 978-0-201-61636-1

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!



020161636XB04062001

Downloads

CD Contents

Download the CD Contents from this book.

Extras

Related Articles

Kick Start Your Windows CE Project

Resources for Windows CE Developers

Author's Site

Click below for Author's Site related to this title:
Author's Web Site

Sample Content

Downloadable Sample Chapter

Click below for Sample Chapter related to this title:
wilsonch3.pdf

Table of Contents

(NOTE: Each chapter concludes with a Summary.)

Preface.

Introduction to the Book.

Web References.

Acknowledgments.

About the Authors.



1. Windows CE Architecture.

Cross-Processor Support.

Page Size.

Common Executable Format.

Processes and Threads.

Creating Processes and Threads.

The Scheduler.

Synchronization.

Communicating between Processes.

Memory Architecture.

Virtual Memory.

Slot Architecture.

Manipulating Memory.

Heap Memory.

Stack Memory.

Handling Low Memory Conditions with WM_HIBERNATE.

Graphics, Windowing, and Events Subsystem.

Graphical Device Interface.

Window and Dialog Management.

User Input.

Windows Messaging.

Power Management.

File System.

Object Store.

Storage Media.

Manipulating Files.

Manipulating Folders.

Manipulating Databases.

Manipulating the Registry.

Communications.

Serial.

TAPI.

RAS.

SLIP/PPP.

TCP/IP.

Winsock.

NetBIOS.

WNet.

WinInet.

Web Server.

RAPI



2. Road Map to Managing a Windows CE Project.

Orbiter: A Windows-Based Terminal.

Is Windows CE the Right Choice?

Platform Requirements.

Windows CE Licensing and Development Model.

Development Environment.

CE Toolkits.

Development Tools.

Training Your Team.

Getting Started

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.

Task-Complete Demos.

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.

Testing.

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.

Kernel Debugging.

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.

Decomposition/Analysis/Modification.

Beginning with the Sample Code.

Startup Code.

Processor Configuration Code.

Platform Configuration Code.

Initializing the Contents of RAM.

Power-On Self-Test.

Loading the CE Image.

Downloading Code.

Jumping into the CE Kernel Image.

OEM Boot Loader Functions.

Serial Port Input/Output Functions.

LED Function.

Ethernet Boot Loader Functions.

Whether or Not to Ship the Boot Loader in Production Code.

Building the Boot Loader.

Sources File.

Boot.bib.

Romimage Build Tool.

Running the Build.

Debugging the Boot Loader.

Output through LEDs and Sound.

Serial Port and Parallel Port Output.

Display Output.

ROM Monitor.

ROM Emulator Products.

On-Chip Debugging.

Logic Analyzer.

In-Circuit Emulator.



5. OAL Development.

OAL Architecture.

OAL Development: Phase 1.

Sample OALs.

Building the OAL.

Kernel Startup Routine and OEMWriteDebugLED.

OEMInit.

Timer ISR.

OEMInitDebugSerial, OEMWriteDebugByte, OEMWriteDebugString, OEMReadDebugByte, and OEMClearDebugCommError.

OAL Development: Phase 2.

Ethernet Kernel Debugging Functions.

Interrupt Service Routines.

Nested Interrupts.

OEMIOControl.

OAL Development: Phase 3.

Module Certification.

Power Management.

Persistent Registry.



6. Writing Device Drivers: Introductory Concepts.

When to Write a CE Device Driver.

Onboard and Installable Devices Compared.

Device Driver Models.

Device Classes.

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.

Registry Entries.

Device File Names.

Load Sequence.

Power Cycling.

Required Entry Points.

Application-Initiated Loading. AHEADS = Native Device Driver Model.

Native Device Driver Model Architecture.

Required Entry Points.

Automatic Loading.

Building a Native Device Driver.

USB Device Driver Model.

USB Device Driver Model Architecture.

Automatic Loading.

Required Entry Points.

Providing Application Services.

NDIS Device Driver Model.

NDIS Device Driver Model Architecture.

Automatic Loading.

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.

Application Manager.

Cabwiz.exe CAB Files.

Ceappmgr.exe INI Files.

User Requested.



8. Writing Device Drivers: Implementation Practices.

Processing Interrupts.

The Interrupt Service Thread.

Accessing the Physical Resources of Your Device.

Platform-Independent Input/Output.

Managing Buffer Pointers.

Sharing Memory between Drivers and Applications.

Shared Memory Approaches Compared.

API Readiness.



9. Debugging Device Drivers.

Background.

Remote Debugging.

Local Debugging.

Log-Level, Application-Level, Kernel-Level, and Hardware-Level Debugging.

Log-Level Debugging.

Application-Level Debugging.

Kernel-Level Debugging.

Hardware-Level Debugging.

Driver (DLL) Debugging.

Breakpoint and Single-Stepping Issues.

Debugger Transports.

Platform Builder Remote Connections.

Platform Manager.

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.

Alternative Configurations.

Standard Platform Serial Port Debugging Configuration: Use Case 3.

Tracking Processes and Threads.

Zone Debugging.

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.

DDTK Tools.

Tux Test Harness.

Test Scripts.

Test Discovery.

Passing Information to the Test Harness.

Housekeeping Messages.

The Test Function.

Executing a Test.

Running the Test in Multiple Threads.

Running Tests from Tux.

Suite Files.

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.

Defining Targets.

Macros

Makefile Preprocessing.

Command-Line Options.



Appendix C: CE Developer Resources.

Usenet Newsgroups.

Publications.

Web Sites.

Mailing Lists.

Windows CE System Integrators.

Third-Party Tools.

CEPC Vendors.

CE Reference Platform Vendors.

ROM Emulation Tools.

Silicon Vendors.

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.

Preface

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.

Convention

Main Purpose(s)

Examples

Monospace font

To format all listings and to refer to a particular element (i.e., function name, variable, macro, etc.) of a listing, as well as to path and file names.

(1) Beginning of the SHx StartUp routine...
(2) .\PLATFORM\ODO\EBOOT\EBOOT\SHX

Boldface type

To refer to menu items, window names, and new terms.

(1) File | New menu item
(2) New Platform window
(3) A component is a particular functionality...

Italic type

To refer to words as words, to emphasize an important point, and to identify on-screen messages.

(1) The word project in this case...
(2) It is best to follow the dictum, Do not add files you do not own.
(3) The message Copying Platform header files... is displayed...

Angle brackets: < >

To refer to the name of an item or symbol. When you see this notation in a syntax statement, substitute the item or symbol with the data it references, but do not type the angle brackets. If angle brackets appear without surrounding square brackets or braces (described below), the associated data is required.

If you see
<CE Version>\PLATFORM\<Platform Name>\KERNEL\HAL\debug.c and the name of your platform is Sherry and you’re using CEPB version 3.0, you might type "WINCE30\PLATFORM\SHERRY\KERNEL\HAL\debug.c".

Square brackets:

To refer to optional arguments or parameters for commands. You may omit optional arguments and parameters in any command.

If you see
CESH —p <CESH configuration saved in the registry>,
you might type
"CESH —p CEPC" or "CESH".

Braces: { }

To indicate a choice of arguments or parameters for commands. If the arguments appear separated by a vertical line–{ | }–you must select one.

If you see
.\PLATFORM\ODO\BOOTLOAD\{SHX|MIPS},
you might type
".\PLATFORM\ODO\BOOTLOAD\SHX".

Web References

The Addison-Wesley Web site at http://www.aw.com/cseng will provide an updated list of any scheduled appearances by this book’s authors, along with scheduled trade shows for Addison-Wesley and references to book reviews for this book as they become available. The Addison-Wesley Web site specifically dedicated to this book, at http://www.aw.com/cseng/titl es/0-201-61636-X, will provide additional information on this book’s content and an errata section for errors discovered after publication. The same page will include a link to the authors’ Web site, providing general references for Windows CE software development and updates to the book’s accompanying software.



020161636XP04062001

Updates

Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership