OEM control functions in WinCE eboot

Source: Internet
Author: User
Tags bool

There are many functions that begin with OEM in Eboot, which are called directly or indirectly by the Blcommon module to perform the function. These OEM functions are what we need to implement on our own platform. It can be said that the implementation of these OEM functions, Eboot function is completed.

There are many OEM functions in eboot, some must be implemented, some do not need to be implemented, and some are based on the functional requirements of your eboot to decide whether to implement. The following is an introduction to OEM control functions called directly by Blcommon:

1. void Oemdebuginit (void)

This should be the first OEM function invoked to initialize the serial port to print debug information. Here's a reference to another function called Oeminitdebugserial, which is the function used to initialize the serial port in OAL. So it's generally possible to implement the Oeminitdebugserial function and then call it in Oemdebuginit. In fact, this is just an initialization function, if you want to implement serial debugging, you need to implement several other functions, as follows;

Oemwritedebugstring

Oemwritedebugbyte

Oemreaddebugbyte

The above three functions are described in my previous blog, "Introduction to the implementation of printing information in WinCE BSP", which is not repeated here.

2. BOOL oemplatforminit (void)

This function is used to initialize the hardware platform, which is to tell the truth about the hardware board peripherals. The RTC is typically initialized first, then initializes the Nandflash controller, initializes the hardware interrupt, initializes the network card, and, if necessary, initializes the display and displays a logo. The following is the template provided by Microsoft for this function:

1.BOOL oemplatforminit (void)
2.{
3. BOOL FRet = FALSE;
4. Boot_args *pbootargs;
5. Eth_hardware_settings *pedbgsettings;
6. Edbg_addr *pmyaddr;
7.
8.
9.//print version number and time date information
Edbgoutputdebugstring ("Microsoft Windows Embedded CE Ethernet Bootloader%d.%d for Platform Example (%s%s) \ n", Eboot_version_major,eboot_version_minor, __date__, __time__);
11.
12.
13.//Initialize boot boot parameter information in driver Globals area
Pbootargs = (boot_args*) Boot_args_physical_memory_start;
memset (Pbootargs, 0, sizeof (Boot_args));
16.
Pbootargs->dwsig = Bootarg_sig;
Pbootargs->dwlen = sizeof (Boot_args);
Pbootargs->dwedbgdebugzone = Edbgdebugzone;
20.
21.//Add key input to judge, allow user to enter shell
if (waitforkeypress ())
23. {
24.//Allow users to set up network-related information, such as IP address
Loadermainmenu ();
26.}
27.
28.//Initialization of Ethernet controller
Pedbgsettings = &pBootArgs->Edbg;
FRet = Initethernet (pedbgsettings);
31.
if (!fret)
33. {
Edbgoutputdebugstring ("Error:ethernet initialization failed\r\n");
Spinforever ();
36.}
37.
PMYADDR = &pEdbgSettings->Adapter.Addr;
Edbgoutputdebugstring ("Info:debug Ethernet MAC Address:%b:%b:%b:%b:%b:%b\r\n", Pmyaddr->wmac[0] & 0x00ff, Pmyaddr->wmac[0] >> 8,
PMYADDR->WMAC[1] & 0x00ff, pmyaddr->wmac[1] >> 8,
PMYADDR->WMAC[2] & 0x00ff, pmyaddr->wmac[2] >> 8);
42.
return (TRUE);
44.}
45.
46.
47.

3. DWORD oempredownload (void)

This function is typically used to initialize the network and initialize TFTP for downloading wince image. First call the Oalkitlcreatename function to create the device name based on the MAC address. Then determine if it is DHCP and assign an IP address. Call the Ebootinitethertransport function to initialize TFTP, which belongs to the EBOOT module code, which can be found under "\wince600\public\common\oak\drivers\ethdbg\eboot", The function returns PFJUMPIMG and returns the value as the Oempredownload return value, deciding whether to download wince image or jump execution directly.

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.