Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

StartUp Entry Point and Main Function

StartUp Entry Point and Main Function

The StartUp entry point of the boot loader must be located in linear memory at the address where the CPU begins fetching code for execution because this routine carries out the initialization of the hardware. If the adaptation is based on a reference BSP for the same processor chipset, then most of the CPU-related and memory controller-related code can remain unchanged. On the other hand, if the CPU architecture is different, you must adapt the startup routine to perform the following tasks:

1. Put the CPU in the right mode.

2. Disable all interrupts.

3. Initialize the memory controller.

4. Setup caches, Translation Lookaside Buffers (TLBs), and Memory Management Unit (MMU).

5. Copy the boot loader from flash memory into RAM for faster execution.

6. Jump to the C code in the main function.

The StartUp routine eventually calls the main function of the boot loader, and if the boot loader is based on BLCOMMON, then this function in turn calls BootLoaderMain, which initializes the download transport by calling OEM platform functions. The advantage of using the standard libraries provided by Microsoft is that the modifications required to adapt a BSP to a new hardware platform are componentized, isolated, and minimized.

Оглавление книги


Генерация: 1.238. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз