Thursday, April 6, 2017

WCE7 : BeagleBone Black boot procedure

In a previous article, we described how windows CE theoretically boots. Now, we will focus on BBB's community BSP.

Release files

A release of BBB Windows CE includes 3 files:
  • MLO
  • ebootsd.nb0
  • nk.bin
The three of them are generated by ROMIMAGE (which means that they all have their own TOC).

MLO

This file must be the first file copied to the SD card after being formated.
Behind this name hides an XLDR loader executable small enough to fit into the 63kb of CPU's internal RAM.
In fact, this is the line that generates MLO:
copy /b $(_SRC)\xldrtocsd.raw + $(_TGT)\xldrsd.nb0 $(_TGT)\MLO
A pre-built binary (xldrtocsd.raw) is combined with the result of XLDR build into MLO.
Basically, MLO will initialize the strict minimum on the CPU to be able to copy the ebootsd.nb0 to external RAM.
Here is a complete overview of what XLDR does :

Eboot

Eboot is the standard bootloader of Windows CE. It is customized here to the BBB platform.
It initializes much more peripherals and offers to user an input to configure the boot settings.
Once configured, the boot arguments are saved to IMAGE_SHARE_ARGS_PA memory address so that the operating system can read them.
At the end of processing, all peripherals are turned off by disabling their clock.
Basically, eboot will load nk.bin to external RAM.
Here is a complete overview of what eboot does :

NK.bin

This is the complete image of Windows CE including OAL, kernel.dll and other system binaries.
The startup procedure is similar to eboot. An important part of the boot is not provided in BBB BSP project (kernel.dll) but it is linked from a pre-built binary. With this undefined part, here is what the nk.bin boot procedure looks like :

0 comments:

Post a Comment