diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-07-18 08:24:29 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-07-18 08:24:29 -0600 |
commit | 54fdd99901b8db5ba275ea9c1f3f56efe24232ad (patch) | |
tree | 92da53e2c07893a7e8f019203d137e45c5c8eac2 | |
parent | 2e8e47d417fb0b1e5b2386548f9c308fd74edec9 (diff) | |
download | px4-nuttx-54fdd99901b8db5ba275ea9c1f3f56efe24232ad.tar.gz px4-nuttx-54fdd99901b8db5ba275ea9c1f3f56efe24232ad.tar.bz2 px4-nuttx-54fdd99901b8db5ba275ea9c1f3f56efe24232ad.zip |
NSH cmp command by Andrew Twidgell
-rw-r--r-- | apps/ChangeLog.txt | 4 | ||||
-rw-r--r-- | apps/nshlib/Kconfig | 4 | ||||
-rw-r--r-- | apps/nshlib/README.txt | 5 | ||||
-rw-r--r-- | apps/nshlib/nsh.h | 7 | ||||
-rw-r--r-- | apps/nshlib/nsh_fscmds.c | 112 | ||||
-rw-r--r-- | apps/nshlib/nsh_parse.c | 3 | ||||
-rw-r--r-- | nuttx/Documentation/NuttShell.html | 199 | ||||
-rw-r--r-- | nuttx/arch/Kconfig | 3 | ||||
-rw-r--r-- | nuttx/arch/arm/include/arm/irq.h | 1 | ||||
-rw-r--r-- | nuttx/arch/arm/src/arm/up_head.S | 2 | ||||
-rw-r--r-- | nuttx/configs/sam3u-ek/README.txt | 3 |
11 files changed, 249 insertions, 94 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 7800c837c..bfc4615a8 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -612,4 +612,6 @@ issues that I am still uncertain how should be handled (2012-7-15). * apps/system/zmodem/Makefile.host and host/: The Zmodem utilities can now be built to execute on a Linux host. - + * apps/nshlib/nsh_fscmds.c: Add a 'cmp' command that can be used to + compare two files for equivalence. Returns an indication if the files + differ. Contributed by Andrew Twidgell (via Lorenz Meier) (2013-7-18). diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index ded9f2e67..5d5677f7e 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -55,6 +55,10 @@ config NSH_DISABLE_CP bool "Disable cp" default n +config NSH_DISABLE_CMP + bool "Disable cmp" + default n + config NSH_DISABLE_DD bool "Disable dd" default n diff --git a/apps/nshlib/README.txt b/apps/nshlib/README.txt index bd2dd75f7..7be3be5df 100644 --- a/apps/nshlib/README.txt +++ b/apps/nshlib/README.txt @@ -261,6 +261,11 @@ o cd [<dir-path>|-|~|..] 'home' directory is '/'. 'cd ..' sets the current working directory to the parent directory. +o cmp <path1> <path2> + + Compare of the contents of the file at <file1> with the contents of + the file at <path2>. Returns an indication only if the files differ. + o cp <source-path> <dest-path> Copy of the contents of the file at <source-path> to the location diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index b842bb70e..957f08bc1 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -126,7 +126,7 @@ # ifndef CONFIG_USBDEV_TRACE # undef CONFIG_NSH_USBDEV_TRACE -# endif +# endif # ifdef CONFIG_NSH_USBDEV_TRACE # ifdef CONFIG_NSH_USBDEV_TRACEINIT @@ -597,7 +597,7 @@ void nsh_usbtrace(void); #ifndef CONFIG_NSH_DISABLE_XD int cmd_xd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); #endif - + #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST) int cmd_test(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); int cmd_lbracket(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); @@ -616,6 +616,9 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_CP int cmd_cp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif +# ifndef CONFIG_NSH_DISABLE_CMP + int cmd_cmp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +# endif # ifndef CONFIG_NSH_DISABLE_DD int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c index 99d6268a5..c2fb55078 100644 --- a/apps/nshlib/nsh_fscmds.c +++ b/apps/nshlib/nsh_fscmds.c @@ -1288,3 +1288,115 @@ int cmd_sh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) } #endif #endif + +/**************************************************************************** + * Name: cmd_cmp + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +#ifndef CONFIG_NSH_DISABLE_CMP +int cmd_cmp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) +{ + FAR char *path1 = NULL; + FAR char *path2 = NULL; + off_t total_read = 0; + int fd1 = -1; + int fd2 = -1; + int ret = ERROR; + + /* Get the full path to the two files */ + + path1 = nsh_getfullpath(vtbl, argv[1]); + if (!path1) + { + nsh_output(vtbl, g_fmtargrequired, argv[0]); + goto errout; + } + + path2 = nsh_getfullpath(vtbl, argv[2]); + if (!path2) + { + nsh_output(vtbl, g_fmtargrequired, argv[0]); + goto errout_with_path1; + } + + /* Open the files for reading */ + + fd1 = open(path1, O_RDONLY); + if (fd1 < 0) + { + nsh_output(vtbl, g_fmtcmdfailed, argv[0], "open", NSH_ERRNO); + goto errout_with_path2; + } + + fd2 = open(path2, O_RDONLY); + if (fd2 < 0) + { + nsh_output(vtbl, g_fmtcmdfailed, argv[0], "open", NSH_ERRNO); + goto errout_with_fd1; + } + + /* The loop until we hit the end of file or find a difference in the two + * files. + */ + + for (;;) + { + char buf1[128]; + char buf2[128]; + + /* Read the file data */ + + ssize_t nbytesread1 = read(fd1, buf1, sizeof(buf1)); + ssize_t nbytesread2 = read(fd2, buf2, sizeof(buf2)); + + if (nbytesread1 < 0) + { + nsh_output(vtbl, g_fmtcmdfailed, argv[0], "read", NSH_ERRNO); + goto errout_with_fd2; + } + + if (nbytesread2 < 0) + { + nsh_output(vtbl, g_fmtcmdfailed, argv[0], "read", NSH_ERRNO); + goto errout_with_fd2; + } + + total_read += nbytesread1 > nbytesread2 ? nbytesread2 : nbytesread1; + + /* Compare the file data */ + + if (nbytesread1 != nbytesread2 || + memcmp(buf1, buf2, nbytesread1) != 0) + { + nsh_output(vtbl, "files differ: byte %u\n", total_read); + goto errout_with_fd2; + } + + /* A partial read indicates the end of file (usually) */ + + if (nbytesread1 < sizeof(buf1)) + { + break; + } + } + + /* The files are the same, i.e., the end of file was encountered + * without finding any differences. + */ + + ret = OK; + +errout_with_fd2: + close(fd2); +errout_with_fd1: + close(fd1); +errout_with_path2: + nsh_freefullpath(path2); +errout_with_path1: + nsh_freefullpath(path1); +errout: + return ret; +} +#endif +#endif diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index 5722023d3..3f17149f5 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -175,6 +175,9 @@ static const struct cmdmap_s g_cmdmap[] = # ifndef CONFIG_NSH_DISABLE_CP { "cp", cmd_cp, 3, 3, "<source-path> <dest-path>" }, # endif +# ifndef CONFIG_NSH_DISABLE_CMP + { "cmp", cmd_cmp, 3, 3, "<path1> <path2>" }, +# endif #endif #if defined (CONFIG_RTC) && !defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_NSH_DISABLE_DATE) diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html index a814813c5..99510817b 100644 --- a/nuttx/Documentation/NuttShell.html +++ b/nuttx/Documentation/NuttShell.html @@ -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: April 30, 2013</p> + <p>Last Updated: July 18, 2013</p> </td> </tr> </table> @@ -113,253 +113,259 @@ <tr> <td><br></td> <td> - <a href="#cmdcp">2.6 Copy Files (cp)</a> + <a href="#cmdcmp">2.6 Compare Files (cmp)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmddate">2.7 Show or set the date and time (date)</a> + <a href="#cmdcp">2.7 Copy Files (cp)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmddd">2.8 Copy and Convert Files (dd)</a> + <a href="#cmddate">2.8 Show or set the date and time (date)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmddf">2.9 Show volume status (df)</a> + <a href="#cmddd">2.9 Copy and Convert Files (dd)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdecho">2.10 Echo Strings and Variables (echo)</a> + <a href="#cmddf">2.10 Show volume status (df)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdexec">2.11 Execute User Code (exec)</a> + <a href="#cmdecho">2.11 Echo Strings and Variables (echo)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdexit">2.12 Exit NSH (exit)</a> + <a href="#cmdexec">2.12 Execute User Code (exec)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdfree">2.13 Show Memory Manager Status (free)</a> + <a href="#cmdexit">2.13 Exit NSH (exit)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdget">2.14 Get File Via TFTP (get)</a> + <a href="#cmdfree">2.14 Show Memory Manager Status (free)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdhelp">2.15 Show Usage Command Usage (help)</a> + <a href="#cmdget">2.15 Get File Via TFTP (get)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdhexdump">2.16 Hexadecimal Dump of File or Device (hexdump)</a> + <a href="#cmdhelp">2.16 Show Usage Command Usage (help)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdifconfig">2.17 Manage Network Configuration (ifconfig)</a> + <a href="#cmdhexdump">2.17 Hexadecimal Dump of File or Device (hexdump)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdifdown">2.18 Take a network down (ifdown)</a> + <a href="#cmdifconfig">2.18 Manage Network Configuration (ifconfig)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdifup">2.19 Bring a network up (ifup)</a> + <a href="#cmdifdown">2.19 Take a network down (ifdown)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdkill">2.20 Send a signal to a task (kill)</a> + <a href="#cmdifup">2.20 Bring a network up (ifup)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdlosetup">2.21 Setup/teardown the Loop Device (losetup)</a> + <a href="#cmdkill">2.21 Send a signal to a task (kill)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdls">2.22 List Directory Contents (ls)</a> + <a href="#cmdlosetup">2.22 Setup/teardown the Loop Device (losetup)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmd5">2.23 Calculate MD5 (md5)</a> + <a href="#cmdls">2.23 List Directory Contents (ls)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmbhw">2.24 Access Memory (mb, mh, and mw)</a> + <a href="#cmdmd5">2.24 Calculate MD5 (md5)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdps">2.25 Show Current Tasks and Threads (ps)</a> + <a href="#cmdmbhw">2.25 Access Memory (mb, mh, and mw)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkdir">2.26 Create a Directory (mkdir)</a> + <a href="#cmdps">2.26 Show Current Tasks and Threads (ps)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkfatfs">2.27 Create a FAT Filesystem (mkfatfs)</a> + <a href="#cmdmkdir">2.27 Create a Directory (mkdir)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkfifo">2.28 Create a FIFO (mkfifo)</a> + <a href="#cmdmkfatfs">2.28 Create a FAT Filesystem (mkfatfs)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkrd">2.29 Create a RAMDISK (mkrd)</a> + <a href="#cmdmkfifo">2.29 Create a FIFO (mkfifo)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmount">2.30 Mount a File System (mount)</a> + <a href="#cmdmkrd">2.30 Create a RAMDISK (mkrd)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmv">2.31 Rename a File (mv)</a> + <a href="#cmdmount">2.31 Mount a File System (mount)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdnfsmount">2.32 Mount an NFS file system (nfsmount)</a> + <a href="#cmdmv">2.32 Rename a File (mv)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdping">2.33 Check Network Peer (ping)</a> + <a href="#cmdnfsmount">2.33 Mount an NFS file system (nfsmount)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdput">2.34 Send File Via TFTP (put)</a> + <a href="#cmdping">2.34 Check Network Peer (ping)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdpwd">2.35 Show Current Working Directory (pwd)</a> + <a href="#cmdput">2.35 Send File Via TFTP (put)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdrm">2.36 Remove a File (rm)</a> + <a href="#cmdpwd">2.36 Show Current Working Directory (pwd)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdrmdir">2.37 Remove a Directory (rmdir)</a> + <a href="#cmdrm">2.37 Remove a File (rm)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdset">2.38 Set an Environment Variable (set)</a> + <a href="#cmdrmdir">2.38 Remove a Directory (rmdir)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdsh">2.39 Execute an NSH Script (sh)</a> + <a href="#cmdset">2.39 Set an Environment Variable (set)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdsleep">2.40 Wait for Seconds (sleep)</a> + <a href="#cmdsh">2.40 Execute an NSH Script (sh)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdunmount">2.41 Unmount a File System (umount)</a> + <a href="#cmdsleep">2.41 Wait for Seconds (sleep)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdunset">2.42 Unset an Environment Variable (unset)</a> + <a href="#cmdunmount">2.42 Unmount a File System (umount)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdurldec">2.43 URL Decode (urldecode)</a> + <a href="#cmdunset">2.43 Unset an Environment Variable (unset)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdurlencode">2.44 URL Encode (urlencode)</a> + <a href="#cmdurldec">2.44 URL Decode (urldecode)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdusleep">2.45 Wait for Microseconds (usleep)</a> + <a href="#cmdurlencode">2.45 URL Encode (urlencode)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdwget">2.46 Get File Via HTTP (wget)</a> + <a href="#cmdusleep">2.46 Wait for Microseconds (usleep)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdxd">2.47 Hexadecimal Dump of Memory (xd)</a> + <a href="#cmdwget">2.47 Get File Via HTTP (wget)</a> + </td> +</tr> +<tr> + <td><br></td> + <td> + <a href="#cmdxd">2.48 Hexadecimal Dump of Memory (xd)</a> </td> </tr> <tr> @@ -892,7 +898,24 @@ cd [<dir-path>|-|~|..] <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdcp"><h2>2.6 Copy Files (cp)</h2></a> + <a name="cmdcmp"><h2>2.6 Compare Files (cmp)</h2></a> + </td> + </tr> +</table> + +<p><b>Command Syntax:</b></p> +<ul><pre> +cmp <path1> <path2> +</pre></ul> +<p> + <b>Synopsis</b>. + Compare of the contents of the file at <code><path1></code> with the contents of the file at <code><path2></code>. Returns an indication only if the files differ. +</p> + +<table width ="100%"> + <tr bgcolor="#e4e4e4"> + <td> + <a name="cmdcp"><h2>2.7 Copy Files (cp)</h2></a> </td> </tr> </table> @@ -910,7 +933,7 @@ cp <source-path> <dest-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmddate"><h2>2.7 Show or set the date and time (date)</h2></a> + <a name="cmddate"><h2>2.8 Show or set the date and time (date)</h2></a> </td> </tr> </table> @@ -937,7 +960,7 @@ data -s "Sep 1 11:30:00 2011" <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmddd"><h2>2.8 Copy and Convert Files (dd)</h2></a> + <a name="cmddd"><h2>2.9 Copy and Convert Files (dd)</h2></a> </td> </tr> </table> @@ -995,7 +1018,7 @@ nsh> dd if=/dev/ram0 of=/dev/null <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmddf"><h2>2.9 Show Volument Status (df)</h2></a> + <a name="cmddf"><h2>2.10 Show Volument Status (df)</h2></a> </td> </tr> </table> @@ -1026,7 +1049,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdecho"><h2>2.10 Echo Strings and Variables (echo)</h2></a> + <a name="cmdecho"><h2>2.11 Echo Strings and Variables (echo)</h2></a> </td> </tr> </table> @@ -1044,7 +1067,7 @@ echo [<string|$name> [<string|$name>...]] <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdexec"><h2>2.11 Execute User Code (exec)</h2></a> + <a name="cmdexec"><h2>2.12 Execute User Code (exec)</h2></a> </td> </tr> </table> @@ -1063,7 +1086,7 @@ exec <hex-address> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdexit"><h2>2.12 Exit NSH (exit)</h2></a> + <a name="cmdexit"><h2>2.13 Exit NSH (exit)</h2></a> </td> </tr> </table> @@ -1082,7 +1105,7 @@ exit <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdfree"><h2>2.13 Show Memory Manager Status (free)</h2></a> + <a name="cmdfree"><h2>2.14 Show Memory Manager Status (free)</h2></a> </td> </tr> </table> @@ -1124,7 +1147,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdget"><h2>2.14 Get File Via TFTP (get)</h2></a> + <a name="cmdget"><h2>2.15 Get File Via TFTP (get)</h2></a> </td> </tr> </table> @@ -1159,7 +1182,7 @@ get [-b|-n] [-f <local-path>] -h <ip-address> <remote-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdhelp"><h2>2.15 Show Usage Command Usage (help)</h2></a> + <a name="cmdhelp"><h2>2.16 Show Usage Command Usage (help)</h2></a> </td> </tr> </table> @@ -1191,7 +1214,7 @@ help [-v] [<cmd>] <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdhexdump"><h2>2.16 Hexadecimal Dump of File or Device (hexdump)</h2></a> + <a name="cmdhexdump"><h2>2.17 Hexadecimal Dump of File or Device (hexdump)</h2></a> </td> </tr> </table> @@ -1215,7 +1238,7 @@ hexdump <file or device> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdifconfig"><h2>2.17 Manage Network Configuration (ifconfig)</h2></a> + <a name="cmdifconfig"><h2>2.18 Manage Network Configuration (ifconfig)</h2></a> </td> </tr> </table> @@ -1269,7 +1292,7 @@ ifconfig nic_name ip_address <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdifdown"><h2>2.18 Take a network down (ifdown)</h2></a> + <a name="cmdifdown"><h2>2.19 Take a network down (ifdown)</h2></a> </td> </tr> </table> @@ -1292,7 +1315,7 @@ ifdown eth0 <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdifup"><h2>2.19 Bring a network up (ifup)</h2></a> + <a name="cmdifup"><h2>2.20 Bring a network up (ifup)</h2></a> </td> </tr> </table> @@ -1315,7 +1338,7 @@ ifup eth0 <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdkill"><h2>2.20 Send a signal to a task (kill)</h2></a> + <a name="cmdkill"><h2>2.21 Send a signal to a task (kill)</h2></a> </td> </tr> </table> @@ -1356,7 +1379,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdlosetup"><h2>2.21 Setup/teardown the Loop Device (losetup)</h2></a> + <a name="cmdlosetup"><h2>2.22 Setup/teardown the Loop Device (losetup)</h2></a> </td> </tr> </table> @@ -1409,7 +1432,7 @@ losetup d <dev-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdls"><h2>2.22 List Directory Contents (ls)</h2></a> + <a name="cmdls"><h2>2.23 List Directory Contents (ls)</h2></a> </td> </tr> </table> @@ -1446,7 +1469,7 @@ ls [-lRs] <dir-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmd5"><h2>2.23 Calculate MD5 (md5)</h2></a> + <a name="cmdmd5"><h2>2.24 Calculate MD5 (md5)</h2></a> </td> </tr> </table> @@ -1463,7 +1486,7 @@ md5 [-f] <string or filepath> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmbhw"><h2>2.24 Access Memory (mb, mh, and mw)</h2></a> + <a name="cmdmbhw"><h2>2.25 Access Memory (mb, mh, and mw)</h2></a> </td> </tr> </table> @@ -1517,7 +1540,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdps"><h2>2.25 Show Current Tasks and Threads (ps)</h2></a> + <a name="cmdps"><h2>2.26 Show Current Tasks and Threads (ps)</h2></a> </td> </tr> </table> @@ -1543,7 +1566,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkdir"><h2>2.26 Create a Directory (mkdir)</h2></a> + <a name="cmdmkdir"><h2>2.27 Create a Directory (mkdir)</h2></a> </td> </tr> </table> @@ -1578,7 +1601,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkfatfs"><h2>2.27 Create a FAT Filesystem (mkfatfs)</h2></a> + <a name="cmdmkfatfs"><h2>2.28 Create a FAT Filesystem (mkfatfs)</h2></a> </td> </tr> </table> @@ -1598,7 +1621,7 @@ mkfatfs <path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkfifo"><h2>2.28 Create a FIFO (mkfifo)</h2></a> + <a name="cmdmkfifo"><h2>2.29 Create a FIFO (mkfifo)</h2></a> </td> </tr> </table> @@ -1636,7 +1659,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkrd"><h2>2.29 Create a RAMDISK (mkrd)</h2></a> + <a name="cmdmkrd"><h2>2.30 Create a RAMDISK (mkrd)</h2></a> </td> </tr> </table> @@ -1687,7 +1710,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmount"><h2>2.30 Mount a File System (mount)</h2></a> + <a name="cmdmount"><h2>2.31 Mount a File System (mount)</h2></a> </td> </tr> </table> @@ -1766,7 +1789,7 @@ nsh> mount <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmv"><h2>2.31 Rename a File (mv)</h2></a> + <a name="cmdmv"><h2>2.32 Rename a File (mv)</h2></a> </td> </tr> </table> @@ -1784,7 +1807,7 @@ mv <old-path> <new-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdnfsmount"><h2>2.32 Mount an NFS file system (nfsmount)</h2></a> + <a name="cmdnfsmount"><h2>2.33 Mount an NFS file system (nfsmount)</h2></a> </td> </tr> </table> @@ -1803,7 +1826,7 @@ nfsmount <server-address> <mount-point> <remote-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdping"><h2>2.33 Check Network Peer (ping)</h2></a> + <a name="cmdping"><h2>2.34 Check Network Peer (ping)</h2></a> </td> </tr> </table> @@ -1836,7 +1859,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdput"><h2>2.34 Send File Via TFTP (put)</h2></a> + <a name="cmdput"><h2>2.35 Send File Via TFTP (put)</h2></a> </td> </tr> </table> @@ -1871,7 +1894,7 @@ put [-b|-n] [-f <remote-path>] -h <ip-address> <local-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdpwd"><h2>2.35 Show Current Working Directory (pwd)</h2></a> + <a name="cmdpwd"><h2>2.36 Show Current Working Directory (pwd)</h2></a> </td> </tr> </table> @@ -1901,7 +1924,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdrm"><h2>2.36 Remove a File (rm)</h2></a> + <a name="cmdrm"><h2>2.37 Remove a File (rm)</h2></a> </td> </tr> </table> @@ -1935,7 +1958,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdrmdir"><h2>2.37 Remove a Directory (rmdir)</h2></a> + <a name="cmdrmdir"><h2>2.38 Remove a Directory (rmdir)</h2></a> </td> </tr> </table> @@ -1970,7 +1993,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdset"><h2>2.38 Set an Environment Variable (set)</h2></a> + <a name="cmdset"><h2>2.39 Set an Environment Variable (set)</h2></a> </td> </tr> </table> @@ -1996,7 +2019,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdsh"><h2>2.39 Execute an NSH Script (sh)</h2></a> + <a name="cmdsh"><h2>2.40 Execute an NSH Script (sh)</h2></a> </td> </tr> </table> @@ -2014,7 +2037,7 @@ sh <script-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdsleep"><h2>2.40 Wait for Seconds (sleep)</h2></a> + <a name="cmdsleep"><h2>2.41 Wait for Seconds (sleep)</h2></a> </td> </tr> </table> @@ -2031,7 +2054,7 @@ sleep <sec> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdunmount"><h2>2.41 Unmount a File System (umount)</h2></a> + <a name="cmdunmount"><h2>2.42 Unmount a File System (umount)</h2></a> </td> </tr> </table> @@ -2061,7 +2084,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdunset"><h2>2.42 Unset an Environment Variable (unset)</h2></a> + <a name="cmdunset"><h2>2.43 Unset an Environment Variable (unset)</h2></a> </td> </tr> </table> @@ -2087,7 +2110,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdurldec"><h2>2.43 URL Decode (urldecode)</h2></a> + <a name="cmdurldec"><h2>2.44 URL Decode (urldecode)</h2></a> </td> </tr> </table> @@ -2104,7 +2127,7 @@ urldecode [-f] <string or filepath> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdurlencode"><h2>2.44 URL Encode (urlencode)</h2></a> + <a name="cmdurlencode"><h2>2.45 URL Encode (urlencode)</h2></a> </td> </tr> </table> @@ -2121,7 +2144,7 @@ urlencode [-f] <string or filepath> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdusleep"><h2>2.45 Wait for Microseconds (usleep)</h2></a> + <a name="cmdusleep"><h2>2.46 Wait for Microseconds (usleep)</h2></a> </td> </tr> </table> @@ -2138,7 +2161,7 @@ usleep <usec> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdwget">2.46 Get File Via HTTP (wget)</a> + <a name="cmdwget">2.47 Get File Via HTTP (wget)</a> </td> </tr> </table> @@ -2165,7 +2188,7 @@ wget [-o <local-path>] <url> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdxd"><h2>2.47 Hexadecimal Dump of Memory (xd)</h2></a> + <a name="cmdxd"><h2>2.48 Hexadecimal Dump of Memory (xd)</h2></a> </td> </tr> </table> @@ -2254,6 +2277,11 @@ nsh> <td><code>CONFIG_NSH_DISABLE_CD</code></td> </tr> <tr> + <td><b><code>cmp</code></b></td> + <td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td> + <td><code>CONFIG_NSH_DISABLE_CMP</code></td> + </tr> + <tr> <td><b><code>cp</code></b></td> <td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td> <td><code>CONFIG_NSH_DISABLE_CP</code></td> @@ -3766,6 +3794,7 @@ mount -t vfat /dev/ram1 /tmp <li><a href="#cmdbase64enc"><code>base64enc</code></a></li> <li><a href="#cmdcat"><code>cat</code></a></li> <li><a href="#cmdcd"><code>cd</code></a></li> + <li><a href="#cmdcmp"><code>cmp</code></a></li> <li><a href="#commands">Command summaries</a></li> <li><a href="#custoncmds">Command table</a></li> <li><a href="#conditional">Conditional command execution</a></li> diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index 01e3809ce..0a65a3de8 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -174,8 +174,7 @@ config ARCH_EXTDRAMSIZE choice prompt "SDRAM Width Selection" - default ARCH_CHIP_STM32F103ZET6 - depends on ARCH_CHIP_STM32 + default ARCH_SDRAM_16BIT config ARCH_SDRAM_8BIT bool "8-bit" diff --git a/nuttx/arch/arm/include/arm/irq.h b/nuttx/arch/arm/include/arm/irq.h index a06abe888..fdfdd38db 100644 --- a/nuttx/arch/arm/include/arm/irq.h +++ b/nuttx/arch/arm/include/arm/irq.h @@ -228,4 +228,3 @@ extern "C" { #endif #endif /* __ARCH_ARM_INCLUDE_ARM_IRQ_H */ - diff --git a/nuttx/arch/arm/src/arm/up_head.S b/nuttx/arch/arm/src/arm/up_head.S index ef911d0b6..4778a1abd 100644 --- a/nuttx/arch/arm/src/arm/up_head.S +++ b/nuttx/arch/arm/src/arm/up_head.S @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/arm/up_pghead.S + * arch/arm/src/arm/up_head.S * * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/sam3u-ek/README.txt b/nuttx/configs/sam3u-ek/README.txt index 065c01d89..929331443 100644 --- a/nuttx/configs/sam3u-ek/README.txt +++ b/nuttx/configs/sam3u-ek/README.txt @@ -743,5 +743,4 @@ Configurations ostest: This configuration directory, performs a simple OS test using - examples/ostest. By default, this project assumes that you are - using the DFU bootloader. + examples/ostest. |