Summary: An overview of the important data structures at the BSP and OAL levels. The BSP data structures are unique in that they are passed between the bootloader and OS, and thus reside in a reserved region of memory. The OAL data structures describe the OAL's 'exports' to the kernel.
Bootloader Internal Data Structures
On devices with a persistent store, bootloaders typically save configuration information such as the KITL IP address and DHCP settings, debug serial port and launch address. This structure is not standardized, and can be found with different names and forms on different platforms.
These data structures can be thought of as a 'BIOS' information store for CE devices, in the sense that we're configuring parameters of the device, as early as possible in bootup.
The CEPC platform uses a BOOT
ARGS structure found in @platform\common\src\soc\x86ms
v1\inc\bootarg.h@. XScale platforms use an EBOOTCFG structure found in @platform\<name>\src\bootloader\eboot\loader.h@.
A typical boot configurations structure looks like this:
typedef struct
{
DWORD [autoDownloadImage;]
DWORD IP;
DWORD subnetMask;
DWORD [numBootMe;]
DWORD delay;
DWORD [DHCPEnable;]
DWORD [bootDeviceOrder;]
DWORD [dwPhysStart;]
DWORD [dwPhysLen;]
DWORD [dwLaunchAddr;]
DWORD [dwDbgSerPhysAddr;]
DWORD [XmodemDefault;]
DWORD [ConfigMagicNumber;]
DWORD [dwStoreAddr;]
UINT16 RNDISMac[3];
DWORD [CheckSignatures;]
} EBOOT_CFG, *PEBOOT_CFG;
Bootloader Arguments
All platforms have a method to pass information from the bootloader to the kernel. Typically, this structure is filled in by
OEMPreDownload before downloading or reading the image from flash.
Although various platforms have different methods of passing arguments, all well-behaved platforms use
OALArgsQuery to access this data. If in doubt, search for
OALArgsQuery and work backwards.
CEPC uses an
X86BootInfo struct located at BOOT
ARGPTR_LOCATION.
OALArgsQuery can be found in @platform\common\src\x86\common\ioctl\devinfo.c@.
SH4,MIPS,and
XScale platforms use a BSP
ARGS struct, located at IMAGESHARE
ARGSPA_START.
OALArgsQuery is found in @platform\<name>\src\oal\oallib\args.c@.
A typical bootloader argument structure looks like this:
typedef struct {
OAL_ARGS_HEADER header;
UINT8 deviceId[16]; // Device identification
OAL_KITL_ARGS kitl;
UINT32 [dbgSerPhysAddr;] // Debug serial physical address
UINT8 uuid[16];
BOOL [bUpdateMode;] // TRUE = Enter update mode on reboot.
BOOL [bHiveCleanFlag;] // TRUE = Clean hive at boot
BOOL [bCleanBootFlag;] // TRUE = Clear RAM, hive, user store at boot
BOOL [bFormatPartFlag;] // TRUE = Format partion when mounted at boot
UINT32 [ImageSignedState;] // enum {IMAGE_NOT_SIGNED, IMAGE_TEST_SIGNED, IMAGE_FINAL_SIGNED}
} BSP_ARGS, *PBSP_ARGS; @)
Of interest here are the debug serial settings, the KITL settings, and the various boot flags. Note that
OEMKitlStartup is able to modify this structure before KITL initialization, so if the OS image seems not to honor KITL settings, investigate there.
OAL Data Structures
*OEMGlobal. This structure can be viewed as the OAL ‘exports’ to the kernel. It contains all of the functions and variables that the OAL is required to implement, such as
OEMInit, OEMIOControl, pfnPowerOff, pfnInterruptHandler. *Several, such as pfnIsROM or
pfnSetMemoryAttributes are optional, and can be left as NULL.
*MSDN has the full list available online: http://msdn2.microsoft.com/en-us/library/aa913510.aspx
*NKGlobal. The counterpart to
OEMGlobal, these are the kernel functions accessible from the OAL.
*See MSDN: http://msdn2.microsoft.com/en-us/library/aa915982.aspx
*OEMAddressTable (ARM). Usually found in oemaddrtab_cfg.inc, this is a mapping between physical and virtual addresses used during the initialization process. An excellent reference for determining what a pointer is referencing.
*g_KitlDevices. Found on a variety of non-x86 platforms, this structure lists the KITL devices present, along with their transport configuration. This structure is passed to
OALKitlInit. For details, consult the MSDN KITL Transport article: http://msdn2.microsoft.com/en-us/library/aa914512.aspx
Further reading:
MSDN – OAL Structures - http://msdn2.microsoft.com/en-us/library/aa914850.aspx
Go up to
Features of a BSPGo up to
Big Book of BSP
Thank you for contributing to this BSP Wiki. To ensure your comments and concerns receive proper exposure, include bspwiki""@""microsoft"".""com when providing feedback or topical suggestions.