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

📄 c-tshell2.html

📁 this about vxworks operations systems
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<dd><p class="Body"><a name="84506"> </a>When restarted, the target shell automatically reassigns the system standard input and output streams to the original assignments they had when the target shell was first spawned. Thus any target shell redirections are canceled, and any executing shell scripts are aborted.</p><dd><p class="Body"><a name="84507"> </a>The abort facility works only if the following are true:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84512"> </a><b class="routine"><i class="routine">dbgInit</i></b><b>(</b>&nbsp;<b>)</b> has been called (see <a href="c-tshell2.html#84493"><i class="title">9.2.3&nbsp;Debugging with the Target Shell</i></a>).</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84517"> </a><b class="routine"><i class="routine">excTask</i></b><b>(</b>&nbsp;<b>)</b> is running (see <a href="c-config3.html#84619"><i class="title">Installation of Exception Handling and Logging</i></a>).</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84518"> </a>The driver for the particular keyboard device supports it (all VxWorks-supplied drivers do).</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84519"> </a>The device's abort option is enabled. This is done with an <b class="routine"><i class="routine">ioctl</i></b><b>(</b>&nbsp;<b>)</b> call, usually in the root task in <b class="library">usrConfig.c</b>. For information on enabling the target shell abort character, see <a href="c-iosys7.html#84451"><i class="title">Tty Options</i></a>.</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84523"> </a>Also, you may occasionally enter an expression that causes the target shell to incur a fatal error such as a bus/address error or a privilege violation. Such errors normally result in the suspension of the offending task, which allows further debugging.</p><dd><p class="Body"><a name="84524"> </a>However, when such an error is incurred by the target shell task, VxWorks automatically restarts the target shell, because further debugging is impossible without it. Note that for this reason, as well as to allow the use of breakpoints and single-stepping, it is often useful when debugging to spawn a routine as a task instead of just calling it directly from the target shell.</p><dd><p class="Body"><a name="84525"> </a>When the target shell is aborted for any reason, either because of a fatal error or because it is aborted from the terminal, a task trace is displayed automatically. This trace shows where the target shell was executing when it died.</p><dd><p class="Body"><a name="84526"> </a>Note that an offending routine can leave portions of the system in a state that may not be cleared when the target shell is aborted. For instance, the target shell might have taken a semaphore, which cannot be given automatically as part of the abort.<b></b> </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84530">9.2.5  &nbsp;&nbsp;Remote Login to the Target Shell</a></i></h4></font><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84533">Remote Login From Host: <b class="command">telnet</b><i class="i"></i> and <b class="command">rlogin</b> </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84534"> </a>When VxWorks is first booted, the target shell's terminal is normally the system console. You can use <b class="command">telnet</b> to access the target shell from a host over the network if you select <b class="symbol_UC">INCLUDE_TELNET</b> for inclusion in the project facility VxWorks view (see <i class="title">Tornado User's Guide: Projects</i>). Defining <b class="symbol_UC">INCLUDE_TELNET</b> creates the <b class="task">tTelnetd</b> task. To access the target shell over the network, enter the following command from the host (<i class="textVariable">targetname</i> is the name of the target VxWorks system):</p><dl class="margin"><dd><pre class="Code2"><b><a name="84538"></b><tt class="output">%</tt><b> telnet "<i class="textVariable">targetname</i>"</a></b></pre></dl><dd><p class="Body"><a name="84540"> </a>UNIX host systems also use <b class="command">rlogin</b> to provide access to the target shell from the host. Select <b class="symbol_UC">INCLUDE_RLOGIN</b> for inclusion in the project facility VxWorks view to create the <b class="task">tRlogind</b> task. However, note that VxWorks does not support <b class="command">telnet</b> or <b class="command">rlogin</b> access from the VxWorks system to the host.</p><dd><p class="Body"><a name="84541"> </a>A message is printed on the system console indicating that the target shell is being accessed via <b class="command">telnet</b> or <b class="command">rlogin</b>, and that it is no longer available from its console. </p><dd><p class="Body"><a name="84544"> </a>If the target shell is being accessed remotely, typing at the system console has no effect. The target shell is a single-user system--it allows access either from the system console or from a single remote login session, but not both simultaneously. To prevent someone from remotely logging in while you are at the console, use the routine <b class="routine"><i class="routine">shellLock</i></b><b>(</b>&nbsp;<b>)</b> as follows:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84546"></b><tt class="output">-&gt;</tt><b> shellLock 1</a></b></pre></dl><dd><p class="Body"><a name="84547"> </a>To make the target shell available again to remote login, enter the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84548"></b><tt class="output">-&gt;</tt><b> shellLock 0</a></b></pre></dl><dd><p class="Body"><a name="84549"> </a>To end a remote-login target shell session, call <b class="routine"><i class="routine">logout</i></b><b>(&nbsp;)</b> from the target shell. To end an <b class="command">rlogin</b> session, type <kbd>TILDE</kbd> and <kbd>DOT </kbd>as the only characters on a line:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84551"></b><tt class="output">-&gt;</tt><b> ~. </a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84552">Remote Login Security</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84554"> </a>You can be prompted to enter a login user name and password when accessing VxWorks remotely:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84555"></b><tt class="output">VxWorks login:</tt><b> <i class="textVariable">user_name</i></a></b><dd> <b><a name="84556"></b><tt class="output">Password:</tt><b> <i class="textVariable">password</i></a></b></pre></dl><dd><p class="Body"><a name="84558"> </a>The remote-login security feature is enabled by selecting <b class="symbol_UC">INCLUDE_SECURITY</b> for inclusion in the project facility VxWorks view. The default login user name and password provided with the supplied system image is <i class="term">target</i> and <i class="term">password</i>. You can change the user name and password with the <b class="routine"><i class="routine">loginUserAdd</i></b><b>(</b>&nbsp;<b>)</b><b class="command"> </b>routine, as follows:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84560"></b><tt class="output">-&gt;</tt><b> loginUserAdd "fred", "<i class="textVariable">encrypted_password</i>"</a></b></pre></dl><dd><p class="Body"><a name="84563"> </a>To obtain<i class="textVariable"> encrypted_password</i>, use the tool <b class="command">vxencrypt</b> on the host system. This tool prompts you to enter your password, and then displays the encrypted version.</p><dd><p class="Body"><a name="84564"> </a>To define a group of login names, include a list of <b class="routine"><i class="routine">loginUserAdd</i></b><b>(</b>&nbsp;<b>)</b> commands in a startup script and run the script after the system has been booted. Or include the list of <b class="routine"><i class="routine">loginUserAdd</i></b><b>(&nbsp;)</b> commands to the file <b class="file">usrConfig.c</b>, then rebuild VxWorks. </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="84805"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE:  </font></b></a>The values for the user name and password apply only to remote login into the VxWorks system. They do not affect network access from VxWorks to a remote system; See <i class="title">VxWorks Network Programmer's Guide: rlogin and telnet, Host Access Applications</i>.</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="84566"> </a>The remote-login security feature can be disabled at boot time by specifying the flag bit 0x20 (<b class="symbol_UC">SYSFLAG_NO_SECURITY</b>) in the <i class="textVariable">flags</i> parameter on the boot line (see <i class="title">Tornado Getting Started</i>). This feature can also be disabled by deselecting <b class="symbol_UC">INCLUDE_SECURITY</b> in the project facility VxWorks view. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84570">9.2.6  &nbsp;&nbsp;Summary of Target and Host&nbsp;Shell Differences </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84571"> </a>For details on the Tornado shell, see the <i class="title">Tornado User's Guide: Shell</i>. The following is a summary of the differences between it and the target shell:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84572"> </a>Both shells contain a C interpreter, which allows C-shell and <b class="command">vi</b> editing facilities. However, the Tornado shell also provides a Tcl interpreter.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84573"> </a>You can have multiple Tornado shells active for any given target; only one target shell can be active for a target at any one time.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84574"> </a>The Tornado shell allows virtual I/O; the target shell does not.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84575"> </a>The target shell does not have a GNU C++ demangler; it is necessary to use the target tools when C++ demangling is required.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84576"> </a>The Tornado shell is always ready to execute. The target shell, as well as its associated target-resident symbol table and module loader/unloader, must be configured into the VxWorks image by including the appropriate components in the project facility VxWorks view (discussed throughout this chapter).</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84577"> </a>Because the target shell is often started from the system console, the standard input and output are directed to the same window. For the Tornado shell, these standard I/O streams are not necessarily directed to the same window as the Tornado shell. For details, see the <i class="title">Tornado User's Guide: Shell</i>.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84578"> </a>The Tornado shell can perform many control and information functions entirely on the host without consuming target resources.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84579"> </a>The Tornado shell uses host resources for most functions so that it remains segregated from the target. This means that the Tornado shell can operate on the target from the outside. The target shell, on the other hand, must act on itself. This means that there are limitations to what the target shell can do (for example, while debugging it cannot set breakpoints on itself or on routines it calls). Also, conflicts in priority may occur while using the target shell.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84580"> </a>When the target shell encounters a string literal ("...") in an expression, it allocates space for the string including the null-byte string terminator. The value of the literal is the address of the string in the newly allocated storage. For example, the following expression allocates 12 bytes from the target memory pool, enters the string in those 12 bytes (including the null terminator), and assigns the address of the string to <b class="keyword">x</b>:</li></ul></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="84581"></b><tt class="output">-&gt;</tt><b> x = "hello there"</a></b></pre></dl></dl><dl class="margin"><dd><div class="Indent"><a name="84582"> </a>The following expression can be used to return those 12 bytes to the target memory pool (see the <b class="library">memLib</b> reference entry for information on memory management):</div><br><dl class="margin"><dd><pre class="Code3"><b><a name="84583"></b><tt class="output">-&gt;</tt><b> free (x)</a></b></pre></dl><dd><div class="Indent"><a name="84584"> </a>Furthermore, even when a string literal is not assigned to a symbol, memory is still permanently allocated for it. For example, the following expression uses 12 bytes of memory that are never freed:</div><br><dl class="margin"><dd><pre class="Code3"><b><a name="84585"></b><tt class="output">-&gt; </tt><b>printf ("hello there")</a></b></pre></dl><dd><div class="Indent"><a name="84586"> </a>This is because if strings were only temporarily allocated, and a string literal were passed to a routine being spawned as a task, then by the time the task executed and attempted to access the string, the target shell would have already released (and possibly even reused) the temporary storage where the string was held.</div><br><dd><div class="Indent"><a name="84587"> </a>After extended development sessions with the target shell, the cumulative memory used for strings may be noticeable. If this becomes a problem, you must reboot your target. Because the Tornado shell has access to a host-controlled target memory pool, this memory leak never occurs.</div><br></dl></dl></dl><a name="foot"><hr></a><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></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

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