A significant portion of the BSP adaptation revolves around the platform-specific part of the OAL. If the new platform uses a CPU that is not currently supported, then the OAL adaptation requires you to modify most of the OAL code to support the new processor architecture. On the other hand, if the new hardware is very similar to the reference BSP's platform, you might be able to reuse most of the existing code base.<\/p>
OEM Address Table<\/p> <\/div>
The kernel performs specialized tasks, such as initializing virtual memory, and cannot rely on a boot loader for this because the kernel must be entirely self-contained. Otherwise, the operating system would depend on the presence of a boot loader and it would not be possible to bootstrap the run-time image directly. Yet, to establish virtual-to-physical address mappings through the Memory Management Unit (MMU), the kernel must know the memory layout of the underlying hardware platform. To obtain this information, the kernel uses an important table called OEMAddressTable (or g_oalAddressTable) that defines static virtual memory regions. The OAL includes a declaration of OEMAddressTable as a read-only section and one of the first actions taken by the kernel is to read this section, set up corresponding virtual memory mapping tables, and then transition to the virtual address where the kernel can execute code. The kernel can determine the physical address of the OEMAddressTable in linear memory based on the address information available in the run-time image.<\/p>
You must indicate any differences in the memory configuration of a new hardware platform by modifying the OEMAddressTable. The following sample code illustrates how to declare the OEMAddressTable section.<\/p>
;--------------------------------------------------------------<\/code> <\/p>
public _OEMAddressTable<\/code> <\/p>
_OEMAddressTable:<\/code> <\/p>
; OEMAddressTable defines the mapping between Physical and Virtual Address<\/code> <\/p>
; o MUST be in a READONLY Section<\/code> <\/p>
; o First Entry MUST be RAM, mapping from 0x80000000 -> 0x00000000<\/code> <\/p>
; o each entry is of the format ( VA, PA, cbSize )<\/code> <\/p>
; o cbSize must be multiple of 4M<\/code> <\/p>
; o last entry must be (0, 0, 0)<\/code> <\/p>
; o must have at least one non-zero entry<\/code> <\/p>
; RAM 0x80000000 -> 0x00000000, size 64M<\/code> <\/p>
dd 80000000h, 0, 04000000h<\/code> <\/p>
; FLASH and other memory, if any<\/code> <\/p>
; dd FlashVA, FlashPA, FlashSize<\/code> <\/p>
; Last entry, all zeros<\/code> <\/p>