How to Use the Command Line to Create, Customize, and Build a Platform

Platform Builder includes a set of command-line tools that the integrated development environment (IDE) calls when it creates, customizes, and builds a run-time image. You can directly call many of these tools from a command-line prompt build window to create and customize a platform that you can use to build a run-time image. Once you have built the run-time image from the command line, you can then use the IDE to download the run-time image to a target device for debugging and testing.

The target device that you select can be either the Emulator or a Windows CE PC-based hardware development platform (CEPC). For information about the Emulator, see Emulator. For information about CEPCs, see How to Set Up a CEPC.

Hardware and Software Assumptions

  • You are familiar with the Platform Builder directory structure. For information about the Platform Builder directories, see Platform and OS Directories.

  • Your CEPC has a mouse or other input device.

  • Your CEPC has an NE2000-compatible Ethernet card. For information about additional configuration if the CEPC Ethernet card has a DMA-compatible Ethernet controller, see article Q317432 at this Microsoft Web site.

  • Your CEPC has 32 MB RAM for a typical release OS image.

  • Your CEPC has 64 MB RAM for debug OS images. Debug OS images can be larger than release OS images, and may require more memory in order to run.

    Note   If your target device is the Emulator, the Emulator does not require additional hardware because it runs on the development workstation.

To track your progress in the following table, select the check box next to each step.

  Step Topic
1. Create a new directory for your platform in the Public directory of your Windows CE installation.

For example, you can create a directory located at C:\WINCE420\Public\MyPlatform.

Not applicable.
2. From a command prompt build window, create a workspace for your platform. Creating a Workspace from the Command-Line
3. Add features to your platform by setting Sysgen and environment variables.

For example, add the end-user application Microsoft FreeCell to your display-based platform by typing the following command.

Set SYSGEN_FREECELL=1

Cesysgen Batch File

How to Check the Dependencies of a Feature

Environment Variables

4. Set a new environment variable to include the directory containing the modified source code that you want to build.

For example, if your modified source code is located in the %_WINCEROOT%\Public\Shell\Oak\<Explorer_name> directory, create the BUILD_OPTIONS environment variable by typing the following command.

Set BUILD_OPTIONS=Explorer_name

Note   Verify that the name of the new build directory is unique compared to all file, directory, and subdirectory names within your %_WINCEROOT% directory. Duplicate names can cause the build system to either skip a directory or improperly locate the binary file that results from the build when the run-time image is created.

Not applicable
5. Set the type of run-time image that you want to build.

For example, set the active image configuration to debug by typing the following command.

Set WINCEDEBUG=debug

This results in a run-time image with debugging enabled, which increases the size of the image, and can affect the time required to complete the build process.

Miscellaneous Environment Variables

Build Configurations

6. Build the run-time image for your platform by typing the following command.
Blddemo -c

This parameter instructs the Build Demo Tool to build source code in the Public and Private trees, and is the same as the build menu option Enable Deptree Build in the IDE. The amount of time that Platform Builder requires to build the run-time image for your platform depends on the size of your platform, and using this parameter results in an uncommonly long initial platform build. Subsequent builds will be shorter.

  • To include later modifications to source code, type the following command, which instructs the Build Demo Tool to execute a clean build, and is the same as the build menu option Rebuild Platform in the IDE.

    Blddemo -c
Build Demo Tool

Master Build Tool

7. Start Platform Builder and load the binary image file, Nk.bin, for your platform.
  • From the File menu, choose Open.
  • In the Files of Type drop-down box choose Kernel Files (.bin;.cem;.lst).
  • Navigate the directory tree to %_FLATRELEASEDIR%, select the file Nk.bin, and then choose Open.
Not applicable
8. Select and configure a connection to a target device.

For information about configuration if your target device is a CEPC, see How to Configure a CEPC to Download an OS Image.

For information about configuration if your target device is the Emulator, see Downloading an OS Image to the Emulator.

Configuring a Connection for Downloading and Debugging
9. Download the run-time image that you have built to the target device. Downloading an OS Image to a Target Device
10. Verify that you have successfully downloaded your run-time image to the target device.
  • In the IDE, verify that the custom debug message appears in the Debug window.

If you have successfully downloaded the run-time image, the OS boots on the target device, and in the IDE, debug messages appear on the Debug tab.

Debug Tab

See Also

Platform Development How-to Topics | Command-Line Tools | About Windows CE .NET | Platform Development | Driver Development | Application Development | How to Duplicate a Public Directory as a Platform Directory

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.