8.5   Configuring VxWorks

The configuration of VxWorks is determined by the configuration header files installDir/target/config/all/configAll.h and installDir/target/config/bspname/config.h. These files are used by the usrConfig.c, bootConfig.c, and bootInit.c modules as they run the initialization routines distributed in the directory installDir/target/src/config to configure VxWorks.

The VxWorks distribution includes the configuration files for the default development configuration. You can create your own versions of these files to better suit your particular configurations; this is described in the following subsections. In addition, if you need multiple configurations, environment variables are provided so you can move easily between them.


*

NOTE: To rebuild VxWorks for your own configuration, follow the procedures described in the Tornado User's Guide: Projects (recommended) or see 8.7 Building a VxWorks System Image.

Including optional components in your VxWorks image can significantly increase the image size. If you receive a warning from vxsize when building VxWorks, or if the size of your image becomes greater than that supported by the current setting of RAM_HIGH_ADRS, be sure to see 8.6.1 Scaling Down VxWorks and 8.9 Creating Bootable Applications for information on how to resolve the problem.

8.5.1   The Environment Variables

In a development environment, you may have several different configurations you wish to test, or you may wish to specify different target code in different situations. In order to build VxWorks to these different specifications, you need to modify your environment.

In general, your Tornado environment consists of three parts: the host code (Tornado), the target code, and the configuration files discussed in this section. If you use the default environment, your UNIX environment variables are defined as follows:


Host code:

$WIND_BASE/host/hosttype/bin

Target code:

TGT_DIR = $WIND_BASE/target

Configuration code:

CONFIG_ALL = $TGT_DIR/config/all


On Windows hosts, the IDE automatically locates Tornado code in the following locations:


Host code:

installDir/host/hosttype/bin

Target code:

installDir/target

Configuration code:

installDir/target/config/all


To use different versions of usrConfig.c, bootConfig.c, and bootInit.c, store them in a different directory and change the value of CONFIG_ALL. To use different target code, point to the alternate directory by changing the value of TGT_DIR.

You can change the value of CONFIG_ALL by changing it either in your makefile or on the command line. The value of TGT_DIR must be changed on the command line.


*

NOTE: Changing TGT_DIR will change the default value of CONFIG_ALL. If this is not what you want, reset CONFIG_ALL as well.

To change CONFIG_ALL in your makefile, add the following command:

CONFIG_ALL = $WIND_BASE/target/config/newDir

To change CONFIG_ALL on the command line, do the following:

% make ... CONFIG_ALL = $WIND_BASE/target/config/newDir

To change TGT_DIR on the command line, do the following:

% make ... TGT_DIR = $ALT_DIR/target

8.5.2   The Configuration Header Files

You can control VxWorks's configuration by including or excluding definitions in the global configuration header file configAll.h and in the target-specific configuration header file config.h. This section describes these files.

The Global Configuration Header File: configAll.h

The configAll.h header file, in the directory installDir/target/config/all, contains default definitions that apply to all targets, unless redefined in the target-specific header file config.h. The following options and parameters are defined in configAll.h:

The BSP-specific Configuration Header File: config.h

There is also a BSP-specific header file, config.h, in the directory installDir/target/config/bspname. This file contains definitions that apply only to the specific target, and can also redefine default definitions in configAll.h that are inappropriate for the particular target. For example, if a target cannot access a device controller at the default I/O address defined in configAll.h because of addressing limitations, the address can be redefined in config.h.

The config.h header file includes definitions for the following parameters:


*

CAUTION: If any options from configAll.h need to be changed for this one BSP, then any previous definition of that option should be undefined and redefined as necessary in config.h. Unless options are to apply to all BSPs at your site, do not change them in installDir/target/config/all/configAll.h.

Selection of Optional Features

VxWorks ships with optional features and device drivers that can be included or omitted from the target system. These are controlled by macros in the project facility or the configuration header files that cause conditional compilation in the installDir/target/config/all/usrConfig.c module.

