📄 c-config5.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Configuration and Build </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-config.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-config4.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-config6.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="85532">8.5 Configuring VxWorks</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85534"> </a>The configuration of VxWorks is determined by the configuration header files <i class="textVariable">installDir</i><b class="file">/target/config/all/configAll.h</b> and <i class="textVariable">installDir</i><b class="file">/target/config/</b><i class="textVariable">bspname</i><b class="file">/config.h</b>. These files are used by the <b class="library">usrConfig.c</b>, <b class="file">bootConfig.c</b>, and <b class="file">bootInit.c </b>modules as they run the initialization routines distributed in the directory <i class="textVariable">installDir</i><b class="file">/target/src/config</b> to configure VxWorks.</p><dd><p class="Body"><a name="85536"> </a>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.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="87303"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>To rebuild VxWorks for your own configuration, follow the procedures described in the <i class="title">Tornado User's Guide: Projects</i> (recommended) or see <a href="c-config7.html#86335"><i class="title">8.7 Building a VxWorks System Image</i></a>.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="85541"> </a>Including optional components in your VxWorks image can significantly increase the image size. If you receive a warning from <b class="command">vxsize</b> when building VxWorks, or if the size of your image becomes greater than that supported by the current setting of <b class="symbol_UC">RAM_HIGH_ADRS</b>, be sure to see <a href="c-config6.html#86040"><i class="title">8.6.1 Scaling Down VxWorks</i></a> and <a href="c-config9.html#86670"><i class="title">8.9 Creating Bootable Applications</i></a><i class="title"> </i>for information on how to resolve the problem.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85548">8.5.1 The Environment Variables</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85550"> </a>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.</p><dd><p class="Body"><a name="87227"> </a>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:<p class="table"><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87239"> </a><b class="symbol_UC"></b>Host code:</p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87241"> </a><b class="symbol_UC">$WIND_BASE</b><b class="file">/host/</b><i class="textVariable">hosttype</i><b class="file">/bin</b></p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87243"> </a><b class="symbol_UC"></b>Target code:</p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87245"> </a><b class="symbol_UC">TGT_DIR</b> = <b class="symbol_UC">$WIND_BASE</b><b class="file">/target</b></p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87247"> </a>Configuration code: </p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87249"> </a><b class="symbol_UC">CONFIG_ALL</b> = $<b class="symbol_UC">TGT_DIR</b><b class="file">/config/all</b></p></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="87234"> </a>On Windows hosts, the IDE automatically locates Tornado code in the following locations:<p class="table"><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87545"> </a>Host code:</p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87547"> </a><i class="textVariable">installDir</i><b class="file">/host/</b><i class="textVariable">hosttype</i><b class="file">/bin</b></p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87550"> </a>Target code:</p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87552"> </a><i class="textVariable">installDir</i><b class="file">/target </b></p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87555"> </a>Configuration code: </p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="87557"> </a><i class="textVariable">installDir</i><b class="file">/target/config/all</b></p></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="89552"> </a>To use different versions of <b class="file">usrConfig.c</b>, <b class="file">bootConfig.c</b>, and <b class="file">bootInit.c</b>, store them in a different directory and change the value of <b class="symbol_UC">CONFIG_ALL</b>. To use different target code, point to the alternate directory by changing the value of <b class="symbol_UC">TGT_DIR</b>. </p><dd><p class="Body"><a name="89553"> </a>You can change the value of <b class="symbol_UC">CONFIG_ALL</b> by changing it either in your makefile or on the command line. The value of <b class="symbol_UC">TGT_DIR</b> must be changed on the command line.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="85566"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>Changing <b class="symbol_UC">TGT_DIR</b> will change the default value of <b class="symbol_UC">CONFIG_ALL</b>. If this is not what you want, reset <b class="symbol_UC">CONFIG_ALL</b> as well.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="85571"> </a>To change <b class="symbol_UC">CONFIG_ALL</b> in your makefile, add the following command:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85572">CONFIG_ALL = $WIND_BASE/target/config/<i class="textVariable">newDir</i></a></b></pre></dl><dd><p class="Body"><a name="85573"> </a>To change <b class="symbol_UC">CONFIG_ALL</b> on the command line, do the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85574"></b><tt class="output">%</tt><b> make ... CONFIG_ALL = $WIND_BASE/target/config/<i class="textVariable">newDir</i></a></b></pre></dl><dd><p class="Body"><a name="85575"> </a>To change <b class="symbol_UC">TGT_DIR</b> on the command line, do the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85576"></b><tt class="output">%</tt><b> make ... TGT_DIR = $<i class="textVariable">ALT_DIR</i>/target</a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85577">8.5.2 The Configuration Header Files</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85579"> </a>You can control VxWorks's configuration by including or excluding definitions in the global configuration header file <b class="file">configAll.h</b> and in the target-specific configuration header file <b class="file">config.h</b>. This section describes these files.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85581">The Global Configuration Header File: <b class="file">configAll.h</b></a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85582"> </a>The <b class="file">configAll.h</b> header file, in the directory <i class="textVariable">installDir</i><b class="file">/target/config/all</b>, contains default definitions that apply to all targets, unless redefined in the target-specific header file <b class="file">config.h</b>. The following options and parameters are defined in <b class="file">configAll.h</b>:</p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="85583"> </a>kernel configuration parameters</li></ul><ul class="DashSingle" type="circle"><li><a name="85584"> </a>I/O system parameters</li></ul><ul class="DashSingle" type="circle"><li><a name="85585"> </a>NFS parameters</li></ul><ul class="DashSingle" type="circle"><li><a name="85586"> </a>selection of optional software modules</li></ul><ul class="DashSingle" type="circle"><li><a name="85587"> </a>selection of optional device controllers</li></ul><ul class="DashSingle" type="circle"><li><a name="85588"> </a>cache modes</li></ul><ul class="DashSingle" type="circle"><li><a name="85589"> </a>maximum number of the different shared memory objects</li></ul><ul class="DashSingle" type="circle"><li><a name="85590"> </a>device controller I/O addresses, interrupt vectors, and interrupt levels</li></ul><ul class="DashSingle" type="circle"><li><a name="85591"> </a>miscellaneous addresses and constants</li></ul></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85593">The BSP-specific Configuration Header File: <b class="file">config.h</b></a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85594"> </a>There is also a BSP-specific header file, <b class="file">config.h</b>, in the directory <i class="textVariable">installDir</i><b class="file">/target/config/</b><i class="textVariable">bspname</i>. This file contains definitions that apply only to the specific target, and can also redefine default definitions in <b class="file">configAll.h</b> 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 <b class="file">configAll.h</b> because of addressing limitations, the address can be redefined in <b class="file">config.h</b>.</p><dd><p class="Body"><a name="85595"> </a>The <b class="file">config.h</b> header file includes definitions for the following parameters:</p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="85596"> </a>default boot parameter string for boot ROMs</li></ul><ul class="DashSingle" type="circle"><li><a name="85597"> </a>interrupt vectors for system clock and parity errors</li></ul><ul class="DashSingle" type="circle"><li><a name="85598"> </a>device controller I/O addresses, interrupt vectors, and interrupt levels</li></ul><ul class="DashSingle" type="circle"><li><a name="85599"> </a>shared memory network parameters</li></ul><ul class="DashSingle" type="circle"><li><a name="85609"> </a>miscellaneous memory addresses and constants</li></ul></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="85604"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>If any options from <b class="file">configAll.h</b> need to be changed for this one BSP, then any previous definition of that option should be undefined and redefined as necessary in <b class="file">config.h</b>. Unless options are to apply to all BSPs at your site, do not change them in <i class="textVariable">installDir</i><b class="file">/target/config/all/configAll.h</b>.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85612">Selection of Optional Features</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85614"> </a><b></b>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 <i class="textVariable">installDir</i><b class="file">/target/config/all/usrConfig.c</b> module. </p><dd><p class="Body"><a name="85615"> </a>The distributed versions of the configuration header files <b class="file">configAll.h</b> and <b class="file">config.h</b> include all the available software options and several network device drivers. If you are not using the project facility (see <i class="title">Tornado User's Guide: Projects</i>), you define a macro by moving it from the EXCLUDED FACILITIES section of the header file to the INCLUDED SOFTWARE FACILITIES section.<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup> For example, to include the ANSI C <b class="library">assert</b> library, make sure the macro <b class="symbol_UC">INCLUDE_ANSI_ASSERT</b> is defined; to include the Network File System (NFS) facility, make sure <b class="symbol_UC">INCLUDE_NFS</b> is defined. Modification or exclusion of particular facilities is discussed in detail in <a href="c-config6.html#89042"><i class="title">8.6 Alternative VxWorks Configurations</i></a>.</p><dd><p class="Body"><a name="89124"> </a>Macros shown in <a href="c-config5.html#89131">Table 8-6</a> that end in <i class="textVariable">XXX</i> are not valid macros but represent families of options where the <i class="textVariable">XXX</i> is replaced by a suffix declaring a specific routine. For example, <b class="symbol_UC">INCLUDE_CPLUS_</b><i class="textVariable">XXX</i> refers to a family of macros that includes <b class="symbol_UC">INCLUDE_CPLUS_MIN</b> and <b class="symbol_UC">INCLUDE_CPLUS_STL</b>.<p class="table"><h4 class="EntityTitle"><a name="89131"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 8-6: Key VxWorks Options </font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="89137"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Macro</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeadingC" align="center"><a name="89142"> </a><b><font face="Helvetica, sans-serif" size="-1" class="sans"><sup><b class="FootnoteMarker">1</b></sup></font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="89144"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Option</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -