update NSH docs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@875 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
3cbfe96ea8
commit
8735ef10ed
@ -448,5 +448,5 @@
|
|||||||
ping request logic.
|
ping request logic.
|
||||||
* NSH: Add ping command
|
* NSH: Add ping command
|
||||||
* Correct IP checksum calculation in ICMP and UDP message send logic.
|
* Correct IP checksum calculation in ICMP and UDP message send logic.
|
||||||
* NSH: Created a more detailed README file for NSH.
|
* NSH: Created an HTML document and a more detailed README file describing NSH.
|
||||||
|
|
||||||
|
@ -254,6 +254,11 @@
|
|||||||
<a href="#nshconfiguration">3.2 NSH-Specific Configuration Settings</a>
|
<a href="#nshconfiguration">3.2 NSH-Specific Configuration Settings</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img src="favicon.ico"></td>
|
||||||
|
<td>
|
||||||
|
<a href="#index">Index</a>
|
||||||
|
</td>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -415,7 +420,7 @@ fi
|
|||||||
<b><code>cd</code> and <code>pwd</code></b>.
|
<b><code>cd</code> and <code>pwd</code></b>.
|
||||||
All path arguments to commands may be either an absolute path or a
|
All path arguments to commands may be either an absolute path or a
|
||||||
path relative to the current working directory. The current working
|
path relative to the current working directory. The current working
|
||||||
directory is set using the 'cd' command and can be queried either
|
directory is set using the <a href="#cmdcd"><code>cd</code></a> command and can be queried either
|
||||||
by using the <a href="#cmdpwd"><code>pwd</code></a> command or by
|
by using the <a href="#cmdpwd"><code>pwd</code></a> command or by
|
||||||
using the <a href="#cmdecho"><code>echo</code></a> <a href="#environvars"><code>$PWD</code></a>
|
using the <a href="#cmdecho"><code>echo</code></a> <a href="#environvars"><code>$PWD</code></a>
|
||||||
command.
|
command.
|
||||||
@ -849,6 +854,33 @@ nsh>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
mkdir <path>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
Create the directory at <code><path></code>.
|
||||||
|
All components of of <code><path></code> except the final directory name must exist on a mounted file
|
||||||
|
system; the final directory must not.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<b>Limited to Mounted File Systems</b>.
|
||||||
|
Recall that NuttX uses a <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> for its root file
|
||||||
|
system.
|
||||||
|
The <code>mkdir</code> command can only be used to create directories in volumes set up with the
|
||||||
|
<a href="#cmdmount"><code>mount</code></a> command; it cannot be used to create directories in the <i>pseudo</i> filesystem.
|
||||||
|
</p>
|
||||||
|
<p><b>Example:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
nsh> mkdir /mnt/fs/tmp
|
||||||
|
nsh> ls -l /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
drw-rw-rw- 0 TESTDIR/
|
||||||
|
drw-rw-rw- 0 TMP/
|
||||||
|
nsh>
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -857,6 +889,18 @@ nsh>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
mkfatfs <path>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
Format a fat file system on the block device specified by <code><path></code>.
|
||||||
|
NSH provides this command to access the <a href="mkfatfs"><code>mkfatfs()</code></a> NuttX API.
|
||||||
|
This block device must reside in the NuttX <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> and
|
||||||
|
must have been created by some call to <code>register_blockdriver()</code> (see <code>include/nuttx/fs.h</code>).
|
||||||
|
</p>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -865,6 +909,36 @@ nsh>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
mkfifo <path>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
Creates a FIFO character device anywhere in the pseudo file system, creating
|
||||||
|
whatever psuedo directories that may be needed to complete the <code><path></code>.
|
||||||
|
By convention, however, device drivers are place in the standard <code>/dev</code> directory.
|
||||||
|
After it is created, the FIFO device may be used as any other device driver.
|
||||||
|
NSH provides this command to access the <a href="NuttxUserGuide.html#mkfifo"><code>mkfifo()</code></a> NuttX API.
|
||||||
|
</p>
|
||||||
|
<p><b>Example</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
nsh> ls -l /dev
|
||||||
|
/dev:
|
||||||
|
crw-rw-rw- 0 console
|
||||||
|
crw-rw-rw- 0 null
|
||||||
|
brw-rw-rw- 0 ram0
|
||||||
|
nsh> mkfifo /dev/fifo
|
||||||
|
nsh> ls -l /dev
|
||||||
|
ls -l /dev
|
||||||
|
/dev:
|
||||||
|
crw-rw-rw- 0 console
|
||||||
|
crw-rw-rw- 0 fifo
|
||||||
|
crw-rw-rw- 0 null
|
||||||
|
brw-rw-rw- 0 ram0
|
||||||
|
nsh>
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -873,6 +947,65 @@ nsh>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
mount -t <fstype> <block-device> <code><dir-path></code>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
The 'm ount' command mounts a file system in the NuttX psuedo
|
||||||
|
filesystem. 'mount' performs a three way associating, binding:
|
||||||
|
</p>
|
||||||
|
<ol>
|
||||||
|
<li><b>File system.</b>
|
||||||
|
The '-t <code><fstype></code>' option identifies the type of
|
||||||
|
file system that has been formatted on the <code><block-device></code>.
|
||||||
|
As of this writing, <code>vfat</code> is the only supported value for <code><fstype></code>
|
||||||
|
</li>
|
||||||
|
<li><b>Block Device.</b>
|
||||||
|
The <code><block-device></code> argument is the full or relative
|
||||||
|
path to a block driver inode in the <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a>.
|
||||||
|
By convention, this is a name under the <code>/dev</code> sub-directory.
|
||||||
|
This <code><block-device></code> must have been previously formatted with the same file system
|
||||||
|
type as specified by <code><fstype></code>
|
||||||
|
</li>
|
||||||
|
<li><b>Mount Point.</b>
|
||||||
|
The mount point, <code><dir-path></code>, is the location in the
|
||||||
|
<a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> where the mounted volume will appear.
|
||||||
|
This mount point can only reside in the NuttX <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a>.
|
||||||
|
By convention, this mount point is a subdirectory under <code>/mnt</code>.
|
||||||
|
The mount command will create whatever psuedo directories that may be needed to complete the
|
||||||
|
full path but the full path must not already exist.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<p>
|
||||||
|
After the the volume has been mounted in the NuttX
|
||||||
|
<a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a>,
|
||||||
|
it may be access in the same way as other objects in thefile system.
|
||||||
|
</p>
|
||||||
|
<p><b>Example</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
nsh> ls -l /dev
|
||||||
|
/dev:
|
||||||
|
crw-rw-rw- 0 console
|
||||||
|
crw-rw-rw- 0 null
|
||||||
|
brw-rw-rw- 0 ram0
|
||||||
|
nsh> ls /mnt
|
||||||
|
nsh: ls: no such directory: /mnt
|
||||||
|
nsh> mount -t vfat /dev/ram0 /mnt/fs
|
||||||
|
nsh> ls -l /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
-rw-rw-rw- 15 TESTFILE.TXT
|
||||||
|
nsh> echo "This is a test" >/mnt/fs/testdir/example.txt
|
||||||
|
nsh> ls -l /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
-rw-rw-rw- 15 TESTFILE.TXT
|
||||||
|
-rw-rw-rw- 16 EXAMPLE.TXT
|
||||||
|
nsh> cat /mnt/fs/testdir/example.txt
|
||||||
|
This is a test
|
||||||
|
nsh>
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -944,6 +1077,32 @@ nsh>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<a <p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
rm <file-path>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
Remove the specified <code><file-path></code> name from the mounted file system.
|
||||||
|
Recall that NuttX uses a <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> for its root file
|
||||||
|
system.
|
||||||
|
The <code>rm</code> command can only be used to remove (unlink) files in volumes set up with the
|
||||||
|
<a href="#cmdmount"><code>mount</code></a> command;
|
||||||
|
it cannot be used to remove names in the <i>pseudo</i> filesystem.
|
||||||
|
</p>
|
||||||
|
<p><b>Example:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
nsh> ls /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
TESTFILE.TXT
|
||||||
|
EXAMPLE.TXT
|
||||||
|
nsh> rm /mnt/fs/testdir/example.txt
|
||||||
|
nsh> ls /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
TESTFILE.TXT
|
||||||
|
nsh>
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -952,6 +1111,33 @@ nsh>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<a <p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
rmdir <dir-path>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
Remove the specified <code><dir-path></code> directory from the mounted file system.
|
||||||
|
Recall that NuttX uses a <a href="NuttxUserGuide.html#FileSystemOverview"><i>pseudo</i> filesystem</a> for its root file
|
||||||
|
system.
|
||||||
|
The <code>rmdir</code> command can only be used to remove directories from volumes set up with the
|
||||||
|
<a href="#cmdmount"><code>mount</code></a> command;
|
||||||
|
it cannot be used to remove directories from the <i>pseudo</i> filesystem.
|
||||||
|
</p>
|
||||||
|
<p><b>Example:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
nsh> mkdir /mnt/fs/tmp
|
||||||
|
nsh> ls -l /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
drw-rw-rw- 0 TESTDIR/
|
||||||
|
drw-rw-rw- 0 TMP/
|
||||||
|
nsh> rmdir /mnt/fs/tmp
|
||||||
|
nsh> ls -l /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
drw-rw-rw- 0 TESTDIR/
|
||||||
|
nsh>
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -1021,6 +1207,28 @@ sleep <sec>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<a <p><b>Command Syntax:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
umount <dir-path>
|
||||||
|
</pre></ul>
|
||||||
|
<p>
|
||||||
|
<b>Synopsis</b>.
|
||||||
|
Un-mount the file system at mount point <code><dir-path></code>.
|
||||||
|
The <code>umount</code> command can only be used to un-mount volumes previously mounted using
|
||||||
|
<a href="#cmdmount"><code>mount</code></a> command.
|
||||||
|
</p>
|
||||||
|
<p><b>Example:</b></p>
|
||||||
|
<ul><pre>
|
||||||
|
nsh> ls /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
TESTDIR/
|
||||||
|
nsh> umount /mnt/fs
|
||||||
|
nsh> ls /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
nsh: ls: no such directory: /mnt/fs
|
||||||
|
nsh>
|
||||||
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
@ -1228,28 +1436,28 @@ usleep <usec>
|
|||||||
<th align="left">Description</th>
|
<th align="left">Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_FILEIOSIZE</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_FILEIOSIZE</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
Size of a static I/O buffer used for file access (ignored if
|
Size of a static I/O buffer used for file access (ignored if
|
||||||
there is no filesystem).
|
there is no filesystem).
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_STRERROR</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_STRERROR</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
strerror(errno) makes more readable output but strerror() is
|
strerror(errno) makes more readable output but strerror() is
|
||||||
very large and will not be used unless this setting is <i>y</i>
|
very large and will not be used unless this setting is <i>y</i>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_LINELEN</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_LINELEN</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
The maximum length of one command line and of one output line.
|
The maximum length of one command line and of one output line.
|
||||||
Default: 80
|
Default: 80
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_STACKSIZE</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_STACKSIZE</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
The stack size to use when spawning new threads or tasks. Such
|
The stack size to use when spawning new threads or tasks. Such
|
||||||
new threads are generated when a command is executed in background
|
new threads are generated when a command is executed in background
|
||||||
@ -1257,14 +1465,14 @@ usleep <usec>
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_NESTDEPTH</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_NESTDEPTH</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
The maximum number of nested <a href="#conditional"><code>if-then[-else]-fi</code></a> sequences that
|
The maximum number of nested <a href="#conditional"><code>if-then[-else]-fi</code></a> sequences that
|
||||||
are permissable. Default: 3
|
are permissable. Default: 3
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_DISABLESCRIPT</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_DISABLESCRIPT</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
This can be set to <i>y</i> to suppress support for scripting. This
|
This can be set to <i>y</i> to suppress support for scripting. This
|
||||||
setting disables the <a href="#cmdsh"><code>sh</code></a>, <a href="#cmdtest"><code>test</code></a>, and <a href="#cmtest"><code>[</code></a> commands and the
|
setting disables the <a href="#cmdsh"><code>sh</code></a>, <a href="#cmdtest"><code>test</code></a>, and <a href="#cmtest"><code>[</code></a> commands and the
|
||||||
@ -1273,7 +1481,7 @@ usleep <usec>
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_DISABLEBG</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_DISABLEBG</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
This can be set to <i>y</i> to suppress support for background
|
This can be set to <i>y</i> to suppress support for background
|
||||||
commands. This setting disables the <a href="#cmdoverview"><code>nice</code></a> command prefix and
|
commands. This setting disables the <a href="#cmdoverview"><code>nice</code></a> command prefix and
|
||||||
@ -1282,14 +1490,14 @@ usleep <usec>
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_CONSOLE</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_CONSOLE</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
If <code>CONFIG_EXAMPLES_NSH_CONSOLE</code>is set to <i>y</i>, then a serial
|
If <code>CONFIG_EXAMPLES_NSH_CONSOLE</code>is set to <i>y</i>, then a serial
|
||||||
console front-end is selected.
|
console front-end is selected.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_TELNET</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_TELNET</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
If <code>CONFIG_EXAMPLES_NSH_TELNET</code> is set to <i>y</i>, then a TELENET
|
If <code>CONFIG_EXAMPLES_NSH_TELNET</code> is set to <i>y</i>, then a TELENET
|
||||||
server front-end is selected. When this option is provided,
|
server front-end is selected. When this option is provided,
|
||||||
@ -1297,7 +1505,7 @@ usleep <usec>
|
|||||||
access NSH.
|
access NSH.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table></center>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
One or both of <code>CONFIG_EXAMPLES_NSH_CONSOLE</code> and <code>CONFIG_EXAMPLES_NSH_TELNET</code>
|
One or both of <code>CONFIG_EXAMPLES_NSH_CONSOLE</code> and <code>CONFIG_EXAMPLES_NSH_TELNET</code>
|
||||||
@ -1310,46 +1518,126 @@ usleep <usec>
|
|||||||
<th align="left" width="25%">Configuration</th>
|
<th align="left" width="25%">Configuration</th>
|
||||||
<th align="left">Description</th>
|
<th align="left">Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
Determines the size of the I/O buffer to use for sending/
|
Determines the size of the I/O buffer to use for sending/
|
||||||
receiving TELNET commands/reponses
|
receiving TELNET commands/reponses
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_DHCPC</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_DHCPC</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
Obtain the the IP address via DHCP.
|
Obtain the the IP address via DHCP.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_IPADDR</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_IPADDR</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
If <code>CONFIG_EXAMPLES_NSH_DHCPC</code> is NOT set, then the static IP
|
If <code>CONFIG_EXAMPLES_NSH_DHCPC</code> is NOT set, then the static IP
|
||||||
address must be provided.
|
address must be provided.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_DRIPADDR</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_DRIPADDR</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
Default router IP address
|
Default router IP address
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_NETMASK</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_NETMASK</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
Network mask
|
Network mask
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br><code>CONFIG_EXAMPLES_NSH_NOMAC</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_NOMAC</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
Set if your ethernet hardware has no built-in MAC address.
|
Set if your ethernet hardware has no built-in MAC address.
|
||||||
If set, a bogus MAC will be assigned.
|
If set, a bogus MAC will be assigned.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</table></center>
|
||||||
|
|
||||||
|
<table width ="100%">
|
||||||
|
<tr bgcolor="#e4e4e4">
|
||||||
|
<td>
|
||||||
|
<a name="index"><h1>Index</h1></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<table width="100%">
|
||||||
|
<tr><td width="50%">
|
||||||
|
<ul>
|
||||||
|
<li><a href="#builtinvars"><code>$?</code></a></li>
|
||||||
|
<li><a href="#cmdtest"><code>[</code></a></li>
|
||||||
|
<li><a href="#cmdoverview">Background commands</a></li>
|
||||||
|
<li><a href="#cmdoverview">Background command priority</a></li>
|
||||||
|
<li><a href="#builtinvars">Built-in variables</a></li>
|
||||||
|
<li><a href="#cmdcat"><code>cat</code></a></li>
|
||||||
|
<li><a href="#cmdcd"><code>cd</code></a></li>
|
||||||
|
<li><a href="#commands">Command summaries</a></li>
|
||||||
|
<li><a href="#conditional">Conditional command execution</a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_CONSOLE</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_DHCPC</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_DISABLEBG</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_DISABLESCRIPT</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_DRIPADDR</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_FILEIOSIZE</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_IPADDR</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_LINELEN</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_NESTDEPTH</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_NETMASK</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_NOMAC</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_STACKSIZE</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_STRERROR</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_TELNET</code></a></li>
|
||||||
|
<li><a href="#configuration">Configuration settings</a></li>
|
||||||
|
<li><a href="#cmddependencies">Configuration settings, command dependencies</a></li>
|
||||||
|
<li><a href="#nshconfiguration">Configuration settings, NSH-specific</a></li>
|
||||||
|
<li><a href="#cmdcp"><code>cp</code></a></li>
|
||||||
|
<li><a href="#currentwd">Current working directory</a></li>
|
||||||
|
<li><a href="#cmdecho"><code>echo</code></a></li>
|
||||||
|
<li><a href="#environvars">Environment Variables</a></li>
|
||||||
|
<li><a href="#cmdexec"><code>exec</code></a></li>
|
||||||
|
<li><a href="#cmdexit"><code>exit</code></a></li>
|
||||||
|
</ul></td>
|
||||||
|
<td></ul>
|
||||||
|
<li><a href="#frontend">Greeting</a></li>
|
||||||
|
<li><a href="#cmdhelp"><code>help</code></a></li>
|
||||||
|
<li><a href="#conditional"><code>if-then[-else]-fi</code></a></li>
|
||||||
|
<li><a href="#cmdifconfig"><code>ifconfig</code></a></li>
|
||||||
|
<li><a href="#cmdls">ls</code></a></li>
|
||||||
|
<li><a href="#cmdmbhw"><code>mb</code></a></li>
|
||||||
|
<li><a href="#cmdmbhw"><code>mh</code></a></li>
|
||||||
|
<li><a href="#cmdmbhw"><code>mw</code></a></li>
|
||||||
|
<li><a href="#cmdmem"><code>mem</code></a></li>
|
||||||
|
<li><a href="#cmdmkdir"><code>mkdir</code></a></li>
|
||||||
|
<li><a href="#cmdmkfatfs"><code>mkfatfs</code></a></li>
|
||||||
|
<li><a href="#cmdmkfifo"><code>mkfifo</code></a></li>
|
||||||
|
<li><a href="#cmdmount"><code>mount</code></a></li>
|
||||||
|
<li><a href="#cmdoverview"><code>nice</code></a></li>
|
||||||
|
<li><a href="#environvars"><code>OLDPWD</code></a></li>
|
||||||
|
<li><a href="#overview">Overview</a></li>
|
||||||
|
<li><a href="#cmdping"><code>ping</code></a></li>
|
||||||
|
<li><a href="#frontend">Prompt</a></li>
|
||||||
|
<li><a href="#cmdps"><code>ps</code></a></li>
|
||||||
|
<li><a href="#cmdpwd"><code>pwd</code></a></li>
|
||||||
|
<li><a href="#environvars"><code>PWD</code></a></li>
|
||||||
|
<li><a href="#cmdoverview">Re-directed commands</a></li>
|
||||||
|
<li><a href="#cmdrm"><code>rm</code></a></li>
|
||||||
|
<li><a href="#cmdrmdir"><code>rmdir</code></a></li>
|
||||||
|
<li><a href="#cmdset"><code>set</code></a></li>
|
||||||
|
<li><a href="#cmdsh"><code>sh</code></a></li>
|
||||||
|
<li><a href="#cmdoverview">Simple commands</a></li>
|
||||||
|
<li><a href="#cmdsleep"><code>sleep</code></a></li>
|
||||||
|
<li><a href="#cmdtest"><code>test</code></a></li>
|
||||||
|
<li><a href="#cmdunmount"><code>umount</code></a></li>
|
||||||
|
<li><a href="#cmdunset"><code>unset</code></a></li>
|
||||||
|
<li><a href="#cmdusleep"><code>usleep</code></a></li>
|
||||||
|
</ul></td>
|
||||||
|
</tr></table>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1075,7 +1075,7 @@ nuttx-0.3.14 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||||||
ping request logic.
|
ping request logic.
|
||||||
* NSH: Add ping command
|
* NSH: Add ping command
|
||||||
* Correct IP checksum calculation in ICMP and UDP message send logic.
|
* Correct IP checksum calculation in ICMP and UDP message send logic.
|
||||||
* NSH: Created a more detailed README file for NSH.
|
* NSH: Created an HTML document and a more detailed README file describing NSH.
|
||||||
|
|
||||||
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
@ -6093,7 +6093,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);
|
|||||||
<b>Description:</b>
|
<b>Description:</b>
|
||||||
<ul>
|
<ul>
|
||||||
<p>
|
<p>
|
||||||
The <code>mkfafs()</code> formats a FAT file system image on the block
|
The <code>mkfats()</code> formats a FAT file system image on the block
|
||||||
device specified by <code>pathname</code>
|
device specified by <code>pathname</code>
|
||||||
</p>
|
</p>
|
||||||
<p>Assumptions: The caller must assure that the block driver is not mounted and not in
|
<p>Assumptions: The caller must assure that the block driver is not mounted and not in
|
||||||
|
@ -256,6 +256,112 @@ o mem
|
|||||||
chunks handed out by malloc.
|
chunks handed out by malloc.
|
||||||
fordblks - This is the total size of memory occupied by
|
fordblks - This is the total size of memory occupied by
|
||||||
free (not in use) chunks.
|
free (not in use) chunks.
|
||||||
|
|
||||||
|
o mkdir <path>
|
||||||
|
|
||||||
|
Create the directory at <path>. All components of of <path>
|
||||||
|
except the final directory name must exist on a mounted file
|
||||||
|
system; the final directory must not.
|
||||||
|
|
||||||
|
Recall that NuttX uses a pseudo filesystem for its root file system.
|
||||||
|
The mkdir command can only be used to create directories in volumes
|
||||||
|
set up with the mount command; it cannot be used to create directories
|
||||||
|
in the pseudo filesystem.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
nsh> mkdir /mnt/fs/tmp
|
||||||
|
nsh> ls -l /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
drw-rw-rw- 0 TESTDIR/
|
||||||
|
drw-rw-rw- 0 TMP/
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
o mkfatfs <path>
|
||||||
|
|
||||||
|
Format a fat file system on the block device specified by path.
|
||||||
|
NSH provides this command to access the mkfatfs() NuttX API.
|
||||||
|
This block device must reside in the NuttX psuedo filesystem and
|
||||||
|
must have been created by some call to register_blockdriver() (see
|
||||||
|
include/nuttx/fs.h).
|
||||||
|
|
||||||
|
o mkfifo <path>
|
||||||
|
|
||||||
|
Creates a FIFO character device anywhere in the pseudo file system,
|
||||||
|
creating whatever psuedo directories that may be needed to complete
|
||||||
|
the full path. By convention, however, device drivers are place in
|
||||||
|
the standard /dev directory. After it is created, the FIFO device
|
||||||
|
may be used as any other device driver. NSH provides this command
|
||||||
|
to access the mkfifo() NuttX API.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
nsh> ls -l /dev
|
||||||
|
/dev:
|
||||||
|
crw-rw-rw- 0 console
|
||||||
|
crw-rw-rw- 0 null
|
||||||
|
brw-rw-rw- 0 ram0
|
||||||
|
nsh> mkfifo /dev/fifo
|
||||||
|
nsh> ls -l /dev
|
||||||
|
ls -l /dev
|
||||||
|
/dev:
|
||||||
|
crw-rw-rw- 0 console
|
||||||
|
crw-rw-rw- 0 fifo
|
||||||
|
crw-rw-rw- 0 null
|
||||||
|
brw-rw-rw- 0 ram0
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
o mount -t <fstype> <block-device> <dir-path>
|
||||||
|
|
||||||
|
The 'mount' command mounts a file system in the NuttX psuedo
|
||||||
|
filesystem. 'mount' performs a three way associating, binding
|
||||||
|
|
||||||
|
File system. The '-t <fstype>' option identifies the type of
|
||||||
|
file system that has been formatted on the <block-device>. As
|
||||||
|
of this writing, vfat is the only supported value for <fstype>
|
||||||
|
|
||||||
|
Block Device. The <block-device> argument is the full or relative
|
||||||
|
path to a block driver inode in the psuedo filesystem. By convention,
|
||||||
|
this is a name under the /dev sub-directory. This <block-device>
|
||||||
|
must have been previously formatted with the same file system
|
||||||
|
type as specified by <fstype>
|
||||||
|
|
||||||
|
Mount Point. The mount point is the location in the psuedo file
|
||||||
|
system where the mounted volume will appear. This mount point
|
||||||
|
can only reside in the NuttX psuedo filesystem. By convention, this
|
||||||
|
mount point is a subdirectory under /mnt. The mount command will
|
||||||
|
create whatever psuedo directories that may be needed to complete
|
||||||
|
the full path but the full path must not already exist.
|
||||||
|
|
||||||
|
After the the volume has been mounted in the NuttX psuedo file
|
||||||
|
system, it may be access in the same way as other objects in the
|
||||||
|
file system.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
nsh> ls -l /dev
|
||||||
|
/dev:
|
||||||
|
crw-rw-rw- 0 console
|
||||||
|
crw-rw-rw- 0 null
|
||||||
|
brw-rw-rw- 0 ram0
|
||||||
|
nsh> ls /mnt
|
||||||
|
nsh: ls: no such directory: /mnt
|
||||||
|
nsh> mount -t vfat /dev/ram0 /mnt/fs
|
||||||
|
nsh> ls -l /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
-rw-rw-rw- 15 TESTFILE.TXT
|
||||||
|
nsh> echo "This is a test" >/mnt/fs/testdir/example.txt
|
||||||
|
nsh> ls -l /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
-rw-rw-rw- 15 TESTFILE.TXT
|
||||||
|
-rw-rw-rw- 16 EXAMPLE.TXT
|
||||||
|
nsh> cat /mnt/fs/testdir/example.txt
|
||||||
|
This is a test
|
||||||
|
nsh>
|
||||||
|
|
||||||
o ps
|
o ps
|
||||||
|
|
||||||
Show the currently active threads and tasks. For example,
|
Show the currently active threads and tasks. For example,
|
||||||
@ -302,6 +408,50 @@ o pwd
|
|||||||
/dev
|
/dev
|
||||||
nsh>
|
nsh>
|
||||||
|
|
||||||
|
o rm <file-path>
|
||||||
|
|
||||||
|
Remove the specified <file-path> name from the mounted file system.
|
||||||
|
Recall that NuttX uses a pseudo filesystem for its root file system.
|
||||||
|
The rm command can only be used to remove (unlink) files in volumes
|
||||||
|
set up with the mount command; it cannot be used to remove names from
|
||||||
|
the pseudo filesystem.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
nsh> ls /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
TESTFILE.TXT
|
||||||
|
EXAMPLE.TXT
|
||||||
|
nsh> rm /mnt/fs/testdir/example.txt
|
||||||
|
nsh> ls /mnt/fs/testdir
|
||||||
|
/mnt/fs/testdir:
|
||||||
|
TESTFILE.TXT
|
||||||
|
nsh>
|
||||||
|
|
||||||
|
o rmdir <dir-path>
|
||||||
|
|
||||||
|
Remove the specified <dir-path> directory from the mounted file system.
|
||||||
|
Recall that NuttX uses a pseudo filesystem for its root file system. The
|
||||||
|
rmdir command can only be used to remove directories from volumes set up
|
||||||
|
with the mount command; it cannot be used to remove directories from the
|
||||||
|
pseudo filesystem.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
nsh> mkdir /mnt/fs/tmp
|
||||||
|
nsh> ls -l /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
drw-rw-rw- 0 TESTDIR/
|
||||||
|
drw-rw-rw- 0 TMP/
|
||||||
|
nsh> rmdir /mnt/fs/tmp
|
||||||
|
nsh> ls -l /mnt/fs
|
||||||
|
ls -l /mnt/fs
|
||||||
|
/mnt/fs:
|
||||||
|
drw-rw-rw- 0 TESTDIR/
|
||||||
|
nsh>
|
||||||
|
|
||||||
o set <name> <value>
|
o set <name> <value>
|
||||||
|
|
||||||
Set the environment variable <name> to the sting <value>.
|
Set the environment variable <name> to the sting <value>.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user