Выбрать главу

Exam objectives in this chapter:

■ Creating and customizing OS designs

■ Configuring Windows Embedded CE subprojects

■ Cloning components

■ Managing catalog items

■ Generating a Software Development Kit (SDK)

Before You Begin

To complete the lessons in this chapter, you must have the following:

■ At least some basic knowledge about Windows Embedded CE software develop­ment.

■ A basic understanding of the directory structure and build process of Platform Builder for Windows Embedded CE 6.0 R2.

■ Familiarity creating binary Windows Embedded CE run-time images and downloading run-time images to target devices.

■ Experience using an SDK to develop applications for Windows Embedded CE.

■ A development computer with Microsoft Visual Studio 2005 Service Pack 1 and Platform Builder for Windows Embedded CE 6.0 installed.

Lesson 1: Creating and Customizing the Operating System Design

You can use Platform Builder in Visual Studio 2005 to create an OS design with as many or as few of the features available in Windows Embedded CE 6.0 R2 as you find necessary for your specific purpose. For example, you can create an OS design for a particular target device, such as a portable multimedia device, and another OS design for a remotely programmable wireless-enabled digital thermostat. These two target devices might rely on the same hardware, but the purposes of the devices are different and so are the corresponding OS design requirements.

After this lesson, you will be able to:

■ Understand the role and specifics of an OS design.

■ Create, customize, and use OS designs.

Estimated lesson time: 30 minutes.

Operating System Design Overview

The OS design defines the components and features contained in a run-time image. Essentially, it corresponds to a Visual Studio with Platform Builder for Windows Embedded CE 6.0 R2 project. The OS design can contain any or all of the following elements:

■ Catalog items, including software components and drivers

■ Additional software components in the form of subprojects

■ Custom registry settings

■ Build options, such as for localization or debugging based on Kernel Independent Transport Layer (KITL)

Additionally, every OS design contains a reference to at least one Board Support Package (BSP) with device drivers, hardware-specific utilities, and an OEM adaptation layer (OAL).

Creating an OS Design

Windows Embedded CE includes an OS Design Wizard, which, as the name suggests, provides a convenient way to create OS designs. To launch it, start Visual Studio 2005 with Platform Builder for Windows Embedded CE 6.0 R2, open the File menu, then point to New, and then click Project to display the New Project dialog box. In this dialog box, under Project Types, select Platform Builder for CE 6.0; and under Visual Studio Installed Templates, select OS Design, enter a name for the OS design in the Name field, and then click OK to start the Windows Embedded CE 6.0 OS Design Wizard.

The OS Design Wizard enables you to select a BSP and a design template with commonly used options and preselected catalog components. Any settings that you specify within the wizard you can also modify later, so don't worry about the individual settings too much for now. Depending on the template that you select on the Design Templates page, the OS Design Wizard might display an additional Design Template Variants page with more specific options related to the selected template. For example, Windows Thin Client, Enterprise Terminal, and Windows Network Projector are all devices that use the Remote Desktop Protocol (RDP) and are therefore variants of the same Thin Client design template. Depending on the selected template and variant, the OS Design Wizard might display additional pages to include specific components in the OS design, such as ActiveSync®, WMV/MPEG-4 video codec, or IPv6.

The OS Design Template

A CE 6.0 OS design template is a subset of the catalog components required to use Windows Embedded CE for a particular purpose. It is not necessary to start from a template when creating a new OS design, although it can save a significant amount of time to do so. It is straightforward to change catalog components later by selecting them in the Catalog Items View.

Choosing an appropriate template can save you development time and effort. For example, you might have to demonstrate the features of a new development board at a trade show. In this case, it is a good idea to start with the PDA Device or Consumer Media Device design template and add the required components and common Windows applications in the OS Design Wizard, such as the .NET Compact Framework 2.0, Internet Explorer®, and WordPad. On the other hand, if you are developing a driver for a Controller Area Network (CAN) controller, it might be better to start with the Small Footprint Device design template and only add what's absolutely necessary to minimize the size of the run-time image and to keep startup times at a minimum.

The OS Design Wizard is flexible and supports custom design templates. Template files are Extensible Markup Language (XML) documents, located in the %_WINCEROOT%\Public\CEBase\Catalog folder. You can start with a copy of an existing Platform Builder Catalog XML (PBCXML) file and modify the PBCXML structures according to your specific needs. Platform Builder automatically enumeates all .pbcxml files in the Catalog folder when you start Visual Studio or refresh the Catalog Items View in Visual Studio.

OS Design Customization with Catalog Components

After completing the OS Design Wizard, it is straightforward to customize the OS design. The catalog is a repository for all the components that can be added to an OS design. It is accessible directly from within the integrated development environment (IDE). Click Catalog Items View in the Solution Explorer window pane. Almost every CE feature is divided into separate user-selectable catalog components, from ActiveSync to TCP/IP. You can select these components directly in the UI. Each catalog item is a reference to all the components necessary to build and integrate a feature into the run-time image.

When you add a catalog item that depends on other catalog items, you implicitly add these items as dependencies to the OS design as well. The Catalog Items View shows these items with a green square in the check box to indicate that they are part of the OS design due to existing dependencies. In contrast, the Catalog Items View shows manually selected items and items included based on a design template with a green check mark.

In the Catalog Items View, you can show all catalog components or enable a filter to display only selected catalog items. Click the downward arrow on the Filter button in the top left corner of the Catalog Items View in Solution Explorer to apply a filter or select the option All Catalog Items in the catalog to display the complete list of catalog items.

Provided that you know the name of the catalog item or the SYSGEN variable a component sets, you might find it more convenient and faster to search for the desired catalog item that you want to add or remove than to look for it manually. To search by item name or SYSGEN variable, type the search term into the text box at the top of the Catalog Items View and click the green arrow next to it.

To analyze the dependencies of a catalog item, you can right-click the item and select Show Dependencies to display the Catalog Item Dependencies window, as illustrated in Figure 1-1. For example, you can use this feature to see the reason for the inclusion of a specific catalog item as a dependency. In CE 6.0 R2, Platform Builder dynamically traverses the catalog to enumerate all components that depend on the selected item as well as all components that this item depends on.