Tutorial Step 5: Debugging the OS on the CEPC Using the Kernel Debugger

Now that you have downloaded the OS image to the CEPC and booted the OS, you can debug the OS. By default, Platform Builder automatically starts the kernel debugger when the OS boots, and displays the Debug toolbar in the IDE.

To debug the platform, you first need to halt the running OS. Breakpoints cannot be set while the OS is still running. In this step, you use the kernel debugger to debug your custom OS.

To debug the OS on the CEPC using the kernel debugger

  1. On the development workstation, from the Debug menu of the IDE, choose Break. This halts the running OS on the CEPC, which does not respond to user input while in this state.

  2. From the File menu, choose Open.

  3. Browse to %_WINCEROOT%\Public\Common\Oak\DRIVERS\KEYBD\PS2_8042, select ps2mouse.cpp, and then choose Open.

    You have opened the Ps2mouse.cpp file, which contains source code for the mouse driver.

  4. From the Edit menu, choose Find.

  5. In the Find what box, type _move, and then choose Find Next.

    You have jumped to a section of code in the Ps2mouse.cpp file that handles a mouse move event.

  6. Press the F9 key to set a breakpoint in the source code at the mouse move event.

    The red dot in the margin shows that the breakpoint has been set.

  7. From the Debug menu, choose Go.

  8. Move the mouse for the CEPC.

    The breakpoint activates. A yellow instruction point or current instruction arrow appears on the breakpoint symbol.

  9. From the Edit menu of the IDE, choose Breakpoints.

  10. To remove the breakpoint that you set, choose Remove All, and then, choose OK.

  11. From the Debug menu, choose Go.

    You have successfully halted the OS, set and activated a breakpoint in one of the drivers, and then removed the breakpoint. Follow the remaining steps to stop debugging the OS.

  12. From the Debug menu, choose Stop Debugging.

    A dialog box appears, asking whether you want to stop debugging now without disabling the target-side kernel debugger component KdStub.

  13. For the purposes of this tutorial, choose Yes.

    Control returns to the IDE.

  14. From the Target menu, choose Disconnect, and then choose OK.

After you have finished debugging, you are ready to localize your OS image.

See Also

Tutorial Step 6: Localizing the OS Image for the CEPC | Tutorial Step 4: Setting Up a Connection to the CEPC and Downloading the OS Image | Tutorial: Using Platform Builder with a CEPC | Platform Builder Tutorials | Platform Debugging

 Last updated on Wednesday, April 14, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.