StartUp Entry Point<\/p> <\/div>
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.<\/p>
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.<\/p>
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.<\/p>
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.<\/p>
Table 5-5 Kernel startup support functions<\/strong> <\/p>
Function<\/th> |
Description<\/th> <\/tr> |
OEMInitGlobals<\/td> |
Exchanges global pointers between Oal.exe and Kernel.dll.<\/td> <\/tr> |
OEMInit<\/td> |
Initializes the hardware interfaces for the platform.<\/td> <\/tr> |
OEMGetExtensionDRAM<\/td> |
Provides information about additional RAM, if available.<\/td> <\/tr> |
OEMGetRealTime<\/td> |
Retrieves time from RTC.<\/td> <\/tr> |
OEMSetAlarmTime<\/td> |
Sets the RTC alarm.<\/td> <\/tr> |
OEMSetRealTime<\/td> |
Set the time in the RTC.<\/td> <\/tr> |
OEMIdle<\/td> |
Puts CPU in idle state when no threads are running.<\/td> <\/tr> |
OEMInterruptDisable<\/td> |
Disables particular hardware interrupt.<\/td> <\/tr> |
OEMInterruptEnable<\/td> |
Enables particular hardware interrupt.<\/td> <\/tr> |
OEMInterruptDone<\/td> |
Signals completion of interrupt processing.<\/td> <\/tr> |
OEMInterruptHandler<\/td> |
Handles interrupts (is different for SHx processors).<\/td> <\/tr> |
OEMInterruptHandler<\/td> |
Handles FIQ (specific for ARM processors).<\/td> <\/tr> |
OEMIoControl<\/td> |
IO control code for OEM information.<\/td> <\/tr> |
OEMNMI<\/td> |
Supports a non maskable interrupt (specific to SHx processor).<\/td> <\/tr> |
OEMNMIHandler<\/td> |
Handler for non maskable interrupt (specific to SHx processor).<\/td> <\/tr> |
OEMPowerOff<\/td> |
Puts CPU in suspend state and takes care of final power down operations.<\/td> <\/tr> <\/table>
Kernel Independent Transport Layer<\/p> <\/div>
The OEMInit function is the main OAL routine that initializes board-specific peripherals, sets up the kernel variables, and starts KITL by passing a KITL IOCTL to the kernel. If you added and enabled KITL in the run-time image, the kernel starts KITL for debugging over different transport layers, as discussed in Chapter 4, "Debugging and Testing the System."<\/p>
Table 5-6 lists the functions that the OAL must include to enable KITL support on a new platform.<\/p>
Table 5-6 KITL support functions<\/strong> <\/p>
Function<\/th> |
Description<\/th> <\/tr> |
OEMKitlInit<\/td> |
Initializes KITL.<\/td> <\/tr> |
OEMKitlGetSecs<\/td> |
Returns the current time in seconds.<\/td> <\/tr> |
TransportDecode<\/td> |
Decodes recevied frames.<\/td> <\/tr> |
TransportEnableInt<\/td> |
Enables or disables KITL interrupt if it is interrupt based.<\/td> <\/tr> |
TransportEncode<\/td> |
Encodes data accroding the transport's required frame structure.<\/td> <\/tr> |
TransportGetDevCfg<\/td> |
Retrieves the device's KITL transport configuration.<\/td> <\/tr> |
TransportReceive<\/td> |
Receives a frame from the transport.<\/td> <\/tr> |
TransportSend<\/td> |
Sends a frame using the transport.<\/td> <\/tr> |
KitlInit<\/td> |
Initializes KITL system.<\/td> <\/tr> |
KitlSendRawData<\/td> |
Sends raw data using the transport bypassing the protocol.<\/td> <\/tr> |
KitlSetTimerCallback<\/td> |
Registers a callback that is called after a specified amount of time.<\/td> <\/tr> |
KitlStopTimerCallback<\/td> |
Disables a timer used by the above routine.<\/td> <\/tr> <\/table>
Profile Timer Support<\/p> <\/div>
|
|