Update NSH documentation.
This commit is contained in:
parent
cccc86da09
commit
261045e689
@ -8,7 +8,7 @@
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
|
||||
<p>Last Updated: October 20, 2017</p>
|
||||
<p>Last Updated: October 23, 2017</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -353,7 +353,7 @@
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdping">2.45 Check Network Peer (ping/ping6)</a>
|
||||
<a href="#cmdping6">2.45 Check Network Peer (ping6)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -509,78 +509,97 @@
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#configuration">3.0 Configuration Settings</a>
|
||||
<a href="#builtincmds">3.0 Built-In Commands</a>
|
||||
</td>
|
||||
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#builtinping">3.1 Check Network Peer (ping)</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#configuration">4.0 Configuration Settings</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmddependencies">3.1 Command Dependencies on Configuration Settings</a>
|
||||
<a href="#cmddependencies">4.1 Command Dependencies on Configuration Settings</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#nshconfiguration">3.2 NSH-Specific Configuration Settings</a>
|
||||
<a href="#builtinconfig">4.2 Built-In Command Dependencies on Configuration Settings</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#nshconfiguration">4.3 NSH-Specific Configuration Settings</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#customizingnsh">4.0 Customizing the NuttShell</a>
|
||||
<a href="#customizingnsh">5.0 Customizing the NuttShell</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#custonshlib">4.1 The NSH Library and NSH Initialization</a>
|
||||
<a href="#custonshlib">5.1 The NSH Library and NSH Initialization</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#custoncmds">4.2 NSH Commands</a>
|
||||
<a href="#custoncmds">5.2 NSH Commands</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#custapps">4.3 NSH "Built-In" Applications</a>
|
||||
<a href="#custapps">5.3 NSH "Built-In" Applications</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#custinit">4.4 Customizing NSH Initialization</a>
|
||||
<a href="#custinit">5.4 Customizing NSH Initialization</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#nshlogin">5.0 Shell Login</a>
|
||||
<a href="#nshlogin">6.0 Shell Login</a>
|
||||
</td>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#enablelogin">5.1 Enabling Shell Logins</a>
|
||||
<a href="#enablelogin">6.1 Enabling Shell Logins</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#verifymethods">5.2 Verification of Credentials</a>
|
||||
<a href="#verifymethods">6.2 Verification of Credentials</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#passwdfiles">5.3 Password Files</a>
|
||||
<a href="#passwdfiles">6.3 Password Files</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#passwdromfs">5.4 Creating a Password File for a ROMFS File System</a>
|
||||
<a href="#passwdromfs">6.4 Creating a Password File for a ROMFS File System</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2513,38 +2532,20 @@ passwd <username> <password>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdping"><h2>2.45 Check Network Peer (ping/ping6)</h2></a>
|
||||
<a name="cmdping6"><h2>2.45 Check Network Peer (ping6)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Command Syntax:</b></p>
|
||||
<ul><pre>
|
||||
ping [-c <count>] [-i <interval>] <ip-address>
|
||||
ping6 [-c <count>] [-i <interval>] <ip-address>
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>.
|
||||
Test the network communication with a remote peer. Example,
|
||||
Test the network communication with a remote peer.
|
||||
</p>
|
||||
<ul><pre>
|
||||
nsh> ping 10.0.0.1
|
||||
PING 10.0.0.1 56 bytes of data
|
||||
56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
|
||||
10 packets transmitted, 10 received, 0% packet loss, time 10190 ms
|
||||
nsh>
|
||||
</pre></ul>
|
||||
<p>
|
||||
<code>ping6</code> differs from <code>ping</code> in that it uses IPv6 addressing.
|
||||
<code>ping6</code> differs from <a href="#builtinping"><code>ping</code></a> in that it uses IPv6 addressing.
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
@ -3263,7 +3264,61 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="configuration"><h1>3.0 Configuration Settings</h1></a>
|
||||
<a name="builtincmds"><h1>3.0 Built-In Commands</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
In addition to the commands that are part of NSH listed in the previous section above, there can be additional, external <i>built-in</i> applications that can be added to NSH.
|
||||
These are separately excecuble programs but will appear much like the commands that are a part of NSH.
|
||||
The primary difference from the user's perspective is that help information about the built-in applications is not available directly from NSH.
|
||||
Rather, you will need to execute the application with the <code>-h</code> option to get help about using the built-in applications.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are several built-in appliations in the <code>apps/</code> repository.
|
||||
No attempt is made here to enumerate all of them.
|
||||
But a few of the more common, useful built-in applications are listed below.
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="builtinping"><h2>3.1 Check Network Peer (ping)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Command Syntax:</b></p>
|
||||
<ul><pre>
|
||||
ping [-c <count>] [-i <interval>] <ip-address>
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>.
|
||||
Test the network communication with a remote peer. Example,
|
||||
</p>
|
||||
<ul><pre>
|
||||
nsh> ping 10.0.0.1
|
||||
PING 10.0.0.1 56 bytes of data
|
||||
56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
|
||||
56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
|
||||
10 packets transmitted, 10 received, 0% packet loss, time 10190 ms
|
||||
nsh>
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="configuration"><h1>4.0 Configuration Settings</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3287,7 +3342,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmddependencies"><h2>3.1 Command Dependencies on Configuration Settings</h2></a>
|
||||
<a name="cmddependencies"><h2>4.1 Command Dependencies on Configuration Settings</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3519,12 +3574,6 @@ nsh>
|
||||
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_WRITABLE</code> && <code>CONFIG_NSH_LOGIN_PASSWD</code></td>
|
||||
<td><code>CONFIG_NSH_DISABLE_PASSWD</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><code>ping</code></b></td>
|
||||
<td><code>CONFIG_NET</code> && <code>CONFIG_NET_ICMP</code> &&
|
||||
<code>CONFIG_NET_ICMP_SOCKET</code> && !<code>CONFIG_DISABLE_SIGNALS</code></td>
|
||||
<td><code>CONFIG_NSH_DISABLE_PING</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><code>ping6</code></b></td>
|
||||
<td><code>CONFIG_NET</code> && <code>CONFIG_NET_ICMPv6</code> &&
|
||||
@ -3691,7 +3740,33 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nshconfiguration"><h2>3.2 NSH-Specific Configuration Settings</h2></a>
|
||||
<a name="builtinconfig"><h2>4.2 Built-In Command Dependencies on Configuration Settings</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
All built-in applications require that support for NSH built-in applications has been enabled.
|
||||
This support is enabled with <code>CONFIG_BUILTIN=y</code> and <code>CONFIG_NSH_BUILTIN_APPS=y</code>.
|
||||
</p>
|
||||
|
||||
<center><p>Table. Built-In Command Dependencies on Configuration Settings</p>
|
||||
<table width="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<th align="left" width="25%">Command</th>
|
||||
<th align="left">Depends on Configuration</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><code>ping</code></b></td>
|
||||
<td><code>CONFIG_NET</code> && <code>CONFIG_NET_ICMP</code> &&
|
||||
<code>CONFIG_NET_ICMP_SOCKET</code> && <code>CONFIG_SYSTEM_PING</code> && !<code>CONFIG_DISABLE_SIGNALS</code> && !<code>CONFIG_DISABLE_POLL</code></td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nshconfiguration"><h2>4.3 NSH-Specific Configuration Settings</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4226,7 +4301,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="customizingnsh"><h1>4.0 Customizing the NuttShell</h1></a>
|
||||
<a name="customizingnsh"><h1>5.0 Customizing the NuttShell</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4241,7 +4316,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="custonshlib"><h2>4.1 The NSH Library and NSH Initialization</h2></a>
|
||||
<a name="custonshlib"><h2>5.1 The NSH Library and NSH Initialization</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4255,7 +4330,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
||||
That initialization performed by that example is discussed in the following paragraphs.
|
||||
</p>
|
||||
|
||||
<h3>4.1.1 NSH Initialization sequence</h3>
|
||||
<h3>5.1.1 NSH Initialization sequence</h3>
|
||||
|
||||
<p>
|
||||
The NSH start-up sequence is very simple.
|
||||
@ -4287,7 +4362,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
||||
</p>
|
||||
</ol>
|
||||
|
||||
<h3>4.1.2 <code>nsh_initialize()</code></h3>
|
||||
<h3>5.1.2 <code>nsh_initialize()</code></h3>
|
||||
|
||||
<p>
|
||||
The NSH initialization function, <code>nsh_initialize()</code>, be found in <code>apps/nshlib/nsh_init.c</code>.
|
||||
@ -4386,7 +4461,7 @@ mount -t vfat /dev/ram1 /tmp
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="custoncmds"><h2>4.2 NSH Commands</h2></a>
|
||||
<a name="custoncmds"><h2>5.2 NSH Commands</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4407,7 +4482,7 @@ nsh> help
|
||||
You can see the specific command dependencies in the table <a href="#cmddependencies">above</a>.
|
||||
</p>
|
||||
|
||||
<h3>4.2.1 Adding New NSH Commands</h3>
|
||||
<h3>5.2.1 Adding New NSH Commands</h3>
|
||||
|
||||
<p>
|
||||
New commands can be added to the NSH very easily.
|
||||
@ -4504,7 +4579,7 @@ struct cmdmap_s
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="custapps"><h2>4.3 NSH "Built-In" Applications</h2></a>
|
||||
<a name="custapps"><h2>5.3 NSH "Built-In" Applications</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4541,7 +4616,7 @@ Builtin Apps:
|
||||
Note that no detailed help information beyond the name of the built-in application is provided.
|
||||
</p>
|
||||
|
||||
<h3>4.3.1 Built-In Applications</h3>
|
||||
<h3>5.3.1 Built-In Applications</h3>
|
||||
|
||||
<p>
|
||||
<b>Overview.</b>
|
||||
@ -4739,7 +4814,7 @@ context:
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3>4.3.2 Synchronous Built-In Applications</h3>
|
||||
<h3>5.3.2 Synchronous Built-In Applications</h3>
|
||||
|
||||
<p>
|
||||
By default, built-in commands started from the NSH command line will run asynchronously with NSH.
|
||||
@ -4759,7 +4834,7 @@ CONFIG_SCHED_WAITPID=y
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="custinit"><h2>4.4 Customizing NSH Initialization</h2></a>
|
||||
<a name="custinit"><h2>5.4 Customizing NSH Initialization</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4792,7 +4867,7 @@ CONFIG_SCHED_WAITPID=y
|
||||
</p>
|
||||
</ol>
|
||||
|
||||
<h3>4.4.1 NuttShell Start up Scripts</h3>
|
||||
<h3>5.4.1 NuttShell Start up Scripts</h3>
|
||||
|
||||
<p>
|
||||
First of all you should look at <a href="#startupscript">NSH Start-Up Script</a> paragraph.
|
||||
@ -4988,7 +5063,7 @@ mount -t vfat /dev/ram1 /tmp
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nshlogin"><h1>5.0 Shell Login</h1></a>
|
||||
<a name="nshlogin"><h1>6.0 Shell Login</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -4996,7 +5071,7 @@ mount -t vfat /dev/ram1 /tmp
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="enablelogin"><h2>5.1 Enabling Shell Logins</h2></a>
|
||||
<a name="enablelogin"><h2>6.1 Enabling Shell Logins</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -5046,7 +5121,7 @@ CONFIG_NSH_LOGIN_FAILCOUNT=3
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="verifymethods"><h2>5.2 Verification of Credentials</h2></a>
|
||||
<a name="verifymethods"><h2>6.2 Verification of Credentials</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -5110,7 +5185,7 @@ CONFIG_NSH_LOGIN_PASSWD=y
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="passwdfiles"><h2>5.3 Password Files</h2></a>
|
||||
<a name="passwdfiles"><h2>6.3 Password Files</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -5178,7 +5253,7 @@ CONFIG_FSUTILS_PASSWD_KEY4=0x9abcdef0
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="passwdromfs"><h2>5.4 Creating a Password File for a ROMFS File System</h2></a>
|
||||
<a name="passwdromfs"><h2>6.4 Creating a Password File for a ROMFS File System</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -5480,8 +5555,8 @@ xxd -i romfs_img >nsh_romfsimg.h
|
||||
<li><a href="#cmdpasswd"><code>passwd</code></a></li>
|
||||
<li><a href="#passwdfiles">Password File</a></li>
|
||||
<li><a href="#passwdromfs">Password File, ROMFS</a></li>
|
||||
<li><a href="#cmdping"><code>ping</code></a></li>
|
||||
<li><a href="#cmdping"><code>ping6</code></a></li>
|
||||
<li><a href="#builtinping"><code>ping</code></a></li>
|
||||
<li><a href="#cmdping6"><code>ping6</code></a></li>
|
||||
<li><a href="#cmdpoweroff"><code>poweroff</code></a></li>
|
||||
<li><a href="#nshprompt">Prompt</a></li>
|
||||
<li><a href="#cmdps"><code>ps</code></a></li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user