BSP Folder Structure

To increase code reusability, PQOAL-based BSPs feature a common architecture and corresponding folder structure that is consistent across processor families. Due to this common architecture, large portions of the source code can be reused regardless of hardware-specific BSP requirements. Figure 5-3 shows the typical BSP folder structure and Table 5-1 summarizes the most important BSP folders.

Figure 5-3 Folder structure of a typical BSP

TIP %_TARGETPLATROOT%

You can use the environment variable %_TARGETPLATROOT% in the build window to locate the path of the BSP being used in the current OS design (Open Release Directory in Build Window option on the Build menu in Visual Studio).

Table 5-1 Important BSP folders

Folder Description
Root Folder Contains configuration and batch files. The two most important files for developers are as follows:
¦ Sources.cmn Contains macro definitions that are common across the entire BSP.
¦ <BSP Name>.bat Sets the default BSP environment variables.
CATALOG Contains the BSP catalog file in which all the components of the BSP are defined. This file is used in the OS design stage to add or remove BSP features. Chapter 1, 'Customizing the Operating System Design,' discusses how to manage catalog items.
CESYSGEN Contains the Makefile for the Sysgen tool. Configuring a BSP does requires no changes to this directory.
FILES Contains the build configuration files, such as .bib, .reg, .db, and .dat files.
SRC Contains the platform-specific source code that you must adapt according to the PQOAL model, which divides the code between platform-specific and common components per CPU type.
COMMON Exists under the Platform directory and contains most of the BSP source code. It consists of a common set of processor specific components. The BSP links to libraries in this folder, generated during the build process. These are libraries for processor-based peripherals as well as processor-specific OAL parts. If the hardware uses a CPU from the family of supported processors, then most of these libraries can be reused without modification.

Platform-Specific Source Code

The most important platform-specific source code that you must adapt as part of your BSP is for the boot loader, the OAL, and the device drivers. You can find the corresponding source code underneath the Src folder in the following subdirectories:

¦ SrcBoot loader Contains the boot loader code. However, if the boot loader relies on BLCOMMON and related libraries, then only the basic hardware- specific part of the boot loader is located in this directory. The reusable boot loader code is available in the Public folder (%_WINCEROOT%Public CommonOak DriversEthdbg) and linked as libraries to the BSP part. Chapter 4, 'Debugging and Testing the System,' introduces the static libraries that facilitate boot loader development.

¦ SrcOal Contains the bare minimal amount of code that is specific to the hardware platform. The majority of the OAL code is located in %_WINCEROOT%PlatformCommon, divided into hardware- independent, processor-family-related, chip-set-specific and platform-specific groups. These code groups provide most of the OAL functionality and are linked to the platform-specific parts as libraries.

¦ SrcCommon and SrcDrivers Contains the driver source code, organized in different categories to facilitate maintenance and portability. These categories are typically processor-specific and platform- specific. The processor-specific component is located in the SrcCommon directory and requires no modifications when adapted to new hardware based on the same processor family.

Implementing a Boot Loader from Existing Libraries

Several aspects have to be considered when adapting a boot loader for a new platform, including:

¦ Changes in the processor architecture.

¦ Location of the boot loader code on the target device.

¦ Memory architecture of the platform.

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату