PART III: CUSTOMIZING THE OPERATING SYSTEM
4.3 Creating a Custom VxWorks Image
In this section you learn how to create a custom VxWorks image, a corresponding VxWorks Image project (VIP), and how you can change the build spec and build target for an existing VIP.
Prerequisites
Consider the following questions before you create a custom VxWorks image:
Upon what is your project based?
Project creation is faster if you base your project on an existing VIP, because the project facility copies configuration information instead of regenerating it from BSP configuration files. For more information about Boot Loader/BSP projects, see 4.11 Loading the VxWorks Image onto the Target, p.54. For details on
! CAUTION: Code built for variants of VxWorks or for different releases of VxWorks is not binary compatible between variants or releases. Code must be built
specifically for uniprocessor (UP) VxWorks, VxWorks SMP, 32-bit VxWorks, 64-bit VxWorks, or for a VxWorks system based on variant libraries produced with a VxWorks source build (VSB) project—or for any supported combination of these variants. The only exception to this rule is that RTP application executables can be run on both UP VxWorks and VxWorks SMP (when all else is the same).
4 Configuring and Building VxWorks 4.3 Creating a Custom VxWorks Image
importing a VIP into your workspace from another workspace or from a team member, see 4.6 Importing and Migrating Existing VxWorks Image Projects, p.43.
Once your VIP is created, you cannot change the BSP it is based upon. You must create a new project with the correct BSP. If you base your VIP on a BSP you must also select a tool chain (the compiler, linker, and so on) that
Workbench uses to build projects.
The options you select in the VxWorks Source Build (VSB) project determine the BSP and tool chain options available for your VIP. For details, see 4.7 Creating a VxWorks Source Build Project, p.47.
The address mode (ILP32 support or LP64 support in the kernel) you choose for your VIP depends on the BSP on which you want to base your project, and the address mode in turn determines the tool chain you can use. Workbench manages its UI components, and presents only the settings appropriate for your BSP and address mode choices.
Do you want support for the BSP validation test suite?
Support for the BSP validation test suite is available for all non-simulator BSPs.
For information about the settings and options of the BSP validation test suite, see the VxWorks BSP Validation Test Suite User’s Guide.
Do you want networking and multiprocessing support?
Options available to you can vary depending on the Platform you installed and the BSP you chose for your project. The following are a few options that might be available:
IPv6 enabled kernel libraries—Creates IPv6 support.
IPv6_only enabled kernel libraries—Creates IPv6_only support.
SMP support in kernel—Creates a symmetric multiprocessing configuration of VxWorks.
Once the VIP is created, you cannot change it to a uniprocessor or asymmetric multiprocessor configuration.
Is a kernel configuration profile right for your project?
Your BSP and address mode choices determine the profiles that Workbench offers. Profiles are preconfigured collections of kernel components that provide the described capabilities. Using a profile can save you work, but you do not need to select one now—you can create the same configuration using the Kernel Configuration Editor (see 4.4 Configuring VxWorks, p.37).
Creating a Custom VxWorks Image and VIP
This task shows you how to create a custom VxWorks image and a corresponding VIP.
To create a custom VxWorks image, do the following:
1. In Workbench, change to the Advanced Device Development perspective.
NOTE: It is not necessary to make a selection on every screen.
If you have not opened this perspective before, in the Workbench menu click Window > Open Perspective > Advanced Device Development.
2. In the Workbench menu, click File > New > VxWorks Image Project.
Workbench starts the New VxWorks Image Project wizard.
3. On the Project page, type a name for your project.
4. Under Location, select a location to store your project files; then click Next.
To create the project in the current workspace, select Create project in workspace. This is a good idea if you do not have write permission to the location of your source files, or if you plan to create or import sources later.
To create the project outside your workspace, select Create project at external location; then click Browse to navigate to the new location. Choose this option if you have write permission to the location of your sources (so you do not have to import them later), or if you plan to add your project to source control and the sources are outside your workspace.
5. On the Project Setup page, under Set up the project, from the Based on drop-down list, select the project type or package on which to base your project.
This step defines the location from which Workbench retrieves the build settings and other settings for the project.
To base your VIP on another VIP or a Boot Loader/BSP project, select an existing project; then from the Project drop-down list, select a project in your workspace or click Browse to select a similar project from another location.
To base a VIP on a VxWorks source build (VSB) project, select a source build project; then from the Project drop-down list, select a project in your workspace or click Browse to select a similar project from another location.
You, or someone on your team, must have created the VSB project and rebuilt your VxWorks source libraries.
To base a VIP on a BSP, select a board support package that supports your target hardware, then from the BSP drop-down list select the VxWorks simulator on which to run your image.
On a Windows host, select simpc On a Linux host, select linux On a Solaris host, select solaris
To use a BSP provided by someone in your organization or a third party, click Browse to locate the package.
In the Address mode drop-down list, select the address mode support you want to use in the kernel— either 32-bit kernel or 64-bit kernel.
From the Tool chain drop-down list, select one of the tool chains you have installed, such as the GNU compiler (gnu), the Wind River Compiler (diab), or the Intel C++ Compiler (icc) if your project is based on an Intel CPU.
4 Configuring and Building VxWorks 4.3 Creating a Custom VxWorks Image
6. (Optional) Under Target Agent, click Enable WDB Target Agent if you plan to use Workbench debugging tools to debug your target applications.
The WDB Target agent is disabled by default unless you are working with a simulated target.
The WDB Target Agent is a software component that resides on your target system and that makes it possible to use Workbench debugging tools with your target applications.
7. (Optional) Under BSP validation test suite, click Add support to project; then click Options.
This step includes support for the BSP validation test suite.
a. In the dialog box, select a test suite and provide board and host configuration information.
b. Click Browse to navigate to the location in which to store the test results.
c. Click Close; then click Next.
8. (Optional) On the Options page, under Options, select the networking and multiprocessing support you want to use in your VIP; then click Next.
9. (Optional) On the Configuration Profile page, in the Profile drop-down box, select one of the following kernel configuration profiles:
PROFILE_COMPATIBLE
This profile provides a minimal configuration.
PROFILE_DEVELOPMENT
This profile creates a VxWorks image that includes development and debugging components.
PROFILE_ENHANCED_NET
This profile adds to the default image the components appropriate for typical managed network client host devices.
PROFILE_BOOTAPP
This profile adds boot loader capabilities to a default VxWorks image.
10. (Optional) On the Indexer page, click Enable project specific settings; then under Select indexer, choose an indexer and the settings you want to use.
Most projects work properly if you use the general indexer settings applied to all projects. Click Configure Workspace Settings to examine these settings.
Press the help key for your host for more information about selecting settings and configuring the indexer.
NOTE: The address mode you can choose for your project depends on the BSP on which your project is based, and the address mode in turn determines the tool chain you can use.
NOTE: SMP support is available only if it is supported by your product activation file (*.install.txt) and the BSP you selected.
If you do not see the option you want, select a different BSP.
If you see an option but cannot select it, your BSP supports the feature, but the option is not enabled in your product activation file.
11. Click Finish.
Workbench displays your new project in the Project Explorer, and shows both project files and linked resources.
For more information about boot loaders, see 4.11 Loading the VxWorks Image onto the Target, p.54 and the Customizing and Building Boot Loaders section in VxWorks Kernel Programmer’s Guide: Boot Loader. For information about selecting non-default drivers, see Specifying a Non-Default Driver, p.41.
For more information about profiles, see VxWorks Kernel Programmer’s Guide: Kernel Facilities and Kernel Configurations and the help page for vxprj::profile.
Changing the Image Type for a VIP
This section shows you how to change the build spec and build target for an existing VIP. Doing so creates a different image type for the project. There are four types of vxWorks images:
vxWorks (default)
vxWorks_rom
vxWorks_romCompress
vxWorks_romResident
For more information about these image types, see the VxWorks Kernel Programmer’s Guide.
When you create a VIP, Workbench sets the default build spec and build target to default. vxWorks and a vxWorks target node appear in the project. The target node name includes the suffix (default), which shows that the default build spec is set for the project.
You must have an existing VIP before you begin this task. For more information, see Creating a Custom VxWorks Image and VIP, p.33.
To change the image type for a project, complete the following steps:
1. In the Project Explorer, right-click the project name; then click New > Build Target.
NOTE: If Workbench encounters a problem while creating the project (for example, you might have specified the diab tool chain, but the selected BSP supports only gnu) Workbench displays an error that describes the problem.
Click OK to reopens the New Project wizard complete with all the settings you chose while creating the project. This gives you an opportunity to fix just the setting that caused the problem, rather than resetting all the selections in the wizard.
If you do not want to fix the problem and would rather create the project now, click Cancel.
NOTE: The build spec and build target must match for any given image type. For example, to build a vxWorks_rom image successfully, the build spec default_rom must be used with the build target vxWorks_rom.
4 Configuring and Building VxWorks