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

Debugger Options

If you enabled support for one or more debuggers in the OS design, the debugger names will appear as options in the Debugger list box. By default, the following debugger options are available:

■ Sample Device Emulator eXDI2 Driver This is a sample Extensible Resource Identifier (XRI) Data Interchange (XDI) driver included in Windows Embedded CE 6.0 R2. XDI is a standard hardware-debugging interface.

■ KdStub This is the Kernel Debugger. KdStub stands for kernel debugger stub, which instructs Platform Builder and Visual Studio to use the software debugger.

■ CE Dump File Reader If you added the Error Report Generator catalog item to your OS design, you can use this option for postmortem debugging.

■ None Select this option if you do not want to use a debugger.

Attaching to a Device

Having configured the device connection, you are ready to transfer the run-time image to the target device or device emulator by using the Core Connectivity infrastructure. This is accomplished in Visual Studio 2005 by using the Attach Device command that is available on the Target menu. Even if you do not plan to use KITL or the Core Connectivity infrastructure for debugging, you must attach to the device so that Platform Builder can download the run-time image.

Following the image download, the start process commences, KITL becomes active if enabled on the target device, and you can use the Kernel Debugger to follow the start process, and debug operating system components and application processes. By using KITL, you can also exploit remote tools available in Visual Studio with Platform Builder on the Target menu, such as File Viewer to interact with the device's file system, Registry Editor to access the device's registry settings, Performance Monitor to analyze resource utilization and response times, and Kernel Tracker and other remote tools to view detailed information on the running system. You can find more information about system debugging in Chapter 4, "Debugging and Testing the System."

Lesson Summary

Windows Embedded CE supports run-time image deployment over a variety of device connections to accommodate hardware platforms with varying requirements and capabilities, including Ethernet connections, serial connections, DMA, and USB connections. For example, DMA is the right choice if you want to deploy CE 6.0 R2 on a Device Emulator. You only need to configure the communication parameters and you are ready to deploy Windows Embedded CE by clicking the Attach Device command on the Target menu in Visual Studio 2005 with Platform Builder.

EXAM TIP

To pass the certification exam, you must be familiar with the varioust ways to deploy a Windows Embedded CE run-time image. In particular, make sure you know how to deploy a run-time image for a Device Emulator.

Lab 2: Building and Deploying a Run-Time Image

In this lab, you build and deploy an OS design based on the Device Emulator BSP, analyze the build information in the Visual Studio Output window to identify the start of the various build phases, and then configure a connection to a target device in order to download the run-time image. To demonstrate how to customize a target device, you modify the Device Emulator configuration to support a larger screen resolution and to enable network communication. In a final step, you download the run-time image and attach to the target device with the Kernel Debugger, so you can examine the Windows Embedded CE start process in detail. To create the initial OS design in Visual Studio, follow the procedures outlined in Lab 1, "Creating, Configuring, and Building an OS Design."

NOTE
Detailed step-by-step instructions

To help you successfully master the procedures presented in this Lab, see the document "Detailed Step-by-Step Instructions for Lab 2" in the companion material for this book.

Build a Run-Time Image for an OS Design

1. After completing Lab 1, select Sysgen under Advanced Build Commands on the Build menu in Visual Studio, as illustrated in Figure 2-8. Alternatively, you can select Build Solution under the Build menu, which will perform a build starting with the Sysgen step.

TIP
Sysgen operations

Sysgen operations can take up to 30 minutes to complete. To save time, do not run Sysgen every time you change the OS design. Instead, run Sysgen after adding and removing all desired components.

2. Follow the build process in the Output window. Examine the build information to identify the SYSGEN, BUILD, BUILDREL, and MAKEIMG steps. You can press Ctrl+F to display the Find And Replace dialog box, and then search for the following text to identify the start of these phases:

 a. Starting Sysgen Phase For Project The SYSGEN steps start.

 b. Build Started With Parameters The BUILD steps start.

 c. C:\WINCE600\Build.log The BUILDREL steps start.

 d. BLDDEMO: Calling Makeimg — Please Wait The MAKEIMG steps starts.

3. Open the C:\Wince600 folder in Windows Explorer. Verify that Build.* files exist.

4. Open the Build.* files in a text editor, such as Notepad, and examine the content.

Figure 2-8 Building an OS design

Configure Connectivity Options

1. In Visual Studio, open the Target menu and select Connectivity Options to display the Target Device Connectivity Options dialog box.

2. Verify that CE Device is selected in the Target Device list box.

3. Select Device Emulator (DMA) from the Download list box.

4. Select Device Emulator (DMA) from the Transport list box.

5. Select KdStub from the Debugger list box, as illustrated in Figure 2-9.

Figure 2-9 Setting Target Device Connectivity Options

Change the Emulator Configuration

1. Next to the Download list box, click the Settings button.

2. In the Emulator Properties dialog box, switch to the Display tab.

3. Change the Screen Width to 640 pixels and the Screen Height to 480 pixels.

4. Switch to the Network tab.

5. Select the Enable NE2000 PCMCIA Network Adapter And Bind To check box, then select the Connected Network Card option from the list box, as illustrated in Figure 2-10, and then click OK.

6. Click Apply to save the new device configuration.

7. Click Close to close the Target Device Connectivity Options dialog box.

Figure 2-10 Device Emulator network options

Test a Run-Time Image on the Device Emulator

1. In Visual Studio, open the Target menu, and then click Attach Device.

2. Verify that Visual Studio downloads the run-time image to the target device. The download can take several minutes to complete.

3. Follow the debug messages during the start process in the Visual Studio Output window.

4. Wait until Windows Embedded CE has completed the start process, and then interact with the Device Emulator and test the features of your OS design, as illustrated in Figure 2-11.