You can redefine the VxWorks configuration in two ways: interactively, as described in this manual in the Tornado User's Guide: Projects, or by editing VxWorks configuration files as described in 8.5 Configuring VxWorks. In either case, after you alter the configuration, VxWorks must be rebuilt to incorporate the changes. This includes recompiling certain modules and re-linking the system image. This section explains the procedures for rebuilding the VxWorks system image using manual techniques.
Boot ROM images come in 3 flavors: compressed, uncompressed, and ROM-resident.
Downloaded VxWorks images come in two basic varieties, Tornado and standalone. (Here "Tornado" is a Vxworks image that uses the host-based tools and symbol table.)
Note that there are variations in available targets for the x86 architecture. See D. Intel x86 for details.
With a UNIX host, you can use either the GNU version of make included with Tornado or the version included with your UNIX system. If you choose that version, see your host system's reference for make for information about the version of make supplied in that system.
To rebuild VxWorks on a UNIX host, first change to the VxWorks target directory for the desired target, and invoke make as follows:
% cd ${WIND_BASE}/target/config/bspname % make
If you choose to use manual techniques on Windows hosts, you must use the command line for building individual application modules. You can use either the command line or the project facility in Tornado 1.0.1 compatibility mode to rebuild BSPs. For information on how to implement Tornado 1.0.1 compatibility mode, see the Tornado User's Guide: Customization.
The Project menu includes entries for rebuilding every BSP installed on your system as a part of Tornado. These entries all have the form Make bspname. Figure 8-2 illustrates the Project menu in a Tornado system that has a family of i386/i486 BSPs installed.
When you select any Make bspname menu entry, the make targets available are grouped into the following categories (also illustrated in Figure 8-2):
When you click any of the targets from the categories above, Tornado builds the corresponding object in the BSP directory. Output from the build goes to a Build Output window, which you can use as a diagnostic aid.
To rebuild VxWorks, click the vxWorks target name under the appropriate Make bspname entry for your target in the Project menu. For example, Figure 8-2 shows the vxWorks target selected for the EPC4 BSP.
You can also rebuild VxWorks from the Windows command prompt (or from a batch file). Change to the config directory for the desired target, and invoke make as follows:
C:\> cd tornado\target\config\bspname C:\tornado\target\config\bspname> make
In either case, make compiles and links modules as necessary, based on the directives in the target directory's Makefile.
|
NOTE: For the sake of compactness, most examples of calling make in this chapter use the command line; in real practice, the Project menu is usually more convenient. This is true for Windows hosts even if you use the Tornado 1.0.1 methods described in this section.
|
||||||||||||||||||
The directory installDir/target/target/src/usr contains the source code for certain portions of VxWorks that you may wish to customize. For example, usrLib.c is a popular place to add target-resident routines that provide application-specific development aids. For a summary of other files in this directory, see the Tornado User's Guide: Directories and Files.
If you modify one of these files, an extra step is necessary before rebuilding your VxWorks image: you must replace the modified object code in the appropriate VxWorks archive. The Makefile in installDir/target/target/src/usr automates the details; however, because this directory is not specific to a single architecture, you must specify the value of the CPU variable on the make command line:
% make CPU=cputype
If you do this frequently on a Windows host, you can record the CPU definition in the Build Target field of a custom command in the Project menu; see Tornado User's Guide: Customization.
This step recompiles all modified files in the directory, and replaces the corresponding object code in the appropriate architecture-dependent directory. After that, the next time you rebuild VxWorks, the resulting system image includes your modified code.
The following example illustrates replacing usrLib with a modified version, rebuilding the archives, and then rebuilding the VxWorks system image. For the sake of conciseness, the make output is not shown. The example assumes the epc4 (I80386) BSP; replace the BSP directory name and CPU value as appropriate for your environment. (On a Windows host, use copy instead of the UNIX cp.)
% cd ${WIND_BASE}/target/src/usr % cp usrLib.c usrLib.c.orig % cp develDir/usrLib.c usrLib.c % make CPU=I80386 ...
The commands to link a VxWorks system image are somewhat complicated. Fortunately, it is not necessary to understand those commands in detail because the Makefile in each VxWorks target directory includes the necessary commands. However, for completeness, this section gives an explanation of the flags and parameters used to link VxWorks.
VxWorks operating system modules are distributed in the form of an archive library for each target architecture. The library is installDir/target/lib/libcpugnuvx.a.
These modules are combined with the configuration module usrConfig.o by the ldarch command on the host. (usrConfig.c is described in 8.5.3 The Configuration Module: usrConfig.c.) The following is an example command for linking a VxWorks system using the GNU linker for the MC680x0:
ld68k -o vxWorks -X -N -Ttext 1000 -e _sysInit sysALib.o sysLib.o \ usrConfig.o version.o /tornado/target/lib/libcpugnuvx.a
The Tornado target server uses the VxWorks symbol table on the host system, both for dynamic linking and for symbolic debugging. The symbol table file is created by the supplied tool xsym. Processing an object module with xsym creates a new object module that contains all the symbols of the original file, but with no code or data. The line in Makefile that creates this file executes the command as follows:
xsym < vxWorks > vxWorks.sym
The file vxWorks.sym is the symbol table that the target server loads when it begins executing.