Boot Loader Support Libraries (Compact 2013)
10/16/2014
Microsoft provides a number of static libraries in Windows Embedded Compact that can help you significantly shorten your boot loader development time.
BLCOMMON Code Library
The BLCOMMON library, in the %_WINCEROOT%\Platform\Common\Src\Common\Boot\Blcommon directory, implements the basic framework of a boot loader. It handles relocating the boot loader to RAM for faster execution, decoding the .bin file contents, verifying checksums, and keeping track of load progress. The library calls well-defined OEM functions throughout the process to handle hardware platform or solution-specific customizations.
Eboot Code Library
The Eboot library, in the %_WINCEROOT%\Platform\Common\Src\Common\Boot\Eboot directory, provides Dynamic Host Configuration Protocol (DHCP), Trivial File Transfer Protocol (TFTP), and User Datagram Protocol (UDP) services.
The download protocol used by Platform Builder is TFTP. The intent is to hide all Ethernet details behind the scenes for boot loader development.
The Ethernet part of the boot loader can be reduced to the following code:
if (!EbootInitEtherTransport (....)) {
while (1); // spin forever
}
// main loop of download
while (EbootEtherReadData (...)) {
// process the data
ProcessData (...);
}
Bootpart Code Library
The Bootpart library, in the %_WINCEROOT%\Platform\Common\Src\Common\Boot\Bootpart directory, provides storage partitioning routines, which assist the boot loader in partitioning storage, such as flash memory, and reading from or writing to the storage device. The library works with lower-level flash memory access routines. You can use this library to separate multiple BIN regions, or multiple execute in place (XIP) processes, from file system storage areas on a device based on NAND flash memory.
Ethernet Debug Libraries
The Ethernet debug libraries, which are in the %_WINCEROOT%\Platform\Common\Src\Common\Ethdrv\Cs8900a directory, encapsulate the basic initialization and access primitives for a variety of common network controller devices. The interface for the libraries is generic enough that both the boot loader and the OS typically use the interface. The boot loader uses the interface for downloading a run-time image and the OS uses the interface to implement a KITL connection to Platform Builder. For more information about KITL, see Kernel Independent Transport Layer.
The following table shows the location of the sample Ethernet debug drivers.
Library |
Location |
---|---|
oal_ethdrv_am79c973.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\am79c973 |
oal_ethdrv_cs8900a.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\cs8900a |
oal_ethdrv_dec21140.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\dec21140 |
oal_ethdrv_lan91c.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\lan91c |
oal_ethdrv_ne2000.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\ne2000 |
rne_mdd.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\rne_mdd |
oal_ethdrv_rtl8139.lib |
%_WINCEROOT%\platform\common\src\common\ethdrv\rtl8139 |