Partager via


Startup and Initialization Code Implementation (Windows CE 5.0)

Send Feedback

When you port the boot loader to a target device, modify the target device initialization code in %_WINCEROOT%\Platform\<Hardware Platform Name>\Src\BootLoader\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 memory, 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 hardware switches that allow entry to the boot loader's firmware monitor.

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

Initialize monitor port     // Hardware 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

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.