⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-config6.html

📁 this about vxworks operations systems
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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-config5.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-config7.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="89042">8.6  &nbsp;&nbsp;Alternative VxWorks Configurations</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86031"> </a>The discussion of the <b class="library">usrConfig</b> module in <a href="c-config5.html#89502"><i class="title">8.5.3&nbsp;The Configuration Module: usrConfig.c</i></a> outlined the default configuration for a development environment. In this configuration, the VxWorks system image contains all of the VxWorks modules that are necessary to allow you to interact with the system through the Tornado host tools. </p><dd><p class="Body"><a name="86033"> </a>However, as you approach a final production version of your application, you may want to change the VxWorks configuration in one or more of the following ways:</p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="86034"> </a>Change the configuration of the target agent.</li></ul><ul class="BulletSingle" type="disc"><li><a name="86035"> </a>Decrease the size of VxWorks.</li></ul><ul class="BulletSingle" type="disc"><li><a name="86036"> </a>Run VxWorks from ROM.</li></ul></dl><dl class="margin"><dd><p class="Body"><a name="86037"> </a>The following sections discuss the latter two alternatives to the typical development configuration. For a discussion on reconfiguring the target agent, see the <i class="title">Tornado User's Guide: Projects</i>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="86040">8.6.1  &nbsp;&nbsp;Scaling Down VxWorks</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86041"> </a>In a production configuration, it is often desirable to remove some of the VxWorks facilities to reduce the memory requirements of the system, to reduce boot time, or for security purposes.</p><dd><p class="Body"><a name="86043"> </a>Optional VxWorks facilities can be omitted by commenting out or using <b class="keyword">#undef</b> to undefine their corresponding control constants in the header files <b class="file">configAll.h</b> or <b class="file">config.h</b>. For example, logging facilities can be omitted by undefining <b class="symbol_UC">INCLUDE_LOGGING</b>, and signalling facilities can be omitted by undefining <b class="symbol_UC">INCLUDE_SIGNALS</b>.</p><dd><p class="Body"><a name="86044"> </a>VxWorks is structured to make it easy to exclude facilities you do not need. However, not every BSP will be structured in this way. If you wish to minimize your application, be sure to examine your BSP code and eliminate references to facilities you do not need to include. Otherwise, they will be included even though you undefined them in your VxWorks configuration files. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="86046">Excluding Kernel Facilities</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86047"> </a>The definition of the following constants in <b class="file">configAll.h</b> is optional, because referencing any of the corresponding kernel facilities from the application automatically includes the kernel service:</p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="86048"> </a><b class="symbol_UC">INCLUDE_SEM_BINARY</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="86049"> </a><b class="symbol_UC">INCLUDE_SEM_MUTEX</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="86050"> </a><b class="symbol_UC">INCLUDE_SEM_COUNTING</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="86051"> </a><b class="symbol_UC">INCLUDE_MSG_Q</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="86052"> </a><b class="symbol_UC">INCLUDE_WATCHDOGS</b> </li></ul></dl><dl class="margin"><dd><p class="Body"><a name="86053"> </a>These configuration constants appear in the default VxWorks configuration to ensure that all kernel facilities are configured into the system, even if not referenced by the application. However, if your goal is to achieve the smallest possible system, exclude these constants; this ensures that the kernel does not include facilities you are not actually using.</p><dd><p class="Body"><a name="86054"> </a>There are two other configuration constants that control optional kernel facilities: <b class="symbol_UC">INCLUDE_TASK_HOOKS</b> and <b class="symbol_UC">INCLUDE_CONSTANT_RDY_Q</b>. Define these constants in <b class="file">configAll.h</b> if the application requires either kernel callouts (use of task hook routines) or a constant-insertion-time, priority-based ready queue. A ready queue with constant insert time allows the kernel to operate context switches with a fixed overhead regardless of the number of tasks in the system. Otherwise, the worst-case performance degrades linearly with the number of ready tasks in the system. Note that the constant-insert-time ready queue uses 2KB for the data structure; some systems do not have sufficient memory for this. In those cases, the definition of <b class="symbol_UC">INCLUDE_CONSTANT_RDY_Q</b> may be omitted, thus enabling use of a smaller (but less deterministic) ready queue mechanism.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="86057">Excluding Network Facilities</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86058"> </a>In some applications it may be appropriate to eliminate the VxWorks network facilities. For example, in the ROM-based systems or standalone configurations described in <a href="c-config9.html#86670"><i class="title">8.9&nbsp;Creating Bootable Applications</i></a>, there may be no need for network facilities.</p><dd><p class="Body"><a name="86062"> </a>To exclude the network facilities, be sure the following constants are not defined:</p><dl class="margin"><ul class="DashSingle2" type="circle"><li><a name="86063"> </a><b class="symbol_UC">INCLUDE_NETWORK</b> </li></ul><ul class="DashSingle2" type="circle"><li><a name="86064"> </a><b class="symbol_UC">INCLUDE_NET_INIT</b> </li></ul><ul class="DashSingle2" type="circle"><li><a name="86065"> </a><b class="symbol_UC">INCLUDE_NET_SYM_TBL</b> </li></ul><ul class="DashSingle2" type="circle"><li><a name="86066"> </a><b class="symbol_UC">INCLUDE_NFS</b> </li></ul><ul class="DashSingle2" type="circle"><li><a name="86067"> </a><b class="symbol_UC">INCLUDE_RPC</b> </li></ul></dl><dd><p class="Body"><a name="86071"> </a>To exclude the Remote Procedure Call library (RPC), undefine <b class="symbol_UC">INCLUDE_RPC</b>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="86072">Option Dependencies</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86074"> </a>Option dependencies are coded in the file <i class="textVariable">installDir</i><b class="file">/target/src/config/usrDepend.c</b>, so that when a particular option is chosen, everything required is included. This assures you of a working system with minimum effort. Although you can exclude the features that you do not need by undefining them in <b class="file">config.h</b> and <b class="file">configAll.h</b>, you should be aware that in some cases they may not be excluded because of dependencies.</p><dd><p class="Body"><a name="86075"> </a>For example, you cannot use <b class="operator">telnet</b> without running the network. Therefore, if in your <b class="file">configAll.h</b> file, the option <b class="symbol_UC">INCLUDE_TELNET</b> is selected but the option <b class="symbol_UC">INCLUDE_NET_INIT</b> is not, <b class="file">usrDepend.c</b> defines <b class="symbol_UC">INCLUDE_NET_INIT</b> for you. Because the network initialization requires the network software, the <b class="file">userDepend.c</b> file also defines <b class="symbol_UC">INCLUDE_NETWORK</b>.</p><dd><p class="Body"><a name="86076"> </a>Because most of the dependencies are taken care of in <b class="file">usrDepend.c</b>, that file is currently included in <b class="file">usrConfig.c</b>. This simplifies the build process and the selection of options. However, you can change or add dependencies if you choose.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="86079">8.6.2  &nbsp;&nbsp;Executing VxWorks from ROM</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86081"> </a>You can put VxWorks or a VxWorks-based application into ROM; this is discussed in <a href="c-config9.html#86719"><i class="title">8.9.2&nbsp;Creating a VxWorks System in ROM</i></a>. For an example of a ROM-based VxWorks application, see the VxWorks boot ROM program. The file <i class="textVariable">installDir</i><b class="file">/target/config/all/bootConfig.c</b> is the configuration module for the boot ROM, replacing the file <b class="library">usrConfig.c</b> provided for the default VxWorks development system. </p><dd><p class="Body"><a name="86085"> </a>In such ROM configurations, the <i class="term">text</i> and <i class="term">data</i> segments of the boot or VxWorks image are first copied into the system RAM, then the boot procedure or VxWorks executes in RAM. On some systems where memory is a scarce resource, it is possible to save space by copying only the data segment to RAM. The text segment remains in ROM and executes from that address space<i class="term">, </i>and thus is termed<i class="term"> ROM&nbsp;resident</i>. The memory that was to be occupied by the text segment in RAM is now available for an application (up to 300KB for a standalone VxWorks system). Note that ROM-resident VxWorks is not supported on all boards; see your target's man page if you are not sure that your board supports this configuration.</p><dd><p class="Body"><a name="86086"> </a>The drawback of a ROM-resident text segment is the limited data widths and lower memory access time of the EPROM, which causes ROM-resident text to execute more slowly than if it was in RAM. This can sometimes be alleviated by using faster EPROM devices or by reconfiguring the standalone system to exclude unnecessary system features.</p><dd><p class="Body"><a name="86087"> </a>Aside from program text not being copied to RAM, the ROM-resident versions of the VxWorks boot ROMs and the standalone VxWorks system are identical to the conventional versions. A ROM-resident image is built with an uncompressed version of either the boot ROM or standalone VxWorks system image. VxWorks target makefiles include entries for building these images; see <a href="c-config6.html#86095">Table&nbsp;8-7</a>.&nbsp;&nbsp;&nbsp;<p class="table"><h4 class="EntityTitle"><a name="86095"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 8-7:&nbsp;&nbsp;Makefile ROM-Resident Images</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="86101"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Architecture</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="86106"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Image FIle<sup><b class="FootnoteMarker">1</b></sup></font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="86108"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86110"> </a>MIPS and&nbsp;</div><div class="CellBody"><a name="86111"> </a>PowerPC&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86114"> </a><b class="file">bootrom_res_high</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86116"> </a>ROM-resident boot ROM image. The data segment is copied from ROM to RAM at address <b class="symbol_UC">RAM_HIGH_ADRS</b>.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86118"> </a>&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86121"> </a><b class="file">vxWorks.res_rom_res_low</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86123"> </a>ROM-resident standalone system image without compression. The data segment is copied from ROM to RAM at address <b class="symbol_UC">RAM_LOW_ADRS</b>.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86125"> </a>&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86128"> </a><b class="file">vxWorks.res_rom_nosym_res_low</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86130"> </a>ROM-resident standalone system image without compression or symbol table. Data segment is copied from ROM to RAM at address <b class="symbol_UC">RAM_LOW_ADRS</b>.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86132"> </a>All Other&nbsp;</div><div class="CellBody"><a name="86133"> </a>Targets&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86136"> </a><b class="file">bootrom_res</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86138"> </a>ROM-resident boot ROM image.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86140"> </a>&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86143"> </a><b class="file">vxWorks.res_rom</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86145"> </a>ROM-resident standalone system image without compression.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86147"> </a>&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86150"> </a><b class="file">vxWorks.res_rom_nosym</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86152"> </a>ROM-resident system image without compression or symbol table. Ideal for the Tornado environment.&nbsp;</div></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"><p class="FootnoteNumberMarker">1:&nbsp;<span class="TableFootnote"><a name="86105"> </a>All images have a corresponding file in Motorola S-record or Intel Hex format with the same file name plus the extension <b class="file">.hex</b>.</span></p></td></tr></table></p> &nbsp;&nbsp;&nbsp;<div class="frame"><h4 class="EntityTitle"><a name="86156"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 8-1:&nbsp;&nbsp;ROM-Resident Memory Layout</font></a></h4><dl class="margin"><div class="Anchor"><a name="86206"> </a><img class="figure" border="0" src="images/c-config0.gif"></div></dl>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -