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

📄 c-tshell3.html

📁 vxworks相关论文
💻 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>    Target Shell   </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-tshell.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-tshell2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-appTitle.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="84589">9.3  &nbsp;&nbsp;Other Target-Resident Facilities</a></i></h3></font><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84590">9.3.1  &nbsp;&nbsp;Target Symbol Table, Module Loader, and Module Unloader</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84592"> </a>To make full use of the target shell's features, you should also define the target symbol table, as well as the target module loader and unloader. Select the following components (identified by their associated macros) in the VxWorks view (see <i class="title">Tornado User's Guide: Projects</i> for configuration information):</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84596"> </a><b class="symbol_UC">INCLUDE_SYM_TBL</b> for target symbol table support, plus one of the following:</li></ul></p><dl class="margin"><p class="listspace"><ul class="Dash2" type="circle"><li><a name="84598"> </a><b class="symbol_UC">INCLUDE_NET_SYM_TBL</b> to load the symbol table from the network (<b class="file">vxWorks.sym</b>; you will also need to separately load <b class="file">vxWorks</b>)</li></ul></p><p class="listspace"><ul class="Dash2" type="circle"><li><a name="84600"> </a><b class="symbol_UC">INCLUDE_STANDALONE_SYM_TBL</b> to build a VxWorks image that includes the target symbol table (<b class="file">vxWorks.st</b>)</li></ul></p></dl><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84602"> </a><b class="symbol_UC">INCLUDE_LOADER </b></li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84604"> </a><b class="symbol_UC">INCLUDE_UNLOADER</b> </li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84606"> </a>If the target symbol table is included, <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> runs <b class="routine"><i class="routine">hashLibInit</i></b><b>(&nbsp;)</b> and <b class="routine"><i class="routine">symLibInit</i></b><b>(&nbsp;)</b>to initialize the corresponding libraries. The target symbol table is created by calling <b class="routine"><i class="routine">symTblCreate</i></b><b>(</b>&nbsp;<b>)</b>. For convenience during debugging (see <a href="c-tshell2.html#84493"><i class="title">9.2.3&nbsp;Debugging with the Target Shell</i></a>), it is most useful to have access to all symbols in the system. On the other hand, a production version of a system can be built that does not require the target symbol table, if (for example) memory resources are constrained.</p><dd><p class="Body"><a name="84612"> </a>The <b class="routine"><i class="routine">symTblCreate</i></b><b>(</b>&nbsp;<b>)</b> call creates an empty target symbol table. VxWorks system facilities are not accessible through the target shell until the symbol definitions for the booted VxWorks system are entered into the target symbol table. This is done by reading the target symbol table from a file called <b class="file">vxWorks.sym</b> in the same directory from which <b class="file">vxWorks</b> was loaded (<i class="textVariable">installDir</i><b class="file">/target/config/</b><i class="textVariable">bspname</i>). This file contains an object module that consists only of a target symbol table section containing the symbol definitions for all the variables and routines in the booted system module. It has zero-length (empty) code, data, and relocation sections. Nonetheless, it is a legitimate object module in the standard object module format.</p><dd><p class="Body"><a name="84614"> </a>The symbols in <b class="file">vxWorks.sym</b> are entered in the target symbol table by calling <b class="routine"><i class="routine">loadSymTbl</i></b><b>(</b>&nbsp;<b>)</b> (whose source is in <i class="textVariable">installDir</i><b class="file">/target/src/config/usrLoadSym.c</b>). This routine uses the target-resident module loader to load symbols from <b class="file">vxWorks.sym</b> into the target symbol table.</p><dd><p class="Body"><a name="84617"> </a>For the most part, the target-resident facilities work the same as their Tornado host counterparts; see <a href="c-config9.html#86700"><i class="title">8.9.1&nbsp;Creating a Standalone VxWorks System with a Built-in Symbol Table</i></a>, <a href="c-config4.html#85491"><i class="title">8.4.4&nbsp;Downloading an Application Module</i></a>, and <a href="c-config4.html#85519"><i class="title">8.4.6&nbsp;Unloading Modules</i></a>. However, as stated earlier, the target-resident facilities can be useful if you are building dynamically configured applications. For example, with the target-resident loader, you can load from a target disk as well as over the network, with these caveats: If you use the target-resident loader to load a module over the network (as opposed to loading from a target-system disk), the amount of memory required to load an object module depends on what kind of access is available to the remote file system over the network. Loading a file that is mounted over the default network driver requires enough memory to hold two copies of the file simultaneously. First, the entire file is copied to a buffer in local memory when opened; second, the file resides in memory when it is linked to VxWorks. On the other hand, loading an object module from a host file system mounted through NFS only requires enough memory for one copy of the file (plus a small amount of overhead). In any case, however, using the target-resident loader takes away additional memory from your application--most significantly for the target-resident symbol table required by the target-resident loader.</p><dd><p class="Body"><a name="84622"> </a>For information on the target-resident module loader, unloader, and symbol table, see the <b class="library">loadLib</b>, <b class="library">unldLib</b>, and <b class="library">symLib</b> reference entries.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84626">9.3.2  &nbsp;&nbsp;Show Routines</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84627"> </a>VxWorks includes system information routines which print pertinent system status on the specified object or service; however, they show only a snapshot of the system service at the time of the call and may not reflect the current state of the system. To use these routines, you must define the associated configuration macro (see the <i class="title">Tornado User's Guide: Projects</i>). When you invoke them, their output is sent to the standard output device. <a href="c-tshell3.html#84641">Table&nbsp;9-2</a> lists common system show routines.<p class="table"><h4 class="EntityTitle"><a name="84641"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 9-2:&nbsp;&nbsp;Show Routines&nbsp;</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="84645"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Call</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84647"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84948"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Configuration Macro</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="84650"> </a><b class="routine"><i class="routine">envShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84653"> </a>Display the environment for a given task on <i class="acronym_lc">stdout</i>&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84950"> </a><b class="symbol_UC">INCLUDE_TASK_SHOW </b>&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84656"> </a><b class="routine"><i class="routine">memPartShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84658"> </a>Show the partition blocks and statistics&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84952"> </a><b class="symbol_UC">INCLUDE_MEM_SHOW </b>&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84661"> </a><b class="routine"><i class="routine">memShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84663"> </a>System memory show routine&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84954"> </a><b class="symbol_UC">INCLUDE_MEM_SHOW </b>&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84666"> </a><b class="routine"><i class="routine">moduleShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84668"> </a>Show statistics for all loaded modules&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84956"> </a>Included automatically with <b class="symbol_UC">INCLUDE_MODULE_MANAGER</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84671"> </a><b class="routine"><i class="routine">msgQShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84673"> </a>Message queue show util-ity (both POSIX and <i class="term">wind</i>)&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84958"> </a><b class="symbol_UC">INCLUDE_POSIX_MQ_SHOW <br>INCLUDE_MSG_Q_SHOW</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84676"> </a><b class="routine"><i class="routine">semShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84678"> </a>Semaphore show utility (both POSIX and <i class="term">wind</i>)&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84960"> </a><b class="symbol_UC">INCLUDE_SEM_SHOW</b>, <b class="symbol_UC">INCLUDE_POSIX_SEM_SHOW</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84681"> </a><b class="routine"><i class="routine">show</i></b><b>(</b>&nbsp;<b>)</b>&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84683"> </a>Generic object show utility&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84962"> </a>&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84686"> </a><b class="routine"><i class="routine">stdioShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84688"> </a>Standard I/O file pointer show utility&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84964"> </a><b class="symbol_UC">INCLUDE_STDIO_SHOW</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84691"> </a><b class="routine"><i class="routine">taskSwitchHookShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84693"> </a>Show the list of task switch routines&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84966"> </a><b class="symbol_UC">INCLUDE_TASK_HOOKS_SHOW</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84696"> </a><b class="routine"><i class="routine">taskCreateHookShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84698"> </a>Show the list of task create routines&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84968"> </a><b class="symbol_UC">INCLUDE_TASK_HOOKS_SHOW</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84701"> </a><b class="routine"><i class="routine">taskDeleteHookShow</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84703"> </a>Show the list of task delete routines&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84970"> </a><b class="symbol_UC">INCLUDE_TASK_HOOKS_SHOW</b> &nbsp;</div></td>

⌨️ 快捷键说明

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