Share via


Startup and Initialization Code Implementation (Windows Embedded CE 6.0)

1/5/2010

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 sets up the microprocessor by initializing the cache and the boot loader read/write data area, and by checking for hardware switches that allow entry to the boot loader 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

Tasks

Implementing the Boot Loader StartUp Function

Concepts

Ethernet Boot Loader