Device Emulator emulates the same hardware platform for both the reference BSP and the cloned BSP. For this reason, the new run-time image runs on Device Emulator without further adaption. In practice, however, the underlying hardware is different in most cases, requiring BSP adaptations to start CE successfully.<\/p> <\/cite>
► Customize the BSP<\/p> <\/div>
1. Detach from the target device and close Device Emulator.<\/p>
2. In Visual Studio, open the init.c source code file that you can find in the %_PLATFORMROOT%\DeviceEmulatorClone\Src\Oal\Oallib folder, as illustrated in Figure 5-12.<\/p>
3. Search for the OAL function OEMGetExtensionDRAM and add the following line of code to print a debug message in the Output window of Visual Studio during system startup.<\/p>
BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart, LPDWORD lpMemLen) {<\/code> <\/p>
...<\/code> <\/p>
OALMSG(OAL_FUNC, L"++OEMGetExtensionDRAM\r\n"));<\/code> <\/p>
// Test message to confirm that our modifications are part of run-time image.<\/code> <\/p>
OALMSG(1,(TEXT("This modification is part of the run-time image.\r\n")));<\/code> <\/p>
...<\/code> <\/p>
}<\/code> <\/p>
4. Rebuild the run-time image to includes the changes, and then attach to the device again in order to download and start the new run-time image in Device Emulator. Verify that Windows Embedded CE prints the debug message in the Output window.<\/p>
Chapter Review<\/p> <\/div>
The adaptation of a BSP is one of the most complicated and critical development tasks that OEMs face when porting Windows Embedded CE 6.0 to a new hardware platform. To facilitate this undertaking, Microsoft provides reference BSPs with Platform Builder and encourages OEMs to start the development process by cloning the most suitable BSP. The PQOAL-based BSPs follow a well-organized folder and file structure to separate platform-agnostic and platform-specific code by processor type and OAL function so that OEMs can focus on platform-specific implementation details without getting side tracked by general aspects of the kernel or operating system.<\/p>
OEM developers should consider the following recommendations to ensure a successful adaptation of a BSP:<\/p>
■ Study the Windows Embedded CE reference BSPs<\/strong>Windows Embedded CE BSPs follow a well-defined architecture with close relationships to the kernel. This makes it necessary to implement numerous APIs that the kernel requires to run the operating system. Knowing these APIs and their purpose is very important. The PQOAL-based architecture is continually evolving.<\/p>