Newer
Older
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdkill"><h2>2.13 Send a signal to a task (kill)</h2></a>
</td>
</tr>
</table>
<ul><pre>
kill -<signal> <pid>
</pre></ul>
<p>
<b>Synopsis</b>.
Send the <signal> to the task identified by <pid>.
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
<ul><pre>
nsh> mkfifo /dev/fifo
nsh> cat /dev/fifo &
cat [2:128]
nsh> ps
PID PRI SCHD TYPE NP STATE NAME
0 0 FIFO TASK READY Idle Task()
1 128 FIFO TASK RUNNING init()
2 128 FIFO PTHREAD WAITSEM <pthread>(51ea50)
nsh> kill -9 2
nsh: cat: open failed: 4
nsh> ps
PID PRI SCHD TYPE NP STATE NAME
0 0 FIFO TASK READY Idle Task()
1 128 FIFO TASK RUNNING init()
nsh>
</pre></ul>
<p><small>
<b>NOTE</b>:
NuttX does not support a FULL POSIX signalling system.
Standard signals like SIGCHLD, SIGINTR, SIGKILL, etc. do not exist in NuttX and sending those signal may not have the result that you expect.
Rather, NuttX supports only what are referred to as POSIX real-time signals.
These signals may be used to communicate with running tasks, may be use to waiting waiting tasks, etc.
But, as an example, <code>kill -9</code> (SIGKILL) will not terminate a task.
</p></small>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdlosetup"><h2>2.14 Setup/teardown the Loop Device (losetup)</h2></a>
<ul><pre>
losetup [-o <offset>] [-r] <dev-path> <file-path>
</pre></ul>
<p>
<b>Synopsis</b>.
Setup the loop device at <dev-path> to access the file at <file-path> as a block device.
In the following example a 256Kb file is created (<code>dd</code>) and <code>losetup</code> is
used to make the file accessible as a block device.
A FAT file system is created (<code>mkfatfs</code>) and mounted (<code>mount</code>).
Files can then be managed on the loop-mounted file.
<ul><pre>
nsh> dd if=/dev/zero of=/tmp/image bs=512 count=512
nsh> ls -l /tmp
/tmp:
-rw-rw-rw- 262144 IMAGE
nsh> losetup /dev/loop0 /tmp/image
nsh> ls -l /dev
/dev:
brw-rw-rw- 0 loop0
nsh> mkfatfs /dev/loop0
nsh> mount -t vfat /dev/loop0 /mnt/example
nsh> ls -l /mnt
ls -l /mnt
/mnt:
drw-rw-rw- 0 example/
nsh> echo "This is a test" >/mnt/example/atest.txt
nsh> ls -l /mnt/example
/mnt/example:
-rw-rw-rw- 16 ATEST.TXT
nsh> cat /mnt/example/atest.txt
This is a test
nsh>
<ul><pre>
losetup d <dev-path>
</pre></ul>
<p>
<b>Synopsis</b>.
Teardown the setup for the loop device at <dev-path>.
</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdls"><h2>2.15 List Directory Contents (ls)</h2></a>
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
<ul><pre>
ls [-lRs] <dir-path>
</pre></ul>
<p>
<b>Synopsis</b>.
Show the contents of the directory at <code><dir-path></code>. NOTE:
<code><dir-path></code> must refer to a directory and no other filesystem
object.
</p>
<p><b>Options:</b></p>
<ul><table>
<tr>
<td><b><code>-R</code></b></td>
<td>Show the constents of specified directory and all of its
sub-directories.</td>
</tr>
<tr>
<td><b><code>-s</code></b></td>
<td>Show the size of the files along with the filenames in the
listing</td>
</tr>
<tr>
<td><b><code>-l</code></b></td>
<td>Show size and mode information along with the filenames
in the listing.</td>
</tr>
</table></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdmbhw"><h2>2.16 Access Memory (mb, mh, and mw)</h2></a>
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
</td>
</tr>
</table>
<p><b>Command Syntax:</b></p>
<ul><pre>
mb <hex-address>[=<hex-value>][ <hex-byte-count>]
mh <hex-address>[=<hex-value>][ <hex-byte-count>]
mw <hex-address>[=<hex-value>][ <hex-byte-count>]
</pre></ul>
<p>
<b>Synopsis</b>.
Access memory using byte size access (mb), 16-bit accesses (mh),
or 32-bit access (mw). In each case,
</p>
<ul><table>
<tr>
<td><code><hex-address></code>.</td>
<td>Specifies the address to be accessed. The current
value at that address will always be read and displayed.
</tr>
<tr>
<td><code><hex-address>=<hex-value></code>.</td>
<td>Read the value, then write <code><hex-value></code>
to the location.
</tr>
<tr>
<td><code><hex-byte-count></code>.</td>
<td>Perform the mb, mh, or mw operation on a total
of <code><hex-byte-count></code> bytes, increment the <code><hex-address></code> appropriately
after each access
</tr>
</table></ul>
<p><b>Example:</b><p>
<ul><pre>
nsh> mh 0 16
0 = 0x0c1e
2 = 0x0100
4 = 0x0c1e
6 = 0x0110
8 = 0x0c1e
a = 0x0120
c = 0x0c1e
e = 0x0130
10 = 0x0c1e
12 = 0x0140
14 = 0x0c1e
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdps"><h2>2.17 Show Current Tasks and Threads (ps)</h2></a>
<ul><pre>
ps
</pre></ul>
<p>
<b>Synopsis</b>.
Show the currently active threads and tasks. For example,
</p>
<ul><pre>
nsh> ps
PID PRI SCHD TYPE NP STATE NAME
0 0 FIFO TASK READY Idle Task()
1 128 RR TASK RUNNING init()
2 128 FIFO TASK WAITSEM nsh_telnetmain()
3 100 RR PTHREAD WAITSEM <pthread>(21)
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdmkdir"><h2>2.18 Create a Directory (mkdir)</h2></a>
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdmkfatfs"><h2>2.19 Create a FAT Filesystem (mkfatfs)</h2></a>
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdmkfifo"><h2>2.20 Create a FIFO (mkfifo)</h2></a>
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdmkrd"><h2>2.21 Create a RAMDISK (mkrd)</h2></a>
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
</td>
</tr>
</table>
<p><b>Command Syntax:</b></p>
<ul><pre>
mkrd [-m <minor>] [-s <sector-size>] <nsectors>
</pre></ul>
<p>
<b>Synopsis</b>.
Create a ramdisk consisting of <code><nsectors></code>, each of size
<code><sector-size></code> (or 512 bytes if <code><sector-size></code> is not specified.
The ramdisk will be registered as <code>/dev/ram<n></code> (if <code><n></code> is not
specified, mkrd will attempt to register the ramdisk as <code>/dev/ram0</code>.
</p>
<p><b>Example</b></p>
<ul><pre>
nsh> ls /dev
/dev:
console
null
ttyS0
ttyS1
nsh> mkrd 1024
nsh> ls /dev
/dev:
console
null
ram0
ttyS0
ttyS1
nsh>
</pre></ul>
<p>
Once the ramdisk has been created, it may be formatted using
the <code>mkfatfs</code> command and mounted using the <code>mount</code> command.
</p>
<p><b>Example</b></p>
<ul><pre>
nsh> mkrd 1024
nsh> mkfatfs /dev/ram0
nsh> mount -t vfat /dev/ram0 /tmp
nsh> ls /tmp
/tmp:
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdmount"><h2>2.22 Mount a File System (mount)</h2></a>
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
<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 volume has been mounted in the NuttX
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdping"><h2>2.23 Check Network Peer (ping)</h2></a>
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
<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> 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="cmdput"><h2>2.24 Send File Via TFTP (put)</h2></a>
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
<ul><pre>
put [-b|-n] [-f <remote-path>] -h <ip-address> <local-path>
</pre></ul>
<p>
<b>Synopsis</b>.
Copy the file at <code><local-address></code> to the host whose IP address is
identified by <code><ip-address></code>.
</p>
<p><b>Other options:</b></p>
<ul><table>
<tr>
<td><b><code>-f <remote-path></code></b></td>
<td>
The file will be saved relative with the same name on the host
unless <code><remote-path></code> is provided.
</td>
</tr>
<tr>
<td><b><code>-b|-n</code></b></td>
<td>
Selects either binary ("octect") or test ("netascii") transfer
mode. Default: text.
</td>
</tr>
</table></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdpwd"><h2>2.25 Show Current Working Directory (pwd)</h2></a>
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
<ul><pre>
pwd
</pre></ul>
<p>
<b>Synopsis</b>.
Show the current working directory.
</p>
<ul><pre>
nsh> cd /dev
nsh> pwd
/dev
nsh>
</pre></ul>
<p>Same as <code><a href="#cmdecho">echo</a> <a href="#environvars">$PWD</a></code>.</p>
<ul><pre>
nsh> echo $PWD
/dev
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdrmdir"><h2>2.27 Remove a Directory (rmdir)</h2></a>
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdset"><h2>2.28 Set an Environment Variable (set)</h2></a>
<ul><pre>
set <name> <value>
</pre></ul>
<p>
<b>Synopsis</b>.
Set the environment variable <code><name></code> to the string <code><value></code>.
For example,
</p>
<ul><pre>
nsh> echo $foobar
nsh> set foobar foovalue
nsh> echo $foobar
foovalue
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdsh"><h2>2.29 Execute an NSH Script (sh)</h2></a>
<ul><pre>
sh <script-path>
</pre></ul>
<p>
<b>Synopsis</b>.
Execute the sequence of NSH commands in the file referred
to by <code><script-path>.
</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdsleep"><h2>2.30 Wait for Seconds (sleep)</h2></a>
<ul><pre>
sleep <sec>
</pre></ul>
<p>
<b>Synopsis</b>.
Pause execution (sleep) for <code><sec></code> seconds.
</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdunmount"><h2>2.31 Unmount a File System (umount)</h2></a>
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
<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%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdunset"><h2>2.32 Unset an Environment Variable (unset)</h2></a>
<ul><pre>
unset <name>
</pre></ul>
<p>
<b>Synopsis</b>.
Remove the value associated with the environment variable
<code><name>. Example:
</p>
<ul><pre>
nsh> echo $foobar
foovalue
nsh> unset foobar
nsh> echo $foobar
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdusleep"><h2>2.33 Wait for Microseconds (usleep)</h2></a>
<ul><pre>
usleep <usec>
</pre></ul>
<p>
<b>Synopsis</b>.
Pause execution (sleep) of <code><usec></code> microseconds.
</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
<ul><pre>
wget [-o <local-path>] <url>
</pre></ul>
<p>
<b>Synopsis</b>.
Use HTTP to copy the file at <code><url></code> to the current directory.
</p>
<p><b>Options:</b></p>
<ul><table>
<tr>
<td><b><code>-o <local-path></code></b></td>
<td>
The file will be saved relative to the current working directory
and with the same name as on the HTTP server unless <code><local-path></code> is provided.
</td>
</tr>
</table></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmdxd"><h2>2.35 Hexadecimal dump (xd)</h2></a>
<ul><pre>
xd <hex-address> <byte-count>
</pre></ul>
<p>
<b>Synopsis</b>.
Dump <code><byte-count></code> bytes of data from address <code><hex-address></code>.
</p>
<p><b>Example:</b></p>
<ul><pre>
nsh> xd 410e0 512
Hex dump:
0000: 00 00 00 00 9c 9d 03 00 00 00 00 01 11 01 10 06 ................
0010: 12 01 11 01 25 08 13 0b 03 08 1b 08 00 00 02 24 ....%..........$
...
01f0: 08 3a 0b 3b 0b 49 13 00 00 04 13 01 01 13 03 08 .:.;.I..........
nsh>
</pre></ul>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="configuration"><h1>3.0 Configuration Settings</h1></a>
</td>
</tr>
</table>
<p>
The availability of the above commands depends upon features that
may or may not be enabled in the NuttX configuration file. The
following <a href="#cmddependencies">table</a> indicates the dependency of each command on NuttX
configuration settings. General configuration settings are discussed
in the <a href="NuttxPortingGuide.html">NuttX Porting Guide.</a>
Configuration settings specific to NSH as discussed at the <a href="#nshconfiguration">bottom</a> of this document.
</p>
<p>
Note that in addition to general NuttX configuation settings, each NSH command can be
individually disabled via the settings in the rightmost column.
All of these settings make the configuration of NSH potentially complex but also allow it to
squeeze into very small memory footprints.
</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="cmddependencies"><h2>3.1 Command Dependencies on Configuration Settings</h2></a>
</td>
</tr>
</table>
<center><p>Table. 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>
<th align="left">Can Be Disabled with</th>
</tr>
<tr>
<td><b><code>[</code></b></td>
<td>!<code>CONFIG_EXAMPLES_NSH_DISABLESCRIPT</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_TEST</code></td>
</tr>
<tr>
<td><b><code>cat</code></b></td>
<td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_CAT</code></td>
<td>!<code>CONFIG_DISABLE_ENVIRON</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_CD</code></td>
</tr>
<tr>
<td><b><code>cp</code></b></td>
<td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_CP</code></td>
<tr>
<td><b><code>dd</code></b></td>
<td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_DD</code></td>
</tr>
<tr>
<td><b><code>echo</code></b></td>
<td><br></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_ECHO</code></td>
</tr>
<tr>
<td><b><code>exec</code></b></td>
<td><br></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_EXEC</code></td>
</tr>
<tr>
<td><b><code>exit</code></b></td>
<td><br></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_EXIT</code></td>
<tr>
<td><b><code>free</code></b></td>
<td><br></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_FREE</code></td>
</tr>
<td><code>CONFIG_NET</code> && <code>CONFIG_NET_UDP</code> &&
<code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_NET_BUFSIZE</code> >= 558<sup>1</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_GET</code></td>
<tr>
<td><b><code>help</code></b></td>
<td><br></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_HELP</code></td>
</tr>
<tr>
<td><b><code>ifconfig</code></b></td>
<td><code>CONFIG_NET</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_IFCONFIG</code></td>
<tr>
<td><b><code>kill</code></b></td>
<td>!<code>CONFIG_DISABLE_SIGNALS</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_KILL</code></td>
</tr>
<tr>
<td><b><code>losetup</code></b></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_LOSETUP</code></td>
</tr>
<tr>
<td><b><code>ls</code></b></td>
<td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_LS</code></td>
</tr>
<tr>
<td><b><code>mb,mh,mw</code></b></td>
<td><br></td>
<td>
<code>CONFIG_EXAMPLES_NSH_DISABLE_MB</code>,<br>
<code>CONFIG_EXAMPLES_NSH_DISABLE_MH</code>,<br>
<code>CONFIG_EXAMPLES_NSH_DISABLE_MW</code>
</td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_MKDIR</code></td>
</tr>
<tr>
<td><b><code>mkfatfs</code></b></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_FAT</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_MKFATFS</code></td>
<td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_MKFIFO</code></td>
</tr>
<tr>
<td><b><code>mkrd</code></b></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_MKRD</code></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_READABLE</code><sup>3</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_MOUNT</code></td>
<td><code>CONFIG_NET</code> && <code>CONFIG_NET_ICMP</code> &&
<code>CONFIG_NET_ICMP_PING</code> && !<code>CONFIG_DISABLE_CLOCK</code> &&
!<code>CONFIG_DISABLE_SIGNALS</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_PING</code></td>
</tr>
<tr>
<td><b><code>ps</code></b></td>
<td><br></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_PS</code></td>
<td><code>CONFIG_NET</code> && <code>CONFIG_NET_UDP</code> &&
<code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_NET_BUFSIZE</code> >= 558<sup>1,2</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_PUT</code></td>
<tr>
<td><b><code>pwd</code></b></td>
<td>!<code>CONFIG_DISABLE_ENVIRON</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_PWD</code></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_RM</code></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_RMDIR</code></td>
</tr>
<tr>
<td><b><code>set</code></b></td>
<td>!<code>CONFIG_DISABLE_ENVIRON</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_SET</code></td>
</tr>
<tr>
<td><b><code>sh</code></b></td>
<td><code>CONFIG_NFILE_DESCRIPTORS > 0 && <code>CONFIG_NFILE_STREAMS > 0 && !<code>CONFIG_EXAMPLES_NSH_DISABLESCRIPT</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_SH</code></td>
</tr>
<tr>
<td><b><code>sleep</code></b></td>
<td>!<code>CONFIG_DISABLE_SIGNALS</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_SLEEP</code></td>
</tr>
<tr>
<td><b><code>test</code></b></td>
<td>!<code>CONFIG_EXAMPLES_NSH_DISABLESCRIPT</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_TEST</code></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_READABLE</code><sup>3</sup></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_UMOUNT</code></td>
</tr>
<tr>
<td><b><code>unset</code></b></td>
<td>!<code>CONFIG_DISABLE_ENVIRON</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_UNSET</code></td>
</tr>
<tr>
<td><b><code>usleep</code></b></td>
<td>!<code>CONFIG_DISABLE_SIGNALS</code></td>
<td><code>CONFIG_EXAMPLES_NSH_DISABLE_USLEEP</code></td>
</tr>