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

StartUp Entry Point

StartUp Entry Point

Similar to the boot loader, the OAL contains a StartUp entry point to which the boot loader or system can jump in order to start kernel execution and initialize the system. For example, the assembly code for putting the processor in the correct state is usually the same as the code used in the boot loader. In fact, code sharing between the boot loader and the OAL is a common practice to minimize code duplication in the BSP. Yet not all code runs twice. For example, on hardware platforms that start from a boot loader, StartUp directly jumps to the KernelStart function, as the boot loader has already performed the intialization groundwork.

The KernelStart function initializes the memory-mapping tables as discussed in the previous section and loads the kernel library to run Microsoft kernel code. The Microsoft kernel code now calls the OEMInitGlobals function to pass a pointer to a static NKGLOBALS structure to the OAL and retrieve a pointer to an OEMGLOBALS structure in the form of a return value from the OAL. NKGLOBALS contains pointers to all the functions and variables used by KITL and the Microsoft kernel code. OEMGLOBALS has pointers to all the functions and variables implemented in the OAL for the BSP. By exchanging pointers to these global structures, Oal.exe and Kernel.dll have access to each other's functions and data, and can continue with architecture-generic and platform-specific startup tasks.

The architecture-generic tasks include setting up page tables and cache information, flushing TLBs, initializing architecture-specific buses and components, setting up the interlocked API code, loading KITL to support kernel communication for debugging purposes, and initializing the kernel debug output. The kernel then proceeds by calling the OEMInit function through the function pointer in the OEMGLOBALS structure to perform platform-specific initialization.

Table 5-5 lists the platform-specific funtions that Kernel.dll calls and that you might have to modify in your BSP to run Windows Embedded CE on a new hardware platform.

Table 5-5 Kernel startup support functions

Function Description
OEMInitGlobals Exchanges global pointers between Oal.exe and Kernel.dll.
OEMInit Initializes the hardware interfaces for the platform.
OEMGetExtensionDRAM Provides information about additional RAM, if available.
OEMGetRealTime Retrieves time from RTC.
OEMSetAlarmTime Sets the RTC alarm.
OEMSetRealTime Set the time in the RTC.
OEMIdle Puts CPU in idle state when no threads are running.
OEMInterruptDisable Disables particular hardware interrupt.
OEMInterruptEnable Enables particular hardware interrupt.
OEMInterruptDone Signals completion of interrupt processing.
OEMInterruptHandler Handles interrupts (is different for SHx processors).
OEMInterruptHandler Handles FIQ (specific for ARM processors).
OEMIoControl IO control code for OEM information.
OEMNMI Supports a non maskable interrupt (specific to SHx processor).
OEMNMIHandler Handler for non maskable interrupt (specific to SHx processor).
OEMPowerOff Puts CPU in suspend state and takes care of final power down operations.

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


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