The distributed versions of the configuration header files configAll.h and config.h include all the available software options and several network device drivers. If you are not using the project facility (see Tornado User's Guide: Projects), you define a macro by moving it from the EXCLUDED FACILITIES section of the header file to the INCLUDED SOFTWARE FACILITIES section.1 For example, to include the ANSI C assert library, make sure the macro INCLUDE_ANSI_ASSERT is defined; to include the Network File System (NFS) facility, make sure INCLUDE_NFS is defined. Modification or exclusion of particular facilities is discussed in detail in 8.6 Alternative VxWorks Configurations.

Macros shown in Table 8-6 that end in XXX are not valid macros but represent families of options where the XXX is replaced by a suffix declaring a specific routine. For example, INCLUDE_CPLUS_XXX refers to a family of macros that includes INCLUDE_CPLUS_MIN and INCLUDE_CPLUS_STL.

Table 8-6:  Key VxWorks Options 


Macro
1
Option

INCLUDE_ANSI_XXX  
*
Various ANSI C library options 
INCLUDE_BOOTLINE_INIT  
Parse boot device configuration information  
INCLUDE_BOOTP  
*
BOOTP support 
INCLUDE_CACHE_SUPPORT  
*
Cache support 
INCLUDE_CPLUS  
*
Bundled C++ support 
INCLUDE_CPLUS_XXX  
Various C++ support options 
INCLUDE_DOSFS  
DOS-compatible file system 
INCLUDE_FLOATING_POINT  
*
Floating-point I/O 
INCLUDE_FORMATTED_IO  
*
Formatted I/O 
INCLUDE_FTP_SERVER  
FTP server support 
INCLUDE_IO_SYSTEM  
*
I/O system package 
INCLUDE_LOADER  
Target-resident object module loader package 
INCLUDE_LOGGING  
*
Logging facility 
INCLUDE_MEM_MGR_BASIC  
*
Core partition memory manager 
INCLUDE_MEM_MGR_FULL  
*
Full-featured memory manager 
INCLUDE_MIB2_XXX  
Various MIB-2 options 
INCLUDE_MMU_BASIC  
*
Bundled MMU support 
INCLUDE_MMU_FULL  
Unbundled MMU support (requires VxVMI) 
INCLUDE_MSG_Q  
*
Message queue support 
INCLUDE_NETWORK  
*
Network subsystem code 
INCLUDE_NFS  
Network File System (NFS) 
INCLUDE_NFS_SERVER  
NFS server 
INCLUDE_PIPES  
*
Pipe driver 
INCLUDE_POSIX_XXX  
Various POSIX options 
INCLUDE_PROTECT_TEXT  
Text segment write protection (requires VxVMI) 
INCLUDE_PROTECT_VEC_TABLE  
Vector table write protection (requires VxVMI) 
INCLUDE_PROXY_CLIENT  
*
Proxy ARP client support 
INCLUDE_PROXY_SERVER  
Proxy ARP server support 
INCLUDE_RAWFS  
Raw file system 
INCLUDE_RLOGIN  
Remote login with rlogin 
INCLUDE_SCSI  
SCSI support 
INCLUDE_SCSI2  
SCSI-2 extensions 
INCLUDE_SECURITY  
Remote login security package 
INCLUDE_SELECT  
Remote login security package 
INCLUDE_SEM_BINARY  
*
Binary semaphore support 
INCLUDE_SEM_COUNTING  
*
Counting semaphore support 
INCLUDE_SEM_MUTEX  
*
Mutual exclusion semaphore support 
INCLUDE_SHELL  
C-expression interpreter (target shell) 
INCLUDE_XXX_SHOW  
Various system object show facilities 
INCLUDE_SIGNALS  
*
Software signal facilities 
INCLUDE_SM_OBJ  
Shared memory object support (requires VxMP) 
INCLUDE_SNMPD  
SNMP agent 
INCLUDE_SPY  
Task activity monitor 
INCLUDE_STDIO  
*
Standard buffered I/O package 
INCLUDE_SW_FP  
Software Floating point emulation package 
INCLUDE_SYM_TBL  
Target-resident symbol table support 
INCLUDE_TASK_HOOKS  
*
Kernel call-out support 
INCLUDE_TASK_VARS  
*
Task variable support 
INCLUDE_TELNET  
Remote login with telnet 
INCLUDE_TFTP_CLIENT  
*
TFTP client support 
INCLUDE_TFTP_SERVER  
TFTP server support 
INCLUDE_TIMEX  
*
Function execution timer 
INCLUDE_TRIGGERING  
Function execution timer 
INCLUDE_UNLOADER  
Target-resident object module unloader package 
INCLUDE_WATCHDOGS  
*
Watchdog support 
INCLUDE_WDB  
*
Target agent 
INCLUDE_WDB_TSFS  
*
Target server file system 
INCLUDE_WINDVIEW  
WindView command server; see the WindView User's Guide for details 
INCLUDE_ZBUF_SOCK  
Zbuf socket interface 

1:  Items marked with an asterisk are included in the default configuration. Note that, since this list of options is not complete, not all macros included in the default configuration are listed here. Note also that their inclusion may be overridden in config.h for your BSP.

8.5.3   The Configuration Module: usrConfig.c

Use VxWorks configuration header files to configure your VxWorks system to meet your development requirements. Users should not resort to changing the WRS-supplied usrConfig.c, or any other module in the directory installDir/target/config/all. If an extreme situation requires such a change, we recommend you copy all the files in installDir/target/config/all to another directory, and add a CONFIG_ALL macro to your makefile to point the make system to the location of the modified files. For example, add the following to your makefile after the first group of include statements:

# ../myAll contains a copy of all the ../all files  
    CONFIG_ALL = ../myAll

1:  For a partial listing of the configuration macros, see Table 8-6. To see all the available macros with their descriptions, see installDir/target/config/all/configAll.h (for macros applicable to all bsps) and installDir/target/config/bspname/config.h (for macros applicable to a specific BSP).