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

📄 c-tshell2.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>    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-tshell1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-tshell3.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="84386">9.2  &nbsp;&nbsp;Target-Resident Shell</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84387"> </a>For the most part, the target-resident shell works the same as the Tornado shell; for details, see the <i class="title">Tornado User's Guide: Shell</i>. However, there are some differences, which are described in this section.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84389">9.2.1  &nbsp;&nbsp;Creating the Target Shell</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84827"> </a>To create the target shell, you must configure it into the VxWorks configuration by selecting <b class="symbol_UC">INCLUDE_SHELL</b> for inclusion in the project facility VxWorks view (for details, see <i class="title">Tornado User's Guide: Projects</i>). When you do so, <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> (in <b class="file">usrConfig.c</b>) spawns the target shell task by calling <b class="routine"><i class="routine">shellInit</i></b><b>(&nbsp;)</b>. The first argument to <b class="routine"><i class="routine">shellInit</i></b><b>(&nbsp;)</b> specifies the target shell's stack size, which must be large enough to accommodate any routines you call from the target shell. The second argument is a boolean that specifies whether the target shell's input is from an interactive source (TRUE), or a non-interactive source (FALSE) such as a script file. If the source is interactive, then the shell prompts for commands but does not echo them to standard out; the reverse is true if the source is non-interactive.</p><dd><p class="Body"><a name="84835"> </a>The shell task (<b class="task">tShell</b>) is created with the <b class="symbol_UC">VX_UNBREAKABLE</b> option; therefore, breakpoints cannot be set in this task, because a breakpoint in the shell would make it impossible for the user to interact with the system. Any routine or task that is invoked from the target shell, rather than spawned, runs in the <b class="task">tShell </b>context. </p><dd><p class="Body"><a name="84399"> </a>Only one target shell can run on a VxWorks system at a time; the target shell parser is not reentrant, because it is implemented using the UNIX tool <b class="command">yacc</b>.</p><dd><p class="Body"><a name="84412"> </a>When the shell is started, the banner displayed in <a href="c-tshell2.html#84408">Figure&nbsp;9-1</a> appears.For more information, see the reference entry for <b class="library">shellLib</b>.&nbsp;&nbsp;&nbsp;<div class="frame"><h4 class="EntityTitle"><a name="84408"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 9-1:&nbsp;&nbsp;Typical Target Shell Sign-on Banner</font></a></h4><dl class="margin"><dl class="margin"><dl class="margin"><dd><pre class="Code"><b><a name="84410">]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]      ]]]]]]]]]]]  ]]]]     ]]]]]]]]]]       ]]              ]]]]         (R) ]     ]]]]]]]]]  ]]]]]]     ]]]]]]]]       ]]               ]]]]             ]]     ]]]]]]]  ]]]]]]]]     ]]]]]] ]     ]]                ]]]]             ]]]     ]]]]] ]    ]]]  ]     ]]]] ]]]   ]]]]]]]]]  ]]]] ]] ]]]]  ]]   ]]]]] ]]]]     ]]]  ]]    ]  ]]]     ]] ]]]]] ]]]]]]   ]] ]]]]]]] ]]]] ]]   ]]]]   ]]]]]     ]  ]]]]     ]]]]]      ]]]]]]]] ]]]]   ]] ]]]]    ]]]]]]]    ]]]]  ]]]]]]      ]]]]]     ]]]]]]    ]  ]]]]]  ]]]]   ]] ]]]]    ]]]]]]]]    ]]]] ]]]]]]]    ]]]]]  ]    ]]]]]]  ]    ]]]   ]]]]   ]] ]]]]    ]]]] ]]]]    ]]]] ]]]]]]]]  ]]]]]  ]]]    ]]]]]]]      ]     ]]]]]]]  ]]]]    ]]]]  ]]]] ]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]       Development System ]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]       VxWorks version 5.4 ]]]]]]]]]]]]]]]]]]]]]]]]]]       KERNEL: WIND version 2.5 ]]]]]]]]]]]]]]]]]]]]]]]]]       Copyright Wind River Systems, Inc., 1984-1998                    CPU: Motorola MVME2600 - MPC 603p.  Processor #0.                  Memory Size: 0x400000.  BSP version 1.2/0.                 WDB: Ready.  -&gt; </a></b></pre></dl></dl></dl></div> </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84430">9.2.2  &nbsp;&nbsp;Using the Target Shell</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84432"> </a>The target shell works almost exactly like the Tornado shell; see the <i class="title">Tornado User's Guide: Shell </i>and the <b class="library">usrLib</b> reference entry for details. You can also type the following command to display help:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84433"></b><tt class="output">-&gt;</tt><b> help</a></b></pre></dl><dd><p class="Body"><a name="84434"> </a>The following target shell command lists all the available help routines:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84435"></b><tt class="output">-&gt; </tt><b>lkup "Help"</a></b></pre></dl><dd><p class="Body"><a name="84437"> </a>The target shell has its own set of terminal-control characters, unlike the Tornado shell, which inherits its setting from the host window from which it was invoked. <a href="c-tshell2.html#84447">Table&nbsp;9-1</a> lists the target shell's terminal-control characters. The first four of these are defaults that can be mapped to different keys using routines in <b class="library">tyLib</b> (see also <a href="c-iosys7.html#84545"><i class="title">Tty Special Characters</i></a>).<p class="table"><h4 class="EntityTitle"><a name="84447"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 9-1:&nbsp;&nbsp;Target Shell Terminal Control Characters</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="84451"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Command</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84453"> </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="84456"> </a><kbd>CTRL+H</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84458"> </a>Delete a character (backspace).&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84461"> </a><kbd>CTRL+U</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84463"> </a>Delete an entire line.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84466"> </a><kbd>CTRL+C</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84468"> </a>Abort and restart the shell.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84471"> </a><kbd>CTRL+X</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84473"> </a>Reboot (trap to the ROM monitor).&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84476"> </a><kbd>CTRL+S</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84478"> </a>Temporarily suspend output.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84481"> </a><kbd>CTRL+Q</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84483"> </a>Resume output.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84486"> </a><kbd>ESC</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84489"> </a>Toggle between input mode and edit mode.&nbsp;</div></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="84491"> </a>The shell line-editing commands are the same as they are for the Tornado shell. For a summary of the commands, see the <i class="title">Tornado User's Guide: Shell</i>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84493">9.2.3  &nbsp;&nbsp;Debugging with the Target Shell</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84495"> </a>The target shell includes the same debugging utilities as the Tornado shell, if <b class="symbol_UC">INCLUDE_DEBUG</b> is selected for inclusion in the project facility VxWorks view. For details, see the <i class="title">Tornado User's Guide: Shell </i>and the reference entry for <b class="library">dbgLib</b>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84500">9.2.4  &nbsp;&nbsp;Aborting the Target Shell</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84501"> </a>Occasionally it is desirable to abort the shell's evaluation of a statement. For example, an invoked routine may loop excessively, suspend, or wait on a semaphore. This may happen as the result of errors in arguments specified in the invocation, errors in the implementation of the routine itself, or simply oversight as to the consequences of calling the routine at all.</p><dd><p class="Body"><a name="84503"> </a>In such cases it is usually possible to abort and restart the target shell task. This is done by pressing the special target-shell abort character on the keyboard, <kbd>CTRL+C</kbd> by default. This causes the target shell task to restart execution at its original entry point. Note that the abort key can be changed to a character other than <kbd>CTRL+C</kbd> by calling <b class="routine"><i class="routine">tyAbortSet</i></b><b>(</b>&nbsp;<b>)</b>. </p>

⌨️ 快捷键说明

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