Partager via


Startup and Initialization Code Implementation

When you port the boot loader to a target device, modify the target device initialization code in %_WINCEROOT%\Platform\<Platform Name>\Eboot\Eboot\Main.c. The initialization code varies depending on whether the target device can boot to an image that is already on the device (for example, in flash RAM) or whether it must always boot to the boot loader.

If a target device does not support boot selection and always boots to the boot loader, the boot loader must not corrupt the object store or system RAM.

The boot loader uses initialization code that is similar to the OAL (or shared with the OAL). The boot loader StartUp function performs power-on initialization, sets up the stack, and then calls the main function. The startup function also sets up the microprocessor by initializing the cache and boot loader's read/write data area and checking for any hardware switches that allow entry to the boot loader's firmware monitor.

The following code example, which describes the algorithm of themain boot loader function on the target device, shows the sample initialization code.

Initialize monitor port     // Platform-specific functions 
Send version information through the serial port 
Run Power On Self Test (POST) 

If POST passes        // POST returns 1 
   If autodownload  
      Download image 
      Jump to image entry point
   Else 
      Jump to existing image entry point
   Endif
Endif

See Also

Implementing the Boot Loader StartUp Function | Ethernet Boot Loader

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.