Blcommon in wince eboot

Source: Internet
Author: User

Author: arm-WinCE

 

In eboot, after you jump from startup. s to the C program entry, the program can be written in C language, which is much better. Generally, the C language entry is a main function, which may also be called another name. The bootloadermain function will be used in this main function, which is defined in the blcommon module. Generally, the main function is written as follows:

 

Void (void)

{

// Common Boot Loader (blcommon) main routine.

Bootloadermain ();

 

// Shocould never get here.

Spinforever ();

}

 

As can be seen from the program, after entering the C program, eboot only calls the bootloadermain function. As for spinforever function, it is actually an endless loop of while. We can see that all eboot work is completed in bootloadermain, and the source code can be found in "/wince600/public/common/oak/Drivers/ethdbg/blcommon. Procedure

 

The following describes the specific steps:

 

1. The bootloadermain function first calls the kernelrelocate function to copy the global variables used in bootloader to ram.

2. Call the oemdebuginit function to initialize the debug debugging function. Generally, the serial port is initialized, so that you can use the serial port to print debugging information.

3. Call the oemplatforminit function to initialize the board. Many platform-related initialization tasks can be completed in this function.

4. Call the oempredownload function. In terms of the process, we should make some preparations for downloading the kernel. After the function is executed, you can choose to download the kernel or jump to the execution based on the returned value. In fact, this function first reads the boot configuration information and then initializes the download device, which is generally a NIC device.

5. If the oempredownload function returns bl_download, the wince image will be downloaded from the host.

6. If the oempredownload function returns bl_jump, it will directly jump to the location where the wince image is located to start execution.

 

The OEM functions involved must be implemented by the user and then called by the blcommon module. These functions will be introduced later.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.