diff --git a/ChangeLog b/ChangeLog index 84cf98a9b5..8db3fa7503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -448,5 +448,5 @@ ping request logic. * NSH: Add ping command * 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. diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index 6989688fc4..b79f535590 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -254,6 +254,11 @@ 3.2 NSH-Specific Configuration Settings +
cd
and pwd
.
All path arguments to commands may be either an absolute path or a
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 cd
command and can be queried either
by using the pwd
command or by
using the echo
$PWD
command.
@@ -849,6 +854,33 @@ nsh>
+Command Syntax:
++mkdir <path> ++
+ Synopsis.
+ 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.
+
+ Limited to Mounted File Systems.
+ 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> ++
@@ -857,6 +889,18 @@ nsh> |
Command Syntax:
++mkfatfs <path> ++
+ Synopsis.
+ 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 pseudo filesystem and
+ must have been created by some call to register_blockdriver()
(see include/nuttx/fs.h
).
+
@@ -865,6 +909,36 @@ nsh> |
Command Syntax:
++mkfifo <path> ++
+ Synopsis.
+ Creates a FIFO character device anywhere in the pseudo file system, creating
+ whatever psuedo directories that may be needed to complete the <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> ++
@@ -873,6 +947,65 @@ nsh> |
Command Syntax:
+
+mount -t <fstype> <block-device> <dir-path>
+
++ Synopsis. + The 'm ount' command mounts a file system in the NuttX psuedo + filesystem. 'mount' performs a three way associating, binding: +
+<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>
argument is the full or relative
+ path to a block driver inode in the pseudo 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>
+ <dir-path>
, is the location in the
+ pseudo filesystem where the mounted volume will appear.
+ This mount point can only reside in the NuttX pseudo 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 + pseudo filesystem, + it may be access in the same way as other objects in thefile 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> ++
@@ -944,6 +1077,32 @@ nsh> |
+rm <file-path> ++
+ Synopsis.
+ 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 in 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> ++
@@ -952,6 +1111,33 @@ nsh> |
+rmdir <dir-path> ++
+ Synopsis.
+ 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 +/mnt/fs: + drw-rw-rw- 0 TESTDIR/ +nsh> ++
@@ -1021,6 +1207,28 @@ sleep <sec> |
+umount <dir-path> ++
+ Synopsis.
+ Un-mount the file system at mount point <dir-path>
.
+ The umount
command can only be used to un-mount volumes previously mounted using
+ mount
command.
+
Example:
++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> ++
@@ -1228,28 +1436,28 @@ usleep <usec> | Description | |
---|---|---|
CONFIG_EXAMPLES_NSH_FILEIOSIZE |
+ CONFIG_EXAMPLES_NSH_FILEIOSIZE |
Size of a static I/O buffer used for file access (ignored if there is no filesystem). |
CONFIG_EXAMPLES_NSH_STRERROR |
+ CONFIG_EXAMPLES_NSH_STRERROR |
strerror(errno) makes more readable output but strerror() is very large and will not be used unless this setting is y |
CONFIG_EXAMPLES_NSH_LINELEN |
+ CONFIG_EXAMPLES_NSH_LINELEN |
The maximum length of one command line and of one output line. Default: 80 |
CONFIG_EXAMPLES_NSH_STACKSIZE |
+ CONFIG_EXAMPLES_NSH_STACKSIZE |
The stack size to use when spawning new threads or tasks. Such new threads are generated when a command is executed in background @@ -1257,14 +1465,14 @@ usleep <usec> |
CONFIG_EXAMPLES_NSH_NESTDEPTH |
+ CONFIG_EXAMPLES_NSH_NESTDEPTH |
The maximum number of nested if-then[-else]-fi sequences that
are permissable. Default: 3
|
CONFIG_EXAMPLES_NSH_DISABLESCRIPT |
+ CONFIG_EXAMPLES_NSH_DISABLESCRIPT |
This can be set to y to suppress support for scripting. This
setting disables the sh , test , and [ commands and the
@@ -1273,7 +1481,7 @@ usleep <usec>
|
CONFIG_EXAMPLES_NSH_DISABLEBG |
+ CONFIG_EXAMPLES_NSH_DISABLEBG |
This can be set to y to suppress support for background
commands. This setting disables the nice command prefix and
@@ -1282,14 +1490,14 @@ usleep <usec>
|
CONFIG_EXAMPLES_NSH_CONSOLE |
+ CONFIG_EXAMPLES_NSH_CONSOLE |
If CONFIG_EXAMPLES_NSH_CONSOLE is set to y, then a serial
console front-end is selected.
|
CONFIG_EXAMPLES_NSH_TELNET |
+ CONFIG_EXAMPLES_NSH_TELNET |
If CONFIG_EXAMPLES_NSH_TELNET is set to y, then a TELENET
server front-end is selected. When this option is provided,
@@ -1297,7 +1505,7 @@ usleep <usec>
access NSH.
|
One or both of CONFIG_EXAMPLES_NSH_CONSOLE
and CONFIG_EXAMPLES_NSH_TELNET
@@ -1310,46 +1518,126 @@ usleep <usec>
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE
CONFIG_EXAMPLES_NSH_DHCPC
CONFIG_EXAMPLES_NSH_DHCPC
CONFIG_EXAMPLES_NSH_IPADDR
CONFIG_EXAMPLES_NSH_IPADDR
CONFIG_EXAMPLES_NSH_DHCPC
is NOT set, then the static IP
address must be provided.
CONFIG_EXAMPLES_NSH_DRIPADDR
CONFIG_EXAMPLES_NSH_DRIPADDR
CONFIG_EXAMPLES_NSH_NETMASK
CONFIG_EXAMPLES_NSH_NETMASK
CONFIG_EXAMPLES_NSH_NOMAC
CONFIG_EXAMPLES_NSH_NOMAC
+ Index+ |
+