1 | :orphan: |
---|
2 | |
---|
3 | |
---|
4 | .. COMMENT: %**end of header |
---|
5 | |
---|
6 | .. COMMENT: COPYRIGHT (c) 1989-2013. |
---|
7 | |
---|
8 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
9 | |
---|
10 | .. COMMENT: All rights reserved. |
---|
11 | |
---|
12 | .. COMMENT: Master file for the Shell User's Guide |
---|
13 | |
---|
14 | .. COMMENT: Joel's Questions |
---|
15 | |
---|
16 | .. COMMENT: 1. Why does paragraphindent only impact makeinfo? |
---|
17 | |
---|
18 | .. COMMENT: 2. Why does paragraphindent show up in HTML? |
---|
19 | |
---|
20 | .. COMMENT: COPYRIGHT (c) 1988-2002. |
---|
21 | |
---|
22 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
23 | |
---|
24 | .. COMMENT: All rights reserved. |
---|
25 | |
---|
26 | .. COMMENT: The following determines which set of the tables and figures we will use. |
---|
27 | |
---|
28 | .. COMMENT: We default to ASCII but if available TeX or HTML versions will |
---|
29 | |
---|
30 | .. COMMENT: be used instead. |
---|
31 | |
---|
32 | .. COMMENT: @clear use-html |
---|
33 | |
---|
34 | .. COMMENT: @clear use-tex |
---|
35 | |
---|
36 | .. COMMENT: The following variable says to use texinfo or html for the two column |
---|
37 | |
---|
38 | .. COMMENT: texinfo tables. For somethings the format does not look good in html. |
---|
39 | |
---|
40 | .. COMMENT: With our adjustment to the left column in TeX, it nearly always looks |
---|
41 | |
---|
42 | .. COMMENT: good printed. |
---|
43 | |
---|
44 | .. COMMENT: Custom whitespace adjustments. We could fiddle a bit more. |
---|
45 | |
---|
46 | .. COMMENT: @syncodeindex fn cp |
---|
47 | |
---|
48 | .. COMMENT: Title Page Stuff |
---|
49 | |
---|
50 | .. COMMENT: I don't really like having a short title page. -joel |
---|
51 | |
---|
52 | .. COMMENT: @shorttitlepage RTEMS Shell User's Guide |
---|
53 | |
---|
54 | ======================== |
---|
55 | RTEMS Shell Userâs Guide |
---|
56 | ======================== |
---|
57 | |
---|
58 | .. COMMENT: COPYRIGHT (c) 1988-2015. |
---|
59 | |
---|
60 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
61 | |
---|
62 | .. COMMENT: All rights reserved. |
---|
63 | |
---|
64 | .. COMMENT: The following puts a space somewhere on an otherwise empty page so we |
---|
65 | |
---|
66 | .. COMMENT: can force the copyright description onto a left hand page. |
---|
67 | |
---|
68 | COPYRIGHT © 1988 - 2015. |
---|
69 | |
---|
70 | On-Line Applications Research Corporation (OAR). |
---|
71 | |
---|
72 | The authors have used their best efforts in preparing |
---|
73 | this material. These efforts include the development, research, |
---|
74 | and testing of the theories and programs to determine their |
---|
75 | effectiveness. No warranty of any kind, expressed or implied, |
---|
76 | with regard to the software or the material contained in this |
---|
77 | document is provided. No liability arising out of the |
---|
78 | application or use of any product described in this document is |
---|
79 | assumed. The authors reserve the right to revise this material |
---|
80 | and to make changes from time to time in the content hereof |
---|
81 | without obligation to notify anyone of such revision or changes. |
---|
82 | |
---|
83 | The RTEMS Project is hosted at http://www.rtems.org. Any |
---|
84 | inquiries concerning RTEMS, its related support components, or its |
---|
85 | documentation should be directed to the Community Project hosted athttp://www.rtems.org. |
---|
86 | |
---|
87 | Any inquiries for commercial services including training, support, custom |
---|
88 | development, application development assistance should be directed tohttp://www.rtems.com. |
---|
89 | |
---|
90 | .. COMMENT: This prevents a black box from being printed on "overflow" lines. |
---|
91 | |
---|
92 | .. COMMENT: The alternative is to rework a sentence to avoid this problem. |
---|
93 | |
---|
94 | RTEMS Shell Userâs Guide |
---|
95 | ######################## |
---|
96 | |
---|
97 | .. COMMENT: COPYRIGHT (c) 1989-2011. |
---|
98 | |
---|
99 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
100 | |
---|
101 | .. COMMENT: All rights reserved. |
---|
102 | |
---|
103 | Preface |
---|
104 | ####### |
---|
105 | |
---|
106 | Real-time embedded systems vary widely based upon their |
---|
107 | operational and maintenance requirements. Some of these |
---|
108 | systems provide ways for the user or developer to interact |
---|
109 | with them. This interaction could be used for operational, |
---|
110 | diagnostic, or configuration purposes. The capabilities |
---|
111 | described in this manual are those provided with RTEMS to |
---|
112 | provide a command line interface for user access. Some |
---|
113 | of these commands will be familiar as standard POSIX utilities |
---|
114 | while others are RTEMS specific or helpful in debugging |
---|
115 | and analyzing an embedded system. As a simple example of |
---|
116 | the powerful and very familiar capabilities that the RTEMS |
---|
117 | Shell provides to an application, consider the following |
---|
118 | example which hints at some of the capabilities available: |
---|
119 | .. code:: c |
---|
120 | |
---|
121 | Welcome to rtems-4.10.99.0(SPARC/w/FPU/sis) |
---|
122 | COPYRIGHT (c) 1989-2011. |
---|
123 | On-Line Applications Research Corporation (OAR). |
---|
124 | Login into RTEMS |
---|
125 | login: rtems |
---|
126 | Password: |
---|
127 | RTEMS SHELL (Ver.1.0-FRC):/dev/console. Feb 28 2008. 'help' to list commands. |
---|
128 | SHLL \[/] $ cat /etc/passwd |
---|
129 | root:\*:0:0:root::/:/bin/sh |
---|
130 | rtems:\*:1:1:RTEMS Application::/:/bin/sh |
---|
131 | tty:!:2:2:tty owner::/:/bin/false |
---|
132 | SHLL \[/] $ ls /dev |
---|
133 | -rwxr-xr-x 1 rtems root 0 Jan 01 00:00 console |
---|
134 | -rwxr-xr-x 1 root root 0 Jan 01 00:00 console_b |
---|
135 | 2 files 0 bytes occupied |
---|
136 | SHLL \[/] $ stackuse |
---|
137 | Stack usage by thread |
---|
138 | ID NAME LOW HIGH CURRENT AVAILABLE USED |
---|
139 | 0x09010001 IDLE 0x023d89a0 - 0x023d99af 0x023d9760 4096 608 |
---|
140 | 0x0a010001 UI1 0x023d9f30 - 0x023daf3f 0x023dad18 4096 1804 |
---|
141 | 0x0a010002 SHLL 0x023db4c0 - 0x023df4cf 0x023de9d0 16384 6204 |
---|
142 | 0xffffffff INTR 0x023d2760 - 0x023d375f 0x00000000 4080 316 |
---|
143 | SHLL \[/] $ mount -L |
---|
144 | File systems: msdos |
---|
145 | SHLL \[/] $ |
---|
146 | |
---|
147 | In the above example, the user *rtems* logs into a |
---|
148 | SPARC based RTEMS system. The first command is ``cat /etc/passwd``. This simple command lets us |
---|
149 | know that this application is running the In Memory |
---|
150 | File System (IMFS) and that the infrastructure has |
---|
151 | provided dummy entries for */etc/passwd* and a few |
---|
152 | other files. The contents of */etc/passwd* let |
---|
153 | us know that the user could have logged in as ``root``. |
---|
154 | In fact, the ``root`` user has more permissions |
---|
155 | than ``rtems`` who is not allowed to write into the |
---|
156 | filesystem. |
---|
157 | |
---|
158 | The second command is ``ls /dev`` which lets us |
---|
159 | know that RTEMS has POSIX-style device nodes which |
---|
160 | can be accesses through standard I/O function calls. |
---|
161 | |
---|
162 | The third command executed is the RTEMS specific ``stackuse`` which gives a report on the stack |
---|
163 | usage of each thread in the system. Since stack |
---|
164 | overflows are a common error in deeply embedded systems, |
---|
165 | this is a surprising simple, yet powerful debugging aid. |
---|
166 | |
---|
167 | Finally, the last command, ``mount -L`` hints that |
---|
168 | RTEMS supports a variety of mountable filesystems. With |
---|
169 | support for MS-DOS FAT on IDE/ATA and Flash devices as |
---|
170 | well as network-based filesystens such as NFS and TFTP, |
---|
171 | the standard free RTEMS provides a robuse infrastructure |
---|
172 | for embedded applications. |
---|
173 | |
---|
174 | This manual describes the RTEMS Shell and its command set. |
---|
175 | In our terminology, the Shell is just a loop reading user |
---|
176 | input and turning that input into commands with argument. |
---|
177 | The Shell provided with RTEMS is a simple command reading |
---|
178 | loop with limited scripting capabilities. It can be connected |
---|
179 | to via a standard serial port or connected to the RTEMS``telnetd`` server for use across a network. |
---|
180 | |
---|
181 | Each command in the command set is implemented as a single |
---|
182 | subroutine which has a *main-style* prototype. The commands |
---|
183 | interpret their arguments and operate upon stdin, stdout, and |
---|
184 | stderr by default. This allows each command to be invoked |
---|
185 | independent of the shell. |
---|
186 | |
---|
187 | The described separation of shell from commands from communications |
---|
188 | mechanism was an important design goal. At one level, the RTEMS |
---|
189 | Shell is a complete shell environment providing access to multiple |
---|
190 | POSIX compliant filesystems and TCP/IP stack. The subset of |
---|
191 | capabilities available is easy to configure and the standard |
---|
192 | Shell can be logged into from either a serial port or via telnet. |
---|
193 | But at another level, the Shell is a large set of components which |
---|
194 | can be integrated into the userâs developed command interpreter. |
---|
195 | In either case, it is trivial to add custom commands to the command |
---|
196 | set available. |
---|
197 | |
---|
198 | Acknowledgements |
---|
199 | ================ |
---|
200 | |
---|
201 | .. COMMENT: COPYRIGHT (c) 1988-2009. |
---|
202 | |
---|
203 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
204 | |
---|
205 | .. COMMENT: All rights reserved. |
---|
206 | |
---|
207 | .. COMMENT: The RTEMS Project has been granted permission from The Open Group |
---|
208 | |
---|
209 | .. COMMENT: IEEE to excerpt and use portions of the POSIX standards documents |
---|
210 | |
---|
211 | .. COMMENT: in the RTEMS POSIX API User's Guide and RTEMS Shell User's Guide. |
---|
212 | |
---|
213 | .. COMMENT: We have to include a specific acknowledgement paragraph in these |
---|
214 | |
---|
215 | .. COMMENT: documents (e.g. preface or copyright page) and another slightly |
---|
216 | |
---|
217 | .. COMMENT: different paragraph for each manual page that excerpts and uses |
---|
218 | |
---|
219 | .. COMMENT: text from the standards. |
---|
220 | |
---|
221 | .. COMMENT: This file should help ensure that the paragraphs are consistent |
---|
222 | |
---|
223 | .. COMMENT: and not duplicated |
---|
224 | |
---|
225 | The Institute of Electrical and Electronics Engineers, Inc and The |
---|
226 | Open Group, have given us permission to reprint portions of their |
---|
227 | documentation. |
---|
228 | Portions of this text are reprinted and reproduced in electronic |
---|
229 | form from IEEE Std 1003.1, 2004 Edition, Standard for Information |
---|
230 | Technology â Operating System Interface (POSIX), The Open |
---|
231 | Group Base Specifications Issue 6, Copyright é 2001-2004 by the |
---|
232 | Institute of Electrical and Electronics Engineers, Inc and The |
---|
233 | Open Group. In the event of any discrepancy between this version |
---|
234 | and the original IEEE and The Open Group Standard, the original |
---|
235 | IEEE and The Open Group Standard is the referee document. The |
---|
236 | original Standard can be obtained online athttp://www.opengroup.org/unix/online.html. |
---|
237 | This notice shall appear on any product containing this material. |
---|
238 | |
---|
239 | .. COMMENT: COPYRIGHT (c) 1988-2008. |
---|
240 | |
---|
241 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
242 | |
---|
243 | .. COMMENT: All rights reserved. |
---|
244 | |
---|
245 | Configuration and Initialization |
---|
246 | ################################ |
---|
247 | |
---|
248 | Introduction |
---|
249 | ============ |
---|
250 | |
---|
251 | This chapter provides information on how the application |
---|
252 | configures and initializes the RTEMS shell. |
---|
253 | |
---|
254 | Configuration |
---|
255 | ============= |
---|
256 | |
---|
257 | The command set available to the application is user configurable. |
---|
258 | It is configured using a mechanism similar to the ``confdefs.h`` |
---|
259 | mechanism used to specify application configuration. |
---|
260 | |
---|
261 | In the simplest case, if the user wishes to configure a command |
---|
262 | set with all commands available that are neither filesystem |
---|
263 | management (e.g. mounting, formating, etc.) or network related, |
---|
264 | then the following is all that is required: |
---|
265 | .. code:: c |
---|
266 | |
---|
267 | #define CONFIGURE_SHELL_COMMANDS_INIT |
---|
268 | #define CONFIGURE_SHELL_COMMANDS_ALL |
---|
269 | #include <rtems/shellconfig.h> |
---|
270 | |
---|
271 | In a slightly more complex example, if the user wishes to include |
---|
272 | all networking commands as well as support for mounting MS-DOS and |
---|
273 | NFS filesystems, then the following is all that is required: |
---|
274 | .. code:: c |
---|
275 | |
---|
276 | #define CONFIGURE_SHELL_COMMANDS_INIT |
---|
277 | #define CONFIGURE_SHELL_COMMANDS_ALL |
---|
278 | #define CONFIGURE_SHELL_MOUNT_MSDOS |
---|
279 | #define CONFIGURE_SHELL_MOUNT_NFS |
---|
280 | #include <rtems/shellconfig.h> |
---|
281 | |
---|
282 | Customizing the Command Set |
---|
283 | --------------------------- |
---|
284 | |
---|
285 | The user can configure specific command sets by either building |
---|
286 | up the set from individual commands or starting with a complete |
---|
287 | set and disabling individual commands. Each command has two |
---|
288 | configuration macros associated with it. |
---|
289 | |
---|
290 | *``CONFIGURE_SHELL_COMMAND_XXX``* |
---|
291 | Each command has a constant of this form which is defined when |
---|
292 | building a command set by individually enabling specific |
---|
293 | commands. |
---|
294 | |
---|
295 | *``CONFIGURE_SHELL_NO_COMMAND_XXX``* |
---|
296 | In contrast, each command has a similar command which is |
---|
297 | defined when the application is configuring a command set |
---|
298 | by disabling specific commands in the set. |
---|
299 | |
---|
300 | Adding Custom Commands |
---|
301 | ---------------------- |
---|
302 | |
---|
303 | One of the design goals of the RTEMS Shell was to make it |
---|
304 | easy for a user to add custom commands specific to their |
---|
305 | application. We believe this design goal was accomplished. |
---|
306 | In order to add a custom command, the user is required to |
---|
307 | do the following: |
---|
308 | |
---|
309 | - Provide a *main-style* function which implements |
---|
310 | the command. If that command function uses a ``getopt`` |
---|
311 | related function to parse arguments, it *MUST* use the |
---|
312 | reentrant form. |
---|
313 | |
---|
314 | - Provide a command definition structure of type``rtems_shell_cmd_t``. |
---|
315 | |
---|
316 | - Configure that command using the``CONFIGURE_SHELL_USER_COMMANDS`` macro. |
---|
317 | |
---|
318 | Custom aliases are configured similarly but the user |
---|
319 | only provides an alias definition structure of type``rtems_shell_alias_t`` and configures the alias |
---|
320 | via the ``CONFIGURE_SHELL_USER_ALIASES`` macro. |
---|
321 | |
---|
322 | In the following example, we have implemented a custom |
---|
323 | command named ``usercmd`` which simply prints the |
---|
324 | arguments it was passed. We have also provided an |
---|
325 | alias for ``usercmd`` named ``userecho``. |
---|
326 | .. code:: c |
---|
327 | |
---|
328 | #include <rtems/shell.h> |
---|
329 | int main_usercmd(int argc, char \**argv) |
---|
330 | { |
---|
331 | int i; |
---|
332 | printf( "UserCommand: argc=%d\\n", argc ); |
---|
333 | for (i=0 ; i<argc ; i++ ) |
---|
334 | printf( "argv[%d]= %s\\n", i, argv[i] ); |
---|
335 | return 0; |
---|
336 | } |
---|
337 | rtems_shell_cmd_t Shell_USERCMD_Command = { |
---|
338 | "usercmd", /* name \*/ |
---|
339 | "usercmd n1 \[n2 \[n3...]]", /* usage \*/ |
---|
340 | "user", /* topic \*/ |
---|
341 | main_usercmd, /* command \*/ |
---|
342 | NULL, /* alias \*/ |
---|
343 | NULL /* next \*/ |
---|
344 | }; |
---|
345 | rtems_shell_alias_t Shell_USERECHO_Alias = { |
---|
346 | "usercmd", /* command \*/ |
---|
347 | "userecho" /* alias \*/ |
---|
348 | }; |
---|
349 | #define CONFIGURE_SHELL_USER_COMMANDS &Shell_USERCMD_Command |
---|
350 | #define CONFIGURE_SHELL_USER_ALIASES &Shell_USERECHO_Alias |
---|
351 | #define CONFIGURE_SHELL_COMMANDS_INIT |
---|
352 | #define CONFIGURE_SHELL_COMMANDS_ALL |
---|
353 | #define CONFIGURE_SHELL_MOUNT_MSDOS |
---|
354 | #include <rtems/shellconfig.h> |
---|
355 | |
---|
356 | Notice in the above example, that the user wrote the*main* for their command (e.g. ``main_usercmd``) |
---|
357 | which looks much like any other ``main()``. They |
---|
358 | then defined a ``rtems_shell_cmd_t`` structure |
---|
359 | named ``Shell_USERCMD_Command`` which describes that |
---|
360 | command. This command definition structure is registered |
---|
361 | into the static command set by defining``CONFIGURE_SHELL_USER_COMMANDS`` to``&Shell_USERCMD_Command``. |
---|
362 | |
---|
363 | Similarly, to add the ``userecho`` alias, the user |
---|
364 | provides the alias definition structure named``Shell_USERECHO_Alias`` and defines``CONFIGURE_SHELL_USER_ALIASES`` to configure |
---|
365 | the alias. |
---|
366 | |
---|
367 | The user can configure any number of commands |
---|
368 | and aliases in this manner. |
---|
369 | |
---|
370 | Initialization |
---|
371 | ============== |
---|
372 | |
---|
373 | The shell may be easily attached to a serial port or |
---|
374 | to the ``telnetd`` server. This section describes |
---|
375 | how that is accomplished. |
---|
376 | |
---|
377 | Attached to a Serial Port |
---|
378 | ------------------------- |
---|
379 | |
---|
380 | Starting the shell attached to the console or a serial |
---|
381 | port is very simple. The user invokes ``rtems_shell_init`` |
---|
382 | with parameters to indicate the characteristics of the task |
---|
383 | that will be executing the shell including name, stack size, |
---|
384 | and priority. The user also specifies the device that the |
---|
385 | shell is to be attached to. |
---|
386 | |
---|
387 | This example is taken from the ``fileio`` sample test. |
---|
388 | This shell portion of this test can be run on any target which |
---|
389 | provides a console with input and output capabilities. It does |
---|
390 | not include any commands which cannot be supported on all BSPs. |
---|
391 | The source code for this test is in ``testsuites/samples/fileio`` |
---|
392 | with the shell configuration in the ``init.c`` file. |
---|
393 | .. code:: c |
---|
394 | |
---|
395 | #include <rtems/shell.h> |
---|
396 | void start_shell(void) |
---|
397 | { |
---|
398 | printf(" =========================\\n"); |
---|
399 | printf(" starting shell\\n"); |
---|
400 | printf(" =========================\\n"); |
---|
401 | rtems_shell_init( |
---|
402 | "SHLL", /* task name \*/ |
---|
403 | RTEMS_MINIMUM_STACK_SIZE * 4, /* task stack size \*/ |
---|
404 | 100, /* task priority \*/ |
---|
405 | "/dev/console", /* device name \*/ |
---|
406 | false, /* run forever \*/ |
---|
407 | true, /* wait for shell to terminate \*/ |
---|
408 | rtems_shell_login_check /* login check function, |
---|
409 | use NULL to disable a login check \*/ |
---|
410 | ); |
---|
411 | } |
---|
412 | |
---|
413 | In the above example, the call to ``rtems_shell_init`` |
---|
414 | spawns a task to run the RTEMS Shell attached to ``/dev/console`` |
---|
415 | and executing at priority 100. The caller suspends itself and |
---|
416 | lets the shell take over the console device. When the shell |
---|
417 | is exited by the user, then control returns to the caller. |
---|
418 | |
---|
419 | Attached to a Socket |
---|
420 | -------------------- |
---|
421 | |
---|
422 | TBD |
---|
423 | |
---|
424 | Access Control |
---|
425 | ============== |
---|
426 | |
---|
427 | Login Checks |
---|
428 | ------------ |
---|
429 | |
---|
430 | Login checks are optional for the RTEMS shell and can be configured via a login |
---|
431 | check handler passed to ``rtems_shell_init()``. One login check handler is``rtems_shell_login_check()``. |
---|
432 | |
---|
433 | Configuration Files |
---|
434 | ------------------- |
---|
435 | |
---|
436 | The following files are used by the login check handler``rtems_shell_login_check()`` to validate a passphrase for a user and to set |
---|
437 | up the user environment for the shell command execution. |
---|
438 | |
---|
439 | :file:`/etc/passwd` |
---|
440 | The format for each line is |
---|
441 | |
---|
442 | .. code:: c |
---|
443 | |
---|
444 | user_name:password:UID:GID:GECOS:directory:shell |
---|
445 | |
---|
446 | with colon separated |
---|
447 | fields. For more information refer to the Linux PASSWD(5) man page. Use a``password`` of ``*`` to disable the login of the user. An empty |
---|
448 | password allows login without a password for this user. In contrast to |
---|
449 | standard UNIX systems, this file is only readable and writeable for the user |
---|
450 | with an UID of zero by default. The ``directory`` is used to perform a |
---|
451 | filesystem change root operation in ``rtems_shell_login_check()`` in |
---|
452 | contrast to a normal usage as the HOME directory of the user. The*default* content is |
---|
453 | |
---|
454 | .. code:: c |
---|
455 | |
---|
456 | root::0:0:::: |
---|
457 | |
---|
458 | so there is *no password required* for the ``root`` user. |
---|
459 | |
---|
460 | :file:`/etc/group` |
---|
461 | The format for each line is |
---|
462 | |
---|
463 | .. code:: c |
---|
464 | |
---|
465 | group_name:password:GID:user_list |
---|
466 | |
---|
467 | with colon separated fields. The ``user_list`` is comma separated. For |
---|
468 | more information refer to the Linux GROUP(5) man page. In contrast to standard |
---|
469 | UNIX systems, this file is only readable and writeable for the user with an UID |
---|
470 | of zero by default. The default content is |
---|
471 | |
---|
472 | .. code:: c |
---|
473 | |
---|
474 | root::0: |
---|
475 | |
---|
476 | Command Visibility and Execution Permission |
---|
477 | ------------------------------------------- |
---|
478 | |
---|
479 | Each command has |
---|
480 | |
---|
481 | - an owner, |
---|
482 | |
---|
483 | - a group, and |
---|
484 | |
---|
485 | - a read permission flag for the owner, the group and all other users, and |
---|
486 | |
---|
487 | - an execution permission flag for the owner, the group and all other |
---|
488 | users. |
---|
489 | |
---|
490 | The read and write permission flags are stored in the command mode. The read |
---|
491 | permission flags determine the visibility of the command for the current user. |
---|
492 | The execution permission flags determine the ability to execute a command for |
---|
493 | the current user. These command properties can be displayed and changed with |
---|
494 | the |
---|
495 | |
---|
496 | - ``cmdls``, |
---|
497 | |
---|
498 | - ``cmdchown``, and |
---|
499 | |
---|
500 | - ``cmdchmod`` |
---|
501 | |
---|
502 | commands. The access is determined by the effective UID, the effective GID and |
---|
503 | the supplementary group IDs of the current user and follows the standard |
---|
504 | filesystem access procedure. |
---|
505 | |
---|
506 | Add CRYPT(3) Formats |
---|
507 | -------------------- |
---|
508 | |
---|
509 | By default the ``crypt_r()`` function used by``rtems_shell_login_check()`` supports only plain text passphrases. Use``crypt_add_format()`` to add more formats. The following formats are |
---|
510 | available out of the box |
---|
511 | |
---|
512 | - ``crypt_md5_format``, |
---|
513 | |
---|
514 | - ``crypt_sha256_format``, and |
---|
515 | |
---|
516 | - ``crypt_sha512_format``. |
---|
517 | |
---|
518 | An example follows... index:: crypt_add_format |
---|
519 | |
---|
520 | .. code:: c |
---|
521 | |
---|
522 | #include <crypt.h> |
---|
523 | void add_formats( void ) |
---|
524 | { |
---|
525 | crypt_add_format( &crypt_md5_format ); |
---|
526 | crypt_add_format( &crypt_sha512_format ); |
---|
527 | } |
---|
528 | |
---|
529 | Functions |
---|
530 | ========= |
---|
531 | |
---|
532 | This section describes the Shell related C functions which are |
---|
533 | publicly available related to initialization and configuration. |
---|
534 | |
---|
535 | rtems_shell_init - Initialize the shell |
---|
536 | --------------------------------------- |
---|
537 | .. index:: initialization |
---|
538 | |
---|
539 | **CALLING SEQUENCE:** |
---|
540 | |
---|
541 | .. index:: rtems_shell_init |
---|
542 | |
---|
543 | .. code:: c |
---|
544 | |
---|
545 | rtems_status_code rtems_shell_init( |
---|
546 | const char \*task_name, |
---|
547 | size_t task_stacksize, |
---|
548 | rtems_task_priority task_priority, |
---|
549 | const char \*devname, |
---|
550 | bool forever, |
---|
551 | bool wait, |
---|
552 | rtems_login_check login_check |
---|
553 | ); |
---|
554 | |
---|
555 | **DIRECTIVE STATUS CODES:** |
---|
556 | |
---|
557 | ``RTEMS_SUCCESSFUL`` - Shell task spawned successfully |
---|
558 | |
---|
559 | others - to indicate a failure condition |
---|
560 | |
---|
561 | **DESCRIPTION:** |
---|
562 | |
---|
563 | This service creates a task with the specified characteristics to |
---|
564 | run the RTEMS Shell attached to the specified ``devname``. |
---|
565 | |
---|
566 | **NOTES:** |
---|
567 | |
---|
568 | This method invokes the ``rtems_task_create`` and ``rtems_task_start`` |
---|
569 | directives and as such may return any status code that those directives |
---|
570 | may return. |
---|
571 | |
---|
572 | There is one POSIX key necessary for all shell instances together and one POSIX |
---|
573 | key value pair per instance. You should make sure that your RTEMS configuration |
---|
574 | accounts for these resources. |
---|
575 | |
---|
576 | rtems_shell_login_check - Default login check handler |
---|
577 | ----------------------------------------------------- |
---|
578 | .. index:: initialization |
---|
579 | |
---|
580 | **CALLING SEQUENCE:** |
---|
581 | |
---|
582 | .. index:: rtems_shell_login_check |
---|
583 | |
---|
584 | .. code:: c |
---|
585 | |
---|
586 | bool rtems_shell_login_check( |
---|
587 | const char \*user, |
---|
588 | const char \*passphrase |
---|
589 | ); |
---|
590 | |
---|
591 | **DIRECTIVE STATUS CODES:** |
---|
592 | |
---|
593 | ``true`` - login is allowed, and |
---|
594 | ``false`` - otherwise. |
---|
595 | |
---|
596 | **DESCRIPTION:** |
---|
597 | |
---|
598 | This function checks if the specified passphrase is valid for the specified user. |
---|
599 | |
---|
600 | **NOTES:** |
---|
601 | |
---|
602 | As a side-effect if the specified passphrase is valid for the specified user, |
---|
603 | this function |
---|
604 | |
---|
605 | - performs a filesystem change root operation to the directory of the |
---|
606 | specified user if the directory path is non-empty, |
---|
607 | |
---|
608 | - changes the owner of the current shell device to the UID of the specified |
---|
609 | user, |
---|
610 | |
---|
611 | - sets the real and effective UID of the current user environment to the |
---|
612 | UID of the specified user, |
---|
613 | |
---|
614 | - sets the real and effective GID of the current user environment to the |
---|
615 | GID of the specified user, and |
---|
616 | |
---|
617 | - sets the supplementary group IDs of the current user environment to the |
---|
618 | supplementary group IDs of the specified user. |
---|
619 | |
---|
620 | In case the filesystem change root operation fails, then the environment setup |
---|
621 | is aborted and ``false`` is returned. |
---|
622 | |
---|
623 | .. COMMENT: COPYRIGHT (c) 1988-2010. |
---|
624 | |
---|
625 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
626 | |
---|
627 | .. COMMENT: All rights reserved. |
---|
628 | |
---|
629 | General Commands |
---|
630 | ################ |
---|
631 | |
---|
632 | Introduction |
---|
633 | ============ |
---|
634 | |
---|
635 | The RTEMS shell has the following general commands: |
---|
636 | |
---|
637 | - ``help`` - Print command help |
---|
638 | |
---|
639 | - ``alias`` - Add alias for an existing command |
---|
640 | |
---|
641 | - ``cmdls`` - List commands |
---|
642 | |
---|
643 | - ``cmdchown`` - Change user or owner of commands |
---|
644 | |
---|
645 | - ``cmdchmod`` - Change mode of commands |
---|
646 | |
---|
647 | - ``date`` - Print or set current date and time |
---|
648 | |
---|
649 | - ``echo`` - Produce message in a shell script |
---|
650 | |
---|
651 | - ``sleep`` - Delay for a specified amount of time |
---|
652 | |
---|
653 | - ``id`` - show uid gid euid and egid |
---|
654 | |
---|
655 | - ``tty`` - show ttyname |
---|
656 | |
---|
657 | - ``whoami`` - print effective user id |
---|
658 | |
---|
659 | - ``getenv`` - print environment variable |
---|
660 | |
---|
661 | - ``setenv`` - set environment variable |
---|
662 | |
---|
663 | - ``unsetenv`` - unset environment variable |
---|
664 | |
---|
665 | - ``time`` - time command execution |
---|
666 | |
---|
667 | - ``logoff`` - logoff from the system |
---|
668 | |
---|
669 | - ``rtc`` - RTC driver configuration |
---|
670 | |
---|
671 | - ``exit`` - alias for logoff command |
---|
672 | |
---|
673 | Commands |
---|
674 | ======== |
---|
675 | |
---|
676 | This section details the General Commands available. A |
---|
677 | subsection is dedicated to each of the commands and |
---|
678 | describes the behavior and configuration of that |
---|
679 | command as well as providing an example usage. |
---|
680 | |
---|
681 | help - Print command help |
---|
682 | ------------------------- |
---|
683 | .. index:: help |
---|
684 | |
---|
685 | **SYNOPSYS:** |
---|
686 | |
---|
687 | .. code:: c |
---|
688 | |
---|
689 | help misc |
---|
690 | |
---|
691 | **DESCRIPTION:** |
---|
692 | |
---|
693 | This command prints the command help. Help without arguments prints a |
---|
694 | list of topics and help with a topic prints the help for that topic. |
---|
695 | |
---|
696 | **EXIT STATUS:** |
---|
697 | |
---|
698 | This command returns 0. |
---|
699 | |
---|
700 | **NOTES:** |
---|
701 | |
---|
702 | The help print will break the output up based on the environment |
---|
703 | variable SHELL_LINES. If this environment variable is not set the |
---|
704 | default is 16 lines. If set the number of lines is set to that the |
---|
705 | value. If the shell lines is set 0 there will be no break. |
---|
706 | |
---|
707 | **EXAMPLES:** |
---|
708 | |
---|
709 | The following is an example of how to use ``alias``: |
---|
710 | .. code:: c |
---|
711 | |
---|
712 | SHLL \[/] $ help |
---|
713 | help: ('r' repeat last cmd - 'e' edit last cmd) |
---|
714 | TOPIC? The topics are |
---|
715 | mem, misc, files, help, rtems, network, monitor |
---|
716 | SHLL \[/] $ help misc |
---|
717 | help: list for the topic 'misc' |
---|
718 | alias - alias old new |
---|
719 | time - time command \[arguments...] |
---|
720 | joel - joel \[args] SCRIPT |
---|
721 | date - date \[YYYY-MM-DD HH:MM:SS] |
---|
722 | echo - echo \[args] |
---|
723 | sleep - sleep seconds \[nanoseconds] |
---|
724 | id - show uid, gid, euid, and egid |
---|
725 | tty - show ttyname |
---|
726 | whoami - show current user |
---|
727 | logoff - logoff from the system |
---|
728 | setenv - setenv \[var] \[string] |
---|
729 | getenv - getenv \[var] |
---|
730 | unsetenv - unsetenv \[var] |
---|
731 | umask - umask \[new_umask] |
---|
732 | Press any key to continue... |
---|
733 | rtc - real time clock read and set |
---|
734 | SHLL \[/] $ setenv SHELL_ENV 0 |
---|
735 | SHLL \[/] $ help misc |
---|
736 | help: list for the topic 'misc' |
---|
737 | alias - alias old new |
---|
738 | time - time command \[arguments...] |
---|
739 | joel - joel \[args] SCRIPT |
---|
740 | date - date \[YYYY-MM-DD HH:MM:SS] |
---|
741 | echo - echo \[args] |
---|
742 | sleep - sleep seconds \[nanoseconds] |
---|
743 | id - show uid, gid, euid, and egid |
---|
744 | tty - show ttyname |
---|
745 | whoami - show current user |
---|
746 | logoff - logoff from the system |
---|
747 | setenv - setenv \[var] \[string] |
---|
748 | getenv - getenv \[var] |
---|
749 | unsetenv - unsetenv \[var] |
---|
750 | umask - umask \[new_umask] |
---|
751 | rtc - real time clock read and set |
---|
752 | |
---|
753 | **CONFIGURATION:** |
---|
754 | |
---|
755 | This command has no configuration. |
---|
756 | |
---|
757 | alias - add alias for an existing command |
---|
758 | ----------------------------------------- |
---|
759 | .. index:: alias |
---|
760 | |
---|
761 | **SYNOPSYS:** |
---|
762 | |
---|
763 | .. code:: c |
---|
764 | |
---|
765 | alias oldCommand newCommand |
---|
766 | |
---|
767 | **DESCRIPTION:** |
---|
768 | |
---|
769 | This command adds an alternate name for an existing command to |
---|
770 | the command set. |
---|
771 | |
---|
772 | **EXIT STATUS:** |
---|
773 | |
---|
774 | This command returns 0 on success and non-zero if an error is encountered. |
---|
775 | |
---|
776 | **NOTES:** |
---|
777 | |
---|
778 | NONE |
---|
779 | |
---|
780 | **EXAMPLES:** |
---|
781 | |
---|
782 | The following is an example of how to use ``alias``: |
---|
783 | .. code:: c |
---|
784 | |
---|
785 | SHLL \[/] $ me |
---|
786 | shell:me command not found |
---|
787 | SHLL \[/] $ alias whoami me |
---|
788 | SHLL \[/] $ me |
---|
789 | rtems |
---|
790 | SHLL \[/] $ whoami |
---|
791 | rtems |
---|
792 | |
---|
793 | **CONFIGURATION:** |
---|
794 | |
---|
795 | .. index:: CONFIGURE_SHELL_NO_COMMAND_ALIAS |
---|
796 | .. index:: CONFIGURE_SHELL_COMMAND_ALIAS |
---|
797 | |
---|
798 | This command is included in the default shell command set. |
---|
799 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_ALIAS`` to have this |
---|
800 | command included. |
---|
801 | |
---|
802 | This command can be excluded from the shell command set by |
---|
803 | defining ``CONFIGURE_SHELL_NO_COMMAND_ALIAS`` when all |
---|
804 | shell commands have been configured. |
---|
805 | |
---|
806 | **PROGRAMMING INFORMATION:** |
---|
807 | |
---|
808 | .. index:: rtems_shell_rtems_main_alias |
---|
809 | |
---|
810 | The ``alias`` is implemented by a C language function |
---|
811 | which has the following prototype: |
---|
812 | .. code:: c |
---|
813 | |
---|
814 | int rtems_shell_rtems_main_alias( |
---|
815 | int argc, |
---|
816 | char \**argv |
---|
817 | ); |
---|
818 | |
---|
819 | The configuration structure for the ``alias`` has the |
---|
820 | following prototype: |
---|
821 | .. code:: c |
---|
822 | |
---|
823 | extern rtems_shell_cmd_t rtems_shell_ALIAS_Command; |
---|
824 | |
---|
825 | cmdls - List commands |
---|
826 | --------------------- |
---|
827 | .. index:: cmdls |
---|
828 | |
---|
829 | **SYNOPSYS:** |
---|
830 | |
---|
831 | .. code:: c |
---|
832 | |
---|
833 | cmdls COMMAND... |
---|
834 | |
---|
835 | **DESCRIPTION:** |
---|
836 | |
---|
837 | This command lists the visible commands of the command set. |
---|
838 | |
---|
839 | **EXIT STATUS:** |
---|
840 | |
---|
841 | This command returns 0 on success and non-zero if an error is encountered. |
---|
842 | |
---|
843 | **NOTES:** |
---|
844 | |
---|
845 | The current user must have read permission to list a command. |
---|
846 | |
---|
847 | **EXAMPLES:** |
---|
848 | |
---|
849 | The following is an example of how to use ``cmdls``: |
---|
850 | .. code:: c |
---|
851 | |
---|
852 | SHLL \[/] # cmdls help shutdown |
---|
853 | r-xr-xr-x 0 0 help |
---|
854 | r-x------ 0 0 shutdown |
---|
855 | |
---|
856 | **CONFIGURATION:** |
---|
857 | |
---|
858 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CMDLS |
---|
859 | .. index:: CONFIGURE_SHELL_COMMAND_CMDLS |
---|
860 | |
---|
861 | This command is included in the default shell command set. |
---|
862 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CMDLS`` to have this |
---|
863 | command included. |
---|
864 | |
---|
865 | This command can be excluded from the shell command set by |
---|
866 | defining ``CONFIGURE_SHELL_NO_COMMAND_CMDLS`` when all |
---|
867 | shell commands have been configured. |
---|
868 | |
---|
869 | **PROGRAMMING INFORMATION:** |
---|
870 | |
---|
871 | The configuration structure for the ``cmdls`` has the |
---|
872 | following prototype: |
---|
873 | .. code:: c |
---|
874 | |
---|
875 | extern rtems_shell_cmd_t rtems_shell_CMDLS_Command; |
---|
876 | |
---|
877 | cmdchown - Change user or owner of commands |
---|
878 | ------------------------------------------- |
---|
879 | .. index:: cmdchown |
---|
880 | |
---|
881 | **SYNOPSYS:** |
---|
882 | |
---|
883 | .. code:: c |
---|
884 | |
---|
885 | cmdchown \[OWNER][:\[GROUP]] COMMAND... |
---|
886 | |
---|
887 | **DESCRIPTION:** |
---|
888 | |
---|
889 | This command changes the user or owner of a command. |
---|
890 | |
---|
891 | **EXIT STATUS:** |
---|
892 | |
---|
893 | This command returns 0 on success and non-zero if an error is encountered. |
---|
894 | |
---|
895 | **NOTES:** |
---|
896 | |
---|
897 | The current user must have an UID of zero or be the command owner to change the |
---|
898 | owner or group. |
---|
899 | |
---|
900 | **EXAMPLES:** |
---|
901 | |
---|
902 | The following is an example of how to use ``cmdchown``: |
---|
903 | .. code:: c |
---|
904 | |
---|
905 | [/] # cmdls help |
---|
906 | r-xr-xr-x 0 0 help |
---|
907 | \[/] # cmdchown 1:1 help |
---|
908 | \[/] # cmdls help |
---|
909 | r--r--r-- 1 1 help |
---|
910 | |
---|
911 | **CONFIGURATION:** |
---|
912 | |
---|
913 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CMDCHOWN |
---|
914 | .. index:: CONFIGURE_SHELL_COMMAND_CMDCHOWN |
---|
915 | |
---|
916 | This command is included in the default shell command set. |
---|
917 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CMDCHOWN`` to have this |
---|
918 | command included. |
---|
919 | |
---|
920 | This command can be excluded from the shell command set by |
---|
921 | defining ``CONFIGURE_SHELL_NO_COMMAND_CMDCHOWN`` when all |
---|
922 | shell commands have been configured. |
---|
923 | |
---|
924 | **PROGRAMMING INFORMATION:** |
---|
925 | |
---|
926 | The configuration structure for the ``cmdchown`` has the |
---|
927 | following prototype: |
---|
928 | .. code:: c |
---|
929 | |
---|
930 | extern rtems_shell_cmd_t rtems_shell_CMDCHOWN_Command; |
---|
931 | |
---|
932 | cmdchmod - Change mode of commands |
---|
933 | ---------------------------------- |
---|
934 | .. index:: cmdchmod |
---|
935 | |
---|
936 | **SYNOPSYS:** |
---|
937 | |
---|
938 | .. code:: c |
---|
939 | |
---|
940 | cmdchmod OCTAL-MODE COMMAND... |
---|
941 | |
---|
942 | **DESCRIPTION:** |
---|
943 | |
---|
944 | This command changes the mode of a command. |
---|
945 | |
---|
946 | **EXIT STATUS:** |
---|
947 | |
---|
948 | This command returns 0 on success and non-zero if an error is encountered. |
---|
949 | |
---|
950 | **NOTES:** |
---|
951 | |
---|
952 | The current user must have an UID of zero or be the command owner to change the |
---|
953 | mode. |
---|
954 | |
---|
955 | **EXAMPLES:** |
---|
956 | |
---|
957 | The following is an example of how to use ``cmdchmod``: |
---|
958 | .. code:: c |
---|
959 | |
---|
960 | [/] # cmdls help |
---|
961 | r-xr-xr-x 0 0 help |
---|
962 | \[/] # cmdchmod 544 help |
---|
963 | \[/] # cmdls help |
---|
964 | r-xr--r-- 0 0 help |
---|
965 | |
---|
966 | **CONFIGURATION:** |
---|
967 | |
---|
968 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CMDCHMOD |
---|
969 | .. index:: CONFIGURE_SHELL_COMMAND_CMDCHMOD |
---|
970 | |
---|
971 | This command is included in the default shell command set. |
---|
972 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CMDCHMOD`` to have this |
---|
973 | command included. |
---|
974 | |
---|
975 | This command can be excluded from the shell command set by |
---|
976 | defining ``CONFIGURE_SHELL_NO_COMMAND_CMDCHMOD`` when all |
---|
977 | shell commands have been configured. |
---|
978 | |
---|
979 | **PROGRAMMING INFORMATION:** |
---|
980 | |
---|
981 | The configuration structure for the ``cmdchmod`` has the |
---|
982 | following prototype: |
---|
983 | .. code:: c |
---|
984 | |
---|
985 | extern rtems_shell_cmd_t rtems_shell_CMDCHMOD_Command; |
---|
986 | |
---|
987 | date - print or set current date and time |
---|
988 | ----------------------------------------- |
---|
989 | .. index:: date |
---|
990 | |
---|
991 | **SYNOPSYS:** |
---|
992 | |
---|
993 | .. code:: c |
---|
994 | |
---|
995 | date |
---|
996 | date DATE TIME |
---|
997 | |
---|
998 | **DESCRIPTION:** |
---|
999 | |
---|
1000 | This command operates one of two modes. When invoked with no |
---|
1001 | arguments, it prints the current date and time. When invoked |
---|
1002 | with both ``date`` and ``time`` arguments, it sets the |
---|
1003 | current time. |
---|
1004 | |
---|
1005 | The ``date`` is specified in ``YYYY-MM-DD`` format. |
---|
1006 | The ``time`` is specified in ``HH:MM:SS`` format. |
---|
1007 | |
---|
1008 | **EXIT STATUS:** |
---|
1009 | |
---|
1010 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1011 | |
---|
1012 | **NOTES:** |
---|
1013 | |
---|
1014 | This comm |
---|
1015 | |
---|
1016 | **EXAMPLES:** |
---|
1017 | |
---|
1018 | The following is an example of how to use ``date``: |
---|
1019 | .. code:: c |
---|
1020 | |
---|
1021 | SHLL \[/] $ date |
---|
1022 | Fri Jan 1 00:00:09 1988 |
---|
1023 | SHLL \[/] $ date 2008-02-29 06:45:32 |
---|
1024 | SHLL \[/] $ date |
---|
1025 | Fri Feb 29 06:45:35 2008 |
---|
1026 | |
---|
1027 | **CONFIGURATION:** |
---|
1028 | |
---|
1029 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DATE |
---|
1030 | .. index:: CONFIGURE_SHELL_COMMAND_DATE |
---|
1031 | |
---|
1032 | This command is included in the default shell command set. |
---|
1033 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DATE`` to have this |
---|
1034 | command included. |
---|
1035 | |
---|
1036 | This command can be excluded from the shell command set by |
---|
1037 | defining ``CONFIGURE_SHELL_NO_COMMAND_DATE`` when all |
---|
1038 | shell commands have been configured. |
---|
1039 | |
---|
1040 | **PROGRAMMING INFORMATION:** |
---|
1041 | |
---|
1042 | .. index:: rtems_shell_rtems_main_date |
---|
1043 | |
---|
1044 | The ``date`` is implemented by a C language function |
---|
1045 | which has the following prototype: |
---|
1046 | .. code:: c |
---|
1047 | |
---|
1048 | int rtems_shell_rtems_main_date( |
---|
1049 | int argc, |
---|
1050 | char \**argv |
---|
1051 | ); |
---|
1052 | |
---|
1053 | The configuration structure for the ``date`` has the |
---|
1054 | following prototype: |
---|
1055 | .. code:: c |
---|
1056 | |
---|
1057 | extern rtems_shell_cmd_t rtems_shell_DATE_Command; |
---|
1058 | |
---|
1059 | echo - produce message in a shell script |
---|
1060 | ---------------------------------------- |
---|
1061 | .. index:: echo |
---|
1062 | |
---|
1063 | **SYNOPSYS:** |
---|
1064 | |
---|
1065 | .. code:: c |
---|
1066 | |
---|
1067 | echo \[-n | -e] args ... |
---|
1068 | |
---|
1069 | **DESCRIPTION:** |
---|
1070 | |
---|
1071 | echo prints its arguments on the standard output, separated by spaces. |
---|
1072 | Unless the *-n* option is present, a newline is output following the |
---|
1073 | arguments. The *-e* option causes echo to treat the escape sequences |
---|
1074 | specially, as described in the following paragraph. The *-e* option is the |
---|
1075 | default, and is provided solely for compatibility with other systems. |
---|
1076 | Only one of the options *-n* and *-e* may be given. |
---|
1077 | |
---|
1078 | If any of the following sequences of characters is encountered during |
---|
1079 | output, the sequence is not output. Instead, the specified action is |
---|
1080 | performed: |
---|
1081 | |
---|
1082 | *\\b* |
---|
1083 | A backspace character is output. |
---|
1084 | |
---|
1085 | *\\c* |
---|
1086 | Subsequent output is suppressed. This is normally used at the |
---|
1087 | end of the last argument to suppress the trailing newline that |
---|
1088 | echo would otherwise output. |
---|
1089 | |
---|
1090 | *\\f* |
---|
1091 | Output a form feed. |
---|
1092 | |
---|
1093 | *\\n* |
---|
1094 | Output a newline character. |
---|
1095 | |
---|
1096 | *\\r* |
---|
1097 | Output a carriage return. |
---|
1098 | |
---|
1099 | *\\t* |
---|
1100 | Output a (horizontal) tab character. |
---|
1101 | |
---|
1102 | *\\v* |
---|
1103 | Output a vertical tab. |
---|
1104 | |
---|
1105 | *\\0digits* |
---|
1106 | Output the character whose value is given by zero to three digits. |
---|
1107 | If there are zero digits, a nul character is output. |
---|
1108 | |
---|
1109 | *\\\\* |
---|
1110 | Output a backslash. |
---|
1111 | |
---|
1112 | **EXIT STATUS:** |
---|
1113 | |
---|
1114 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1115 | |
---|
1116 | **NOTES:** |
---|
1117 | |
---|
1118 | The octal character escape mechanism (\\0digits) differs from the C lan- |
---|
1119 | guage mechanism. |
---|
1120 | |
---|
1121 | There is no way to force ``echo`` to treat its arguments literally, rather |
---|
1122 | than interpreting them as options and escape sequences. |
---|
1123 | |
---|
1124 | **EXAMPLES:** |
---|
1125 | |
---|
1126 | The following is an example of how to use ``echo``: |
---|
1127 | .. code:: c |
---|
1128 | |
---|
1129 | SHLL \[/] $ echo a b c |
---|
1130 | a b c |
---|
1131 | SHLL \[/] $ echo |
---|
1132 | |
---|
1133 | **CONFIGURATION:** |
---|
1134 | |
---|
1135 | .. index:: CONFIGURE_SHELL_NO_COMMAND_ECHO |
---|
1136 | .. index:: CONFIGURE_SHELL_COMMAND_ECHO |
---|
1137 | |
---|
1138 | This command is included in the default shell command set. |
---|
1139 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_ECHO`` to have this |
---|
1140 | command included. |
---|
1141 | |
---|
1142 | This command can be excluded from the shell command set by |
---|
1143 | defining ``CONFIGURE_SHELL_NO_COMMAND_ECHO`` when all |
---|
1144 | shell commands have been configured. |
---|
1145 | |
---|
1146 | **PROGRAMMING INFORMATION:** |
---|
1147 | |
---|
1148 | .. index:: rtems_shell_rtems_main_echo |
---|
1149 | |
---|
1150 | The ``echo`` is implemented by a C language function |
---|
1151 | which has the following prototype: |
---|
1152 | .. code:: c |
---|
1153 | |
---|
1154 | int rtems_shell_rtems_main_echo( |
---|
1155 | int argc, |
---|
1156 | char \**argv |
---|
1157 | ); |
---|
1158 | |
---|
1159 | The configuration structure for the ``echo`` has the |
---|
1160 | following prototype: |
---|
1161 | .. code:: c |
---|
1162 | |
---|
1163 | extern rtems_shell_cmd_t rtems_shell_ECHO_Command; |
---|
1164 | |
---|
1165 | **ORIGIN:** |
---|
1166 | |
---|
1167 | The implementation and portions of the documentation for this |
---|
1168 | command are from NetBSD 4.0. |
---|
1169 | |
---|
1170 | sleep - delay for a specified amount of time |
---|
1171 | -------------------------------------------- |
---|
1172 | .. index:: sleep |
---|
1173 | |
---|
1174 | **SYNOPSYS:** |
---|
1175 | |
---|
1176 | .. code:: c |
---|
1177 | |
---|
1178 | sleep seconds |
---|
1179 | sleep seconds nanoseconds |
---|
1180 | |
---|
1181 | **DESCRIPTION:** |
---|
1182 | |
---|
1183 | This command causes the task executing the shell to block |
---|
1184 | for the specified number of ``seconds`` and ``nanoseconds``. |
---|
1185 | |
---|
1186 | **EXIT STATUS:** |
---|
1187 | |
---|
1188 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1189 | |
---|
1190 | **NOTES:** |
---|
1191 | |
---|
1192 | This command is implemented using the ``nanosleep()`` method. |
---|
1193 | |
---|
1194 | The command line interface is similar to the ``sleep`` command |
---|
1195 | found on POSIX systems but the addition of the ``nanoseconds`` |
---|
1196 | parameter allows fine grained delays in shell scripts without |
---|
1197 | adding another command such as ``usleep``. |
---|
1198 | |
---|
1199 | **EXAMPLES:** |
---|
1200 | |
---|
1201 | The following is an example of how to use ``sleep``: |
---|
1202 | .. code:: c |
---|
1203 | |
---|
1204 | SHLL \[/] $ sleep 10 |
---|
1205 | SHLL \[/] $ sleep 0 5000000 |
---|
1206 | |
---|
1207 | It is not clear from the above but there is a ten second |
---|
1208 | pause after executing the first command before the prompt |
---|
1209 | is printed. The second command completes very quickly |
---|
1210 | from a human perspective and there is no noticeable |
---|
1211 | delay in the prompt being printed. |
---|
1212 | |
---|
1213 | **CONFIGURATION:** |
---|
1214 | |
---|
1215 | .. index:: CONFIGURE_SHELL_NO_COMMAND_SLEEP |
---|
1216 | .. index:: CONFIGURE_SHELL_COMMAND_SLEEP |
---|
1217 | |
---|
1218 | This command is included in the default shell command set. |
---|
1219 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_SLEEP`` to have this |
---|
1220 | command included. |
---|
1221 | |
---|
1222 | This command can be excluded from the shell command set by |
---|
1223 | defining ``CONFIGURE_SHELL_NO_COMMAND_SLEEP`` when all |
---|
1224 | shell commands have been configured. |
---|
1225 | |
---|
1226 | **PROGRAMMING INFORMATION:** |
---|
1227 | |
---|
1228 | .. index:: rtems_shell_rtems_main_sleep |
---|
1229 | |
---|
1230 | The ``sleep`` is implemented by a C language function |
---|
1231 | which has the following prototype: |
---|
1232 | .. code:: c |
---|
1233 | |
---|
1234 | int rtems_shell_rtems_main_sleep( |
---|
1235 | int argc, |
---|
1236 | char \**argv |
---|
1237 | ); |
---|
1238 | |
---|
1239 | The configuration structure for the ``sleep`` has the |
---|
1240 | following prototype: |
---|
1241 | .. code:: c |
---|
1242 | |
---|
1243 | extern rtems_shell_cmd_t rtems_shell_SLEEP_Command; |
---|
1244 | |
---|
1245 | id - show uid gid euid and egid |
---|
1246 | ------------------------------- |
---|
1247 | .. index:: id |
---|
1248 | |
---|
1249 | **SYNOPSYS:** |
---|
1250 | |
---|
1251 | .. code:: c |
---|
1252 | |
---|
1253 | id |
---|
1254 | |
---|
1255 | **DESCRIPTION:** |
---|
1256 | |
---|
1257 | This command prints the user identity. This includes the user id |
---|
1258 | (uid), group id (gid), effective user id (euid), and effective |
---|
1259 | group id (egid). |
---|
1260 | |
---|
1261 | **EXIT STATUS:** |
---|
1262 | |
---|
1263 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1264 | |
---|
1265 | **NOTES:** |
---|
1266 | |
---|
1267 | Remember there is only one POSIX process in a single processor RTEMS |
---|
1268 | application. Each thread may have its own user identity and that |
---|
1269 | identity is used by the filesystem to enforce permissions. |
---|
1270 | |
---|
1271 | **EXAMPLES:** |
---|
1272 | |
---|
1273 | The first example of the ``id`` command is from a session logged |
---|
1274 | in as the normal user ``rtems``: |
---|
1275 | .. code:: c |
---|
1276 | |
---|
1277 | SHLL \[/] # id |
---|
1278 | uid=1(rtems),gid=1(rtems),euid=1(rtems),egid=1(rtems) |
---|
1279 | |
---|
1280 | The second example of the ``id`` command is from a session logged |
---|
1281 | in as the ``root`` user: |
---|
1282 | .. code:: c |
---|
1283 | |
---|
1284 | SHLL \[/] # id |
---|
1285 | uid=0(root),gid=0(root),euid=0(root),egid=0(root) |
---|
1286 | |
---|
1287 | **CONFIGURATION:** |
---|
1288 | |
---|
1289 | .. index:: CONFIGURE_SHELL_NO_COMMAND_ID |
---|
1290 | .. index:: CONFIGURE_SHELL_COMMAND_ID |
---|
1291 | |
---|
1292 | This command is included in the default shell command set. |
---|
1293 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_ID`` to have this |
---|
1294 | command included. |
---|
1295 | |
---|
1296 | This command can be excluded from the shell command set by |
---|
1297 | defining ``CONFIGURE_SHELL_NO_COMMAND_ID`` when all |
---|
1298 | shell commands have been configured. |
---|
1299 | |
---|
1300 | **PROGRAMMING INFORMATION:** |
---|
1301 | |
---|
1302 | .. index:: rtems_shell_rtems_main_id |
---|
1303 | |
---|
1304 | The ``id`` is implemented by a C language function |
---|
1305 | which has the following prototype: |
---|
1306 | .. code:: c |
---|
1307 | |
---|
1308 | int rtems_shell_rtems_main_id( |
---|
1309 | int argc, |
---|
1310 | char \**argv |
---|
1311 | ); |
---|
1312 | |
---|
1313 | The configuration structure for the ``id`` has the |
---|
1314 | following prototype: |
---|
1315 | .. code:: c |
---|
1316 | |
---|
1317 | extern rtems_shell_cmd_t rtems_shell_ID_Command; |
---|
1318 | |
---|
1319 | tty - show ttyname |
---|
1320 | ------------------ |
---|
1321 | .. index:: tty |
---|
1322 | |
---|
1323 | **SYNOPSYS:** |
---|
1324 | |
---|
1325 | .. code:: c |
---|
1326 | |
---|
1327 | tty |
---|
1328 | |
---|
1329 | **DESCRIPTION:** |
---|
1330 | |
---|
1331 | This command prints the file name of the device connected |
---|
1332 | to standard input. |
---|
1333 | |
---|
1334 | **EXIT STATUS:** |
---|
1335 | |
---|
1336 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1337 | |
---|
1338 | **NOTES:** |
---|
1339 | |
---|
1340 | NONE |
---|
1341 | |
---|
1342 | **EXAMPLES:** |
---|
1343 | |
---|
1344 | The following is an example of how to use ``tty``: |
---|
1345 | .. code:: c |
---|
1346 | |
---|
1347 | SHLL \[/] $ tty |
---|
1348 | /dev/console |
---|
1349 | |
---|
1350 | **CONFIGURATION:** |
---|
1351 | |
---|
1352 | .. index:: CONFIGURE_SHELL_NO_COMMAND_TTY |
---|
1353 | .. index:: CONFIGURE_SHELL_COMMAND_TTY |
---|
1354 | |
---|
1355 | This command is included in the default shell command set. |
---|
1356 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_TTY`` to have this |
---|
1357 | command included. |
---|
1358 | |
---|
1359 | This command can be excluded from the shell command set by |
---|
1360 | defining ``CONFIGURE_SHELL_NO_COMMAND_TTY`` when all |
---|
1361 | shell commands have been configured. |
---|
1362 | |
---|
1363 | **PROGRAMMING INFORMATION:** |
---|
1364 | |
---|
1365 | .. index:: rtems_shell_rtems_main_tty |
---|
1366 | |
---|
1367 | The ``tty`` is implemented by a C language function |
---|
1368 | which has the following prototype: |
---|
1369 | .. code:: c |
---|
1370 | |
---|
1371 | int rtems_shell_rtems_main_tty( |
---|
1372 | int argc, |
---|
1373 | char \**argv |
---|
1374 | ); |
---|
1375 | |
---|
1376 | The configuration structure for the ``tty`` has the |
---|
1377 | following prototype: |
---|
1378 | .. code:: c |
---|
1379 | |
---|
1380 | extern rtems_shell_cmd_t rtems_shell_TTY_Command; |
---|
1381 | |
---|
1382 | whoami - print effective user id |
---|
1383 | -------------------------------- |
---|
1384 | .. index:: whoami |
---|
1385 | |
---|
1386 | **SYNOPSYS:** |
---|
1387 | |
---|
1388 | .. code:: c |
---|
1389 | |
---|
1390 | whoami |
---|
1391 | |
---|
1392 | **DESCRIPTION:** |
---|
1393 | |
---|
1394 | This command displays the user name associated with the current |
---|
1395 | effective user id. |
---|
1396 | |
---|
1397 | **EXIT STATUS:** |
---|
1398 | |
---|
1399 | This command always succeeds. |
---|
1400 | |
---|
1401 | **NOTES:** |
---|
1402 | |
---|
1403 | NONE |
---|
1404 | |
---|
1405 | **EXAMPLES:** |
---|
1406 | |
---|
1407 | The following is an example of how to use ``whoami``: |
---|
1408 | .. code:: c |
---|
1409 | |
---|
1410 | SHLL \[/] $ whoami |
---|
1411 | rtems |
---|
1412 | |
---|
1413 | **CONFIGURATION:** |
---|
1414 | |
---|
1415 | .. index:: CONFIGURE_SHELL_NO_COMMAND_WHOAMI |
---|
1416 | .. index:: CONFIGURE_SHELL_COMMAND_WHOAMI |
---|
1417 | |
---|
1418 | This command is included in the default shell command set. |
---|
1419 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_WHOAMI`` to have this |
---|
1420 | command included. |
---|
1421 | |
---|
1422 | This command can be excluded from the shell command set by |
---|
1423 | defining ``CONFIGURE_SHELL_NO_COMMAND_WHOAMI`` when all |
---|
1424 | shell commands have been configured. |
---|
1425 | |
---|
1426 | **PROGRAMMING INFORMATION:** |
---|
1427 | |
---|
1428 | .. index:: rtems_shell_rtems_main_whoami |
---|
1429 | |
---|
1430 | The ``whoami`` is implemented by a C language function |
---|
1431 | which has the following prototype: |
---|
1432 | .. code:: c |
---|
1433 | |
---|
1434 | int rtems_shell_rtems_main_whoami( |
---|
1435 | int argc, |
---|
1436 | char \**argv |
---|
1437 | ); |
---|
1438 | |
---|
1439 | The configuration structure for the ``whoami`` has the |
---|
1440 | following prototype: |
---|
1441 | .. code:: c |
---|
1442 | |
---|
1443 | extern rtems_shell_cmd_t rtems_shell_WHOAMI_Command; |
---|
1444 | |
---|
1445 | getenv - print environment variable |
---|
1446 | ----------------------------------- |
---|
1447 | .. index:: getenv |
---|
1448 | |
---|
1449 | **SYNOPSYS:** |
---|
1450 | |
---|
1451 | .. code:: c |
---|
1452 | |
---|
1453 | getenv variable |
---|
1454 | |
---|
1455 | **DESCRIPTION:** |
---|
1456 | |
---|
1457 | This command is used to display the value of a ``variable`` in the set |
---|
1458 | of environment variables. |
---|
1459 | |
---|
1460 | **EXIT STATUS:** |
---|
1461 | |
---|
1462 | This command will return 1 and print a diagnostic message if |
---|
1463 | a failure occurs. |
---|
1464 | |
---|
1465 | **NOTES:** |
---|
1466 | |
---|
1467 | The entire RTEMS application shares a single set of environment variables. |
---|
1468 | |
---|
1469 | **EXAMPLES:** |
---|
1470 | |
---|
1471 | The following is an example of how to use ``getenv``: |
---|
1472 | .. code:: c |
---|
1473 | |
---|
1474 | SHLL \[/] $ getenv BASEPATH |
---|
1475 | /mnt/hda1 |
---|
1476 | |
---|
1477 | **CONFIGURATION:** |
---|
1478 | |
---|
1479 | .. index:: CONFIGURE_SHELL_NO_COMMAND_GETENV |
---|
1480 | .. index:: CONFIGURE_SHELL_COMMAND_GETENV |
---|
1481 | |
---|
1482 | This command is included in the default shell command set. |
---|
1483 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_GETENV`` to have this |
---|
1484 | command included. |
---|
1485 | |
---|
1486 | This command can be excluded from the shell command set by |
---|
1487 | defining ``CONFIGURE_SHELL_NO_COMMAND_GETENV`` when all |
---|
1488 | shell commands have been configured. |
---|
1489 | |
---|
1490 | **PROGRAMMING INFORMATION:** |
---|
1491 | |
---|
1492 | .. index:: rtems_shell_rtems_main_getenv |
---|
1493 | |
---|
1494 | The ``getenv`` is implemented by a C language function |
---|
1495 | which has the following prototype: |
---|
1496 | .. code:: c |
---|
1497 | |
---|
1498 | int rtems_shell_rtems_main_getenv( |
---|
1499 | int argc, |
---|
1500 | char \**argv |
---|
1501 | ); |
---|
1502 | |
---|
1503 | The configuration structure for the ``getenv`` has the |
---|
1504 | following prototype: |
---|
1505 | .. code:: c |
---|
1506 | |
---|
1507 | extern rtems_shell_cmd_t rtems_shell_GETENV_Command; |
---|
1508 | |
---|
1509 | setenv - set environment variable |
---|
1510 | --------------------------------- |
---|
1511 | .. index:: setenv |
---|
1512 | |
---|
1513 | **SYNOPSYS:** |
---|
1514 | |
---|
1515 | .. code:: c |
---|
1516 | |
---|
1517 | setenv variable \[value] |
---|
1518 | |
---|
1519 | **DESCRIPTION:** |
---|
1520 | |
---|
1521 | This command is used to add a new ``variable`` to the set of environment |
---|
1522 | variables or to modify the variable of an already existing ``variable``. |
---|
1523 | If the ``value`` is not provided, the ``variable`` will be set to the |
---|
1524 | empty string. |
---|
1525 | |
---|
1526 | **EXIT STATUS:** |
---|
1527 | |
---|
1528 | This command will return 1 and print a diagnostic message if |
---|
1529 | a failure occurs. |
---|
1530 | |
---|
1531 | **NOTES:** |
---|
1532 | |
---|
1533 | The entire RTEMS application shares a single set of environment variables. |
---|
1534 | |
---|
1535 | **EXAMPLES:** |
---|
1536 | |
---|
1537 | The following is an example of how to use ``setenv``: |
---|
1538 | .. code:: c |
---|
1539 | |
---|
1540 | SHLL \[/] $ setenv BASEPATH /mnt/hda1 |
---|
1541 | |
---|
1542 | **CONFIGURATION:** |
---|
1543 | |
---|
1544 | .. index:: CONFIGURE_SHELL_NO_COMMAND_SETENV |
---|
1545 | .. index:: CONFIGURE_SHELL_COMMAND_SETENV |
---|
1546 | |
---|
1547 | This command is included in the default shell command set. |
---|
1548 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_SETENV`` to have this |
---|
1549 | command included. |
---|
1550 | |
---|
1551 | This command can be excluded from the shell command set by |
---|
1552 | defining ``CONFIGURE_SHELL_NO_COMMAND_SETENV`` when all |
---|
1553 | shell commands have been configured. |
---|
1554 | |
---|
1555 | **PROGRAMMING INFORMATION:** |
---|
1556 | |
---|
1557 | .. index:: rtems_shell_rtems_main_setenv |
---|
1558 | |
---|
1559 | The ``setenv`` is implemented by a C language function |
---|
1560 | which has the following prototype: |
---|
1561 | .. code:: c |
---|
1562 | |
---|
1563 | int rtems_shell_rtems_main_setenv( |
---|
1564 | int argc, |
---|
1565 | char \**argv |
---|
1566 | ); |
---|
1567 | |
---|
1568 | The configuration structure for the ``setenv`` has the |
---|
1569 | following prototype: |
---|
1570 | .. code:: c |
---|
1571 | |
---|
1572 | extern rtems_shell_cmd_t rtems_shell_SETENV_Command; |
---|
1573 | |
---|
1574 | unsetenv - unset environment variable |
---|
1575 | ------------------------------------- |
---|
1576 | .. index:: unsetenv |
---|
1577 | |
---|
1578 | **SYNOPSYS:** |
---|
1579 | |
---|
1580 | .. code:: c |
---|
1581 | |
---|
1582 | unsetenv variable |
---|
1583 | |
---|
1584 | **DESCRIPTION:** |
---|
1585 | |
---|
1586 | This command is remove to a ``variable`` from the set of environment |
---|
1587 | variables. |
---|
1588 | |
---|
1589 | **EXIT STATUS:** |
---|
1590 | |
---|
1591 | This command will return 1 and print a diagnostic message if |
---|
1592 | a failure occurs. |
---|
1593 | |
---|
1594 | **NOTES:** |
---|
1595 | |
---|
1596 | The entire RTEMS application shares a single set of environment variables. |
---|
1597 | |
---|
1598 | **EXAMPLES:** |
---|
1599 | |
---|
1600 | The following is an example of how to use ``unsetenv``: |
---|
1601 | .. code:: c |
---|
1602 | |
---|
1603 | SHLL \[/] $ unsetenv BASEPATH |
---|
1604 | |
---|
1605 | **CONFIGURATION:** |
---|
1606 | |
---|
1607 | .. index:: CONFIGURE_SHELL_NO_COMMAND_UNSETENV |
---|
1608 | .. index:: CONFIGURE_SHELL_COMMAND_UNSETENV |
---|
1609 | |
---|
1610 | This command is included in the default shell command set. |
---|
1611 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_UNSETENV`` to have this |
---|
1612 | command included. |
---|
1613 | |
---|
1614 | This command can be excluded from the shell command set by |
---|
1615 | defining ``CONFIGURE_SHELL_NO_COMMAND_UNSETENV`` when all |
---|
1616 | shell commands have been configured. |
---|
1617 | |
---|
1618 | **PROGRAMMING INFORMATION:** |
---|
1619 | |
---|
1620 | .. index:: rtems_shell_rtems_main_unsetenv |
---|
1621 | |
---|
1622 | The ``unsetenv`` is implemented by a C language function |
---|
1623 | which has the following prototype: |
---|
1624 | .. code:: c |
---|
1625 | |
---|
1626 | int rtems_shell_rtems_main_unsetenv( |
---|
1627 | int argc, |
---|
1628 | char \**argv |
---|
1629 | ); |
---|
1630 | |
---|
1631 | The configuration structure for the ``unsetenv`` has the |
---|
1632 | following prototype: |
---|
1633 | .. code:: c |
---|
1634 | |
---|
1635 | extern rtems_shell_cmd_t rtems_shell_UNSETENV_Command; |
---|
1636 | |
---|
1637 | time - time command execution |
---|
1638 | ----------------------------- |
---|
1639 | .. index:: time |
---|
1640 | |
---|
1641 | **SYNOPSYS:** |
---|
1642 | |
---|
1643 | .. code:: c |
---|
1644 | |
---|
1645 | time command \[argument ...] |
---|
1646 | |
---|
1647 | **DESCRIPTION:** |
---|
1648 | |
---|
1649 | The time command executes and times a command. After the command |
---|
1650 | finishes, time writes the total time elapsed. Times are reported in |
---|
1651 | seconds. |
---|
1652 | |
---|
1653 | **EXIT STATUS:** |
---|
1654 | |
---|
1655 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1656 | |
---|
1657 | **NOTES:** |
---|
1658 | |
---|
1659 | None. |
---|
1660 | |
---|
1661 | **EXAMPLES:** |
---|
1662 | |
---|
1663 | The following is an example of how to use ``time``: |
---|
1664 | .. code:: c |
---|
1665 | |
---|
1666 | SHLL \[/] $ time cp -r /nfs/directory /c |
---|
1667 | |
---|
1668 | **CONFIGURATION:** |
---|
1669 | |
---|
1670 | .. index:: CONFIGURE_SHELL_NO_COMMAND_TIME |
---|
1671 | .. index:: CONFIGURE_SHELL_COMMAND_TIME |
---|
1672 | |
---|
1673 | This command is included in the default shell command set. When |
---|
1674 | building a custom command set, define``CONFIGURE_SHELL_COMMAND_TIME`` to have this command included. |
---|
1675 | |
---|
1676 | This command can be excluded from the shell command set by |
---|
1677 | defining ``CONFIGURE_SHELL_NO_COMMAND_TIME`` when all |
---|
1678 | shell commands have been configured. |
---|
1679 | |
---|
1680 | **PROGRAMMING INFORMATION:** |
---|
1681 | |
---|
1682 | .. index:: rtems_shell_rtems_main_time |
---|
1683 | |
---|
1684 | The ``time`` is implemented by a C language function |
---|
1685 | which has the following prototype: |
---|
1686 | .. code:: c |
---|
1687 | |
---|
1688 | int rtems_shell_rtems_main_time( |
---|
1689 | int argc, |
---|
1690 | char \**argv |
---|
1691 | ); |
---|
1692 | |
---|
1693 | The configuration structure for the ``time`` has the |
---|
1694 | following prototype: |
---|
1695 | .. code:: c |
---|
1696 | |
---|
1697 | extern rtems_shell_cmd_t rtems_shell_TIME_Command; |
---|
1698 | |
---|
1699 | .. _General-Commands-logoff-_002d-logoff-from-the-system: |
---|
1700 | |
---|
1701 | logoff - logoff from the system |
---|
1702 | ------------------------------- |
---|
1703 | .. index:: logoff |
---|
1704 | |
---|
1705 | **SYNOPSYS:** |
---|
1706 | |
---|
1707 | .. code:: c |
---|
1708 | |
---|
1709 | logoff |
---|
1710 | |
---|
1711 | **DESCRIPTION:** |
---|
1712 | |
---|
1713 | This command logs the user out of the shell. |
---|
1714 | |
---|
1715 | **EXIT STATUS:** |
---|
1716 | |
---|
1717 | This command does not return. |
---|
1718 | |
---|
1719 | **NOTES:** |
---|
1720 | |
---|
1721 | The system behavior when the shell is exited depends upon how the |
---|
1722 | shell was initiated. The typical behavior is that a login prompt |
---|
1723 | will be displayed for the next login attempt or that the connection |
---|
1724 | will be dropped by the RTEMS system. |
---|
1725 | |
---|
1726 | **EXAMPLES:** |
---|
1727 | |
---|
1728 | The following is an example of how to use ``logoff``: |
---|
1729 | .. code:: c |
---|
1730 | |
---|
1731 | SHLL \[/] $ logoff |
---|
1732 | logoff from the system... |
---|
1733 | |
---|
1734 | **CONFIGURATION:** |
---|
1735 | |
---|
1736 | .. index:: CONFIGURE_SHELL_NO_COMMAND_LOGOFF |
---|
1737 | .. index:: CONFIGURE_SHELL_COMMAND_LOGOFF |
---|
1738 | |
---|
1739 | This command is included in the default shell command set. |
---|
1740 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_LOGOFF`` to have this |
---|
1741 | command included. |
---|
1742 | |
---|
1743 | This command can be excluded from the shell command set by |
---|
1744 | defining ``CONFIGURE_SHELL_NO_COMMAND_LOGOFF`` when all |
---|
1745 | shell commands have been configured. |
---|
1746 | |
---|
1747 | **PROGRAMMING INFORMATION:** |
---|
1748 | |
---|
1749 | .. index:: rtems_shell_rtems_main_logoff |
---|
1750 | |
---|
1751 | The ``logoff`` is implemented by a C language function |
---|
1752 | which has the following prototype: |
---|
1753 | .. code:: c |
---|
1754 | |
---|
1755 | int rtems_shell_rtems_main_logoff( |
---|
1756 | int argc, |
---|
1757 | char \**argv |
---|
1758 | ); |
---|
1759 | |
---|
1760 | The configuration structure for the ``logoff`` has the |
---|
1761 | following prototype: |
---|
1762 | .. code:: c |
---|
1763 | |
---|
1764 | extern rtems_shell_cmd_t rtems_shell_LOGOFF_Command; |
---|
1765 | |
---|
1766 | rtc - RTC driver configuration |
---|
1767 | ------------------------------ |
---|
1768 | .. index:: rtc |
---|
1769 | |
---|
1770 | **SYNOPSYS:** |
---|
1771 | |
---|
1772 | .. code:: c |
---|
1773 | |
---|
1774 | rtc |
---|
1775 | |
---|
1776 | **CONFIGURATION:** |
---|
1777 | |
---|
1778 | .. index:: CONFIGURE_SHELL_NO_COMMAND_RTC |
---|
1779 | .. index:: CONFIGURE_SHELL_COMMAND_RTC |
---|
1780 | |
---|
1781 | This command is included in the default shell command set. |
---|
1782 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_RTC`` to have this |
---|
1783 | command included. |
---|
1784 | |
---|
1785 | This command can be excluded from the shell command set by |
---|
1786 | defining ``CONFIGURE_SHELL_NO_COMMAND_RTC`` when all |
---|
1787 | shell commands have been configured. |
---|
1788 | |
---|
1789 | exit - exit the shell |
---|
1790 | --------------------- |
---|
1791 | .. index:: exit |
---|
1792 | |
---|
1793 | **SYNOPSYS:** |
---|
1794 | |
---|
1795 | .. code:: c |
---|
1796 | |
---|
1797 | exit |
---|
1798 | |
---|
1799 | **DESCRIPTION:** |
---|
1800 | |
---|
1801 | This command causes the shell interpreter to ``exit``. |
---|
1802 | |
---|
1803 | **EXIT STATUS:** |
---|
1804 | |
---|
1805 | This command does not return. |
---|
1806 | |
---|
1807 | **NOTES:** |
---|
1808 | |
---|
1809 | In contrast to :ref:`logoff <General-Commands-logoff-_002d-logoff-from-the-system>`, |
---|
1810 | this command is built into the shell interpreter loop. |
---|
1811 | |
---|
1812 | **EXAMPLES:** |
---|
1813 | |
---|
1814 | The following is an example of how to use ``exit``: |
---|
1815 | .. code:: c |
---|
1816 | |
---|
1817 | SHLL \[/] $ exit |
---|
1818 | Shell exiting |
---|
1819 | |
---|
1820 | **CONFIGURATION:** |
---|
1821 | |
---|
1822 | This command is always present and cannot be disabled. |
---|
1823 | |
---|
1824 | **PROGRAMMING INFORMATION:** |
---|
1825 | |
---|
1826 | The ``exit`` is implemented directly in the shell interpreter. |
---|
1827 | There is no C routine associated with it. |
---|
1828 | |
---|
1829 | .. COMMENT: COPYRIGHT (c) 1988-2008. |
---|
1830 | |
---|
1831 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
1832 | |
---|
1833 | .. COMMENT: All rights reserved. |
---|
1834 | |
---|
1835 | File and Directory Commands |
---|
1836 | ########################### |
---|
1837 | |
---|
1838 | Introduction |
---|
1839 | ============ |
---|
1840 | |
---|
1841 | The RTEMS shell has the following file and directory commands: |
---|
1842 | |
---|
1843 | - ``blksync`` - sync the block driver |
---|
1844 | |
---|
1845 | - ``cat`` - display file contents |
---|
1846 | |
---|
1847 | - ``cd`` - alias for chdir |
---|
1848 | |
---|
1849 | - ``chdir`` - change the current directory |
---|
1850 | |
---|
1851 | - ``chmod`` - change permissions of a file |
---|
1852 | |
---|
1853 | - ``chroot`` - change the root directory |
---|
1854 | |
---|
1855 | - ``cp`` - copy files |
---|
1856 | |
---|
1857 | - ``dd`` - format disks |
---|
1858 | |
---|
1859 | - ``debugrfs`` - debug RFS file system |
---|
1860 | |
---|
1861 | - ``df`` - display file system disk space usage |
---|
1862 | |
---|
1863 | - ``dir`` - alias for ls |
---|
1864 | |
---|
1865 | - ``fdisk`` - format disks |
---|
1866 | |
---|
1867 | - ``hexdump`` - format disks |
---|
1868 | |
---|
1869 | - ``ln`` - make links |
---|
1870 | |
---|
1871 | - ``ls`` - list files in the directory |
---|
1872 | |
---|
1873 | - ``md5`` - display file system disk space usage |
---|
1874 | |
---|
1875 | - ``mkdir`` - create a directory |
---|
1876 | |
---|
1877 | - ``mkdos`` - DOSFS disk format |
---|
1878 | |
---|
1879 | - ``mknod`` - make device special file |
---|
1880 | |
---|
1881 | - ``mkrfs`` - format RFS file system |
---|
1882 | |
---|
1883 | - ``mount`` - mount disk |
---|
1884 | |
---|
1885 | - ``mv`` - move files |
---|
1886 | |
---|
1887 | - ``pwd`` - print work directory |
---|
1888 | |
---|
1889 | - ``rmdir`` - remove empty directories |
---|
1890 | |
---|
1891 | - ``rm`` - remove files |
---|
1892 | |
---|
1893 | - ``umask`` - Set file mode creation mask |
---|
1894 | |
---|
1895 | - ``unmount`` - unmount disk |
---|
1896 | |
---|
1897 | Commands |
---|
1898 | ======== |
---|
1899 | |
---|
1900 | This section details the File and Directory Commands available. A |
---|
1901 | subsection is dedicated to each of the commands and |
---|
1902 | describes the behavior and configuration of that |
---|
1903 | command as well as providing an example usage. |
---|
1904 | |
---|
1905 | blksync - sync the block driver |
---|
1906 | ------------------------------- |
---|
1907 | .. index:: blksync |
---|
1908 | |
---|
1909 | **SYNOPSYS:** |
---|
1910 | |
---|
1911 | .. code:: c |
---|
1912 | |
---|
1913 | blksync driver |
---|
1914 | |
---|
1915 | **DESCRIPTION:** |
---|
1916 | |
---|
1917 | This command XXX |
---|
1918 | |
---|
1919 | **EXIT STATUS:** |
---|
1920 | |
---|
1921 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1922 | |
---|
1923 | **NOTES:** |
---|
1924 | |
---|
1925 | NONE |
---|
1926 | |
---|
1927 | **EXAMPLES:** |
---|
1928 | |
---|
1929 | The following is an example of how to use ``blksync``: |
---|
1930 | .. code:: c |
---|
1931 | |
---|
1932 | EXAMPLE_TBD |
---|
1933 | |
---|
1934 | **CONFIGURATION:** |
---|
1935 | |
---|
1936 | .. index:: CONFIGURE_SHELL_NO_COMMAND_BLKSYNC |
---|
1937 | .. index:: CONFIGURE_SHELL_COMMAND_BLKSYNC |
---|
1938 | |
---|
1939 | This command is included in the default shell command set. |
---|
1940 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_BLKSYNC`` to have this |
---|
1941 | command included. |
---|
1942 | |
---|
1943 | This command can be excluded from the shell command set by |
---|
1944 | defining ``CONFIGURE_SHELL_NO_COMMAND_BLKSYNC`` when all |
---|
1945 | shell commands have been configured. |
---|
1946 | |
---|
1947 | **PROGRAMMING INFORMATION:** |
---|
1948 | |
---|
1949 | .. index:: rtems_shell_rtems_main_blksync |
---|
1950 | |
---|
1951 | The ``blksync`` is implemented by a C language function |
---|
1952 | which has the following prototype: |
---|
1953 | .. code:: c |
---|
1954 | |
---|
1955 | int rtems_shell_rtems_main_blksync( |
---|
1956 | int argc, |
---|
1957 | char \**argv |
---|
1958 | ); |
---|
1959 | |
---|
1960 | The configuration structure for the ``blksync`` has the |
---|
1961 | following prototype: |
---|
1962 | .. code:: c |
---|
1963 | |
---|
1964 | extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command; |
---|
1965 | |
---|
1966 | cat - display file contents |
---|
1967 | --------------------------- |
---|
1968 | .. index:: cat |
---|
1969 | |
---|
1970 | **SYNOPSYS:** |
---|
1971 | |
---|
1972 | .. code:: c |
---|
1973 | |
---|
1974 | cat file1 \[file2 .. fileN] |
---|
1975 | |
---|
1976 | **DESCRIPTION:** |
---|
1977 | |
---|
1978 | This command displays the contents of the specified files. |
---|
1979 | |
---|
1980 | **EXIT STATUS:** |
---|
1981 | |
---|
1982 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1983 | |
---|
1984 | **NOTES:** |
---|
1985 | |
---|
1986 | It is possible to read the input from a device file using ``cat``. |
---|
1987 | |
---|
1988 | **EXAMPLES:** |
---|
1989 | |
---|
1990 | The following is an example of how to use ``cat``: |
---|
1991 | .. code:: c |
---|
1992 | |
---|
1993 | SHLL \[/] # cat /etc/passwd |
---|
1994 | root:\*:0:0:root::/:/bin/sh |
---|
1995 | rtems:\*:1:1:RTEMS Application::/:/bin/sh |
---|
1996 | tty:!:2:2:tty owner::/:/bin/false |
---|
1997 | |
---|
1998 | **CONFIGURATION:** |
---|
1999 | |
---|
2000 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CAT |
---|
2001 | .. index:: CONFIGURE_SHELL_COMMAND_CAT |
---|
2002 | |
---|
2003 | This command is included in the default shell command set. |
---|
2004 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CAT`` to have this |
---|
2005 | command included. |
---|
2006 | |
---|
2007 | This command can be excluded from the shell command set by |
---|
2008 | defining ``CONFIGURE_SHELL_NO_COMMAND_CAT`` when all |
---|
2009 | shell commands have been configured. |
---|
2010 | |
---|
2011 | **PROGRAMMING INFORMATION:** |
---|
2012 | |
---|
2013 | .. index:: rtems_shell_rtems_main_cat |
---|
2014 | |
---|
2015 | The ``cat`` is implemented by a C language function |
---|
2016 | which has the following prototype: |
---|
2017 | .. code:: c |
---|
2018 | |
---|
2019 | int rtems_shell_rtems_main_cat( |
---|
2020 | int argc, |
---|
2021 | char \**argv |
---|
2022 | ); |
---|
2023 | |
---|
2024 | The configuration structure for the ``cat`` has the |
---|
2025 | following prototype: |
---|
2026 | .. code:: c |
---|
2027 | |
---|
2028 | extern rtems_shell_cmd_t rtems_shell_CAT_Command; |
---|
2029 | |
---|
2030 | cd - alias for chdir |
---|
2031 | -------------------- |
---|
2032 | .. index:: cd |
---|
2033 | |
---|
2034 | **SYNOPSYS:** |
---|
2035 | |
---|
2036 | .. code:: c |
---|
2037 | |
---|
2038 | cd directory |
---|
2039 | |
---|
2040 | **DESCRIPTION:** |
---|
2041 | |
---|
2042 | This command is an alias or alternate name for the ``chdir``. |
---|
2043 | See :ref:`cd <File-and-Directory-Commands-chdir-_002d-change-the-current-directory>` |
---|
2044 | for more information. |
---|
2045 | |
---|
2046 | **EXIT STATUS:** |
---|
2047 | |
---|
2048 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2049 | |
---|
2050 | **NOTES:** |
---|
2051 | |
---|
2052 | NONE |
---|
2053 | |
---|
2054 | **EXAMPLES:** |
---|
2055 | |
---|
2056 | The following is an example of how to use ``cd``: |
---|
2057 | .. code:: c |
---|
2058 | |
---|
2059 | SHLL \[/] $ cd etc |
---|
2060 | SHLL \[/etc] $ cd / |
---|
2061 | SHLL \[/] $ cd /etc |
---|
2062 | SHLL \[/etc] $ pwd |
---|
2063 | /etc |
---|
2064 | SHLL \[/etc] $ cd / |
---|
2065 | SHLL \[/] $ pwd |
---|
2066 | / |
---|
2067 | SHLL \[/] $ cd etc |
---|
2068 | SHLL \[/etc] $ cd .. |
---|
2069 | SHLL \[/] $ pwd |
---|
2070 | / |
---|
2071 | |
---|
2072 | **CONFIGURATION:** |
---|
2073 | |
---|
2074 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CD |
---|
2075 | .. index:: CONFIGURE_SHELL_COMMAND_CD |
---|
2076 | |
---|
2077 | This command is included in the default shell command set. |
---|
2078 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CD`` to have this |
---|
2079 | command included. |
---|
2080 | |
---|
2081 | This command can be excluded from the shell command set by |
---|
2082 | defining ``CONFIGURE_SHELL_NO_COMMAND_CD`` when all |
---|
2083 | shell commands have been configured. |
---|
2084 | |
---|
2085 | **PROGRAMMING INFORMATION:** |
---|
2086 | |
---|
2087 | .. index:: rtems_shell_rtems_main_cd |
---|
2088 | |
---|
2089 | The ``cd`` is implemented by a C language function |
---|
2090 | which has the following prototype: |
---|
2091 | .. code:: c |
---|
2092 | |
---|
2093 | int rtems_shell_rtems_main_cd( |
---|
2094 | int argc, |
---|
2095 | char \**argv |
---|
2096 | ); |
---|
2097 | |
---|
2098 | The configuration structure for the ``cd`` has the |
---|
2099 | following prototype: |
---|
2100 | .. code:: c |
---|
2101 | |
---|
2102 | extern rtems_shell_cmd_t rtems_shell_CD_Command; |
---|
2103 | |
---|
2104 | .. _File-and-Directory-Commands-chdir-_002d-change-the-current-directory: |
---|
2105 | |
---|
2106 | chdir - change the current directory |
---|
2107 | ------------------------------------ |
---|
2108 | .. index:: chdir |
---|
2109 | |
---|
2110 | **SYNOPSYS:** |
---|
2111 | |
---|
2112 | .. code:: c |
---|
2113 | |
---|
2114 | chdir \[dir] |
---|
2115 | |
---|
2116 | **DESCRIPTION:** |
---|
2117 | |
---|
2118 | This command is used to change the current working directory to |
---|
2119 | the specified directory. If no arguments are given, the current |
---|
2120 | working directory will be changed to ``/``. |
---|
2121 | |
---|
2122 | **EXIT STATUS:** |
---|
2123 | |
---|
2124 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2125 | |
---|
2126 | **NOTES:** |
---|
2127 | |
---|
2128 | NONE |
---|
2129 | |
---|
2130 | **EXAMPLES:** |
---|
2131 | |
---|
2132 | The following is an example of how to use ``chdir``: |
---|
2133 | .. code:: c |
---|
2134 | |
---|
2135 | SHLL \[/] $ pwd |
---|
2136 | / |
---|
2137 | SHLL \[/] $ chdir etc |
---|
2138 | SHLL \[/etc] $ pwd |
---|
2139 | /etc |
---|
2140 | |
---|
2141 | **CONFIGURATION:** |
---|
2142 | |
---|
2143 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CHDIR |
---|
2144 | .. index:: CONFIGURE_SHELL_COMMAND_CHDIR |
---|
2145 | |
---|
2146 | This command is included in the default shell command set. |
---|
2147 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CHDIR`` to have this |
---|
2148 | command included. |
---|
2149 | |
---|
2150 | This command can be excluded from the shell command set by |
---|
2151 | defining ``CONFIGURE_SHELL_NO_COMMAND_CHDIR`` when all |
---|
2152 | shell commands have been configured. |
---|
2153 | |
---|
2154 | **PROGRAMMING INFORMATION:** |
---|
2155 | |
---|
2156 | .. index:: rtems_shell_rtems_main_chdir |
---|
2157 | |
---|
2158 | The ``chdir`` is implemented by a C language function |
---|
2159 | which has the following prototype: |
---|
2160 | .. code:: c |
---|
2161 | |
---|
2162 | int rtems_shell_rtems_main_chdir( |
---|
2163 | int argc, |
---|
2164 | char \**argv |
---|
2165 | ); |
---|
2166 | |
---|
2167 | The configuration structure for the ``chdir`` has the |
---|
2168 | following prototype: |
---|
2169 | .. code:: c |
---|
2170 | |
---|
2171 | extern rtems_shell_cmd_t rtems_shell_CHDIR_Command; |
---|
2172 | |
---|
2173 | chmod - change permissions of a file |
---|
2174 | ------------------------------------ |
---|
2175 | .. index:: chmod |
---|
2176 | |
---|
2177 | **SYNOPSYS:** |
---|
2178 | |
---|
2179 | .. code:: c |
---|
2180 | |
---|
2181 | chmod permissions file1 \[file2...] |
---|
2182 | |
---|
2183 | **DESCRIPTION:** |
---|
2184 | |
---|
2185 | This command changes the permissions on the files specified to the |
---|
2186 | indicated ``permissions``. The permission values are POSIX based |
---|
2187 | with owner, group, and world having individual read, write, and |
---|
2188 | executive permission bits. |
---|
2189 | |
---|
2190 | **EXIT STATUS:** |
---|
2191 | |
---|
2192 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2193 | |
---|
2194 | **NOTES:** |
---|
2195 | |
---|
2196 | The ``chmod`` command only takes numeric representations of |
---|
2197 | the permissions. |
---|
2198 | |
---|
2199 | **EXAMPLES:** |
---|
2200 | |
---|
2201 | The following is an example of how to use ``chmod``: |
---|
2202 | .. code:: c |
---|
2203 | |
---|
2204 | SHLL \[/] # cd etc |
---|
2205 | SHLL \[/etc] # ls |
---|
2206 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
2207 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
2208 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
2209 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
2210 | 4 files 202 bytes occupied |
---|
2211 | SHLL \[/etc] # chmod 0777 passwd |
---|
2212 | SHLL \[/etc] # ls |
---|
2213 | -rwxrwxrwx 1 root root 102 Jan 01 00:00 passwd |
---|
2214 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
2215 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
2216 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
2217 | 4 files 202 bytes occupied |
---|
2218 | SHLL \[/etc] # chmod 0322 passwd |
---|
2219 | SHLL \[/etc] # ls |
---|
2220 | --wx-w--w- 1 nouser root 102 Jan 01 00:00 passwd |
---|
2221 | -rw-r--r-- 1 nouser root 42 Jan 01 00:00 group |
---|
2222 | -rw-r--r-- 1 nouser root 30 Jan 01 00:00 issue |
---|
2223 | -rw-r--r-- 1 nouser root 28 Jan 01 00:00 issue.net |
---|
2224 | 4 files 202 bytes occupied |
---|
2225 | SHLL \[/etc] # chmod 0644 passwd |
---|
2226 | SHLL \[/etc] # ls |
---|
2227 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
2228 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
2229 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
2230 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
2231 | 4 files 202 bytes occupied |
---|
2232 | |
---|
2233 | **CONFIGURATION:** |
---|
2234 | |
---|
2235 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CHMOD |
---|
2236 | .. index:: CONFIGURE_SHELL_COMMAND_CHMOD |
---|
2237 | |
---|
2238 | This command is included in the default shell command set. |
---|
2239 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CHMOD`` to have this |
---|
2240 | command included. |
---|
2241 | |
---|
2242 | This command can be excluded from the shell command set by |
---|
2243 | defining ``CONFIGURE_SHELL_NO_COMMAND_CHMOD`` when all |
---|
2244 | shell commands have been configured. |
---|
2245 | |
---|
2246 | **PROGRAMMING INFORMATION:** |
---|
2247 | |
---|
2248 | .. index:: rtems_shell_rtems_main_chmod |
---|
2249 | |
---|
2250 | The ``chmod`` is implemented by a C language function |
---|
2251 | which has the following prototype: |
---|
2252 | .. code:: c |
---|
2253 | |
---|
2254 | int rtems_shell_rtems_main_chmod( |
---|
2255 | int argc, |
---|
2256 | char \**argv |
---|
2257 | ); |
---|
2258 | |
---|
2259 | The configuration structure for the ``chmod`` has the |
---|
2260 | following prototype: |
---|
2261 | .. code:: c |
---|
2262 | |
---|
2263 | extern rtems_shell_cmd_t rtems_shell_CHMOD_Command; |
---|
2264 | |
---|
2265 | chroot - change the root directory |
---|
2266 | ---------------------------------- |
---|
2267 | .. index:: chroot |
---|
2268 | |
---|
2269 | **SYNOPSYS:** |
---|
2270 | |
---|
2271 | .. code:: c |
---|
2272 | |
---|
2273 | chroot \[dir] |
---|
2274 | |
---|
2275 | **DESCRIPTION:** |
---|
2276 | |
---|
2277 | This command changes the root directory to ``dir`` for subsequent |
---|
2278 | commands. |
---|
2279 | |
---|
2280 | **EXIT STATUS:** |
---|
2281 | |
---|
2282 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2283 | |
---|
2284 | The destination directory ``dir`` must exist. |
---|
2285 | |
---|
2286 | **NOTES:** |
---|
2287 | |
---|
2288 | NONE |
---|
2289 | |
---|
2290 | **EXAMPLES:** |
---|
2291 | |
---|
2292 | The following is an example of how to use ``chroot`` |
---|
2293 | and the impact it has on the environment for subsequent |
---|
2294 | command invocations: |
---|
2295 | .. code:: c |
---|
2296 | |
---|
2297 | SHLL \[/] $ cat passwd |
---|
2298 | cat: passwd: No such file or directory |
---|
2299 | SHLL \[/] $ chroot etc |
---|
2300 | SHLL \[/] $ cat passwd |
---|
2301 | root:\*:0:0:root::/:/bin/sh |
---|
2302 | rtems:\*:1:1:RTEMS Application::/:/bin/sh |
---|
2303 | tty:!:2:2:tty owner::/:/bin/false |
---|
2304 | SHLL \[/] $ cat /etc/passwd |
---|
2305 | cat: /etc/passwd: No such file or directory |
---|
2306 | |
---|
2307 | **CONFIGURATION:** |
---|
2308 | |
---|
2309 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CHROOT |
---|
2310 | .. index:: CONFIGURE_SHELL_COMMAND_CHROOT |
---|
2311 | |
---|
2312 | This command is included in the default shell command set. |
---|
2313 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CHROOT`` to have this |
---|
2314 | command included. Additional to that you have to add one |
---|
2315 | POSIX key value pair for each thread where you want to use |
---|
2316 | the command. |
---|
2317 | |
---|
2318 | This command can be excluded from the shell command set by |
---|
2319 | defining ``CONFIGURE_SHELL_NO_COMMAND_CHROOT`` when all |
---|
2320 | shell commands have been configured. |
---|
2321 | |
---|
2322 | **PROGRAMMING INFORMATION:** |
---|
2323 | |
---|
2324 | .. index:: rtems_shell_rtems_main_chroot |
---|
2325 | |
---|
2326 | The ``chroot`` is implemented by a C language function |
---|
2327 | which has the following prototype: |
---|
2328 | .. code:: c |
---|
2329 | |
---|
2330 | int rtems_shell_rtems_main_chroot( |
---|
2331 | int argc, |
---|
2332 | char \**argv |
---|
2333 | ); |
---|
2334 | |
---|
2335 | The configuration structure for the ``chroot`` has the |
---|
2336 | following prototype: |
---|
2337 | .. code:: c |
---|
2338 | |
---|
2339 | extern rtems_shell_cmd_t rtems_shell_CHROOT_Command; |
---|
2340 | |
---|
2341 | cp - copy files |
---|
2342 | --------------- |
---|
2343 | .. index:: cp |
---|
2344 | |
---|
2345 | **SYNOPSYS:** |
---|
2346 | |
---|
2347 | .. code:: c |
---|
2348 | |
---|
2349 | cp \[-R \[-H | -L | -P]] \[-f | -i] \[-pv] src target |
---|
2350 | cp \[-R \[-H | -L] ] \[-f | -i] \[-NpPv] source_file ... target_directory |
---|
2351 | |
---|
2352 | **DESCRIPTION:** |
---|
2353 | |
---|
2354 | In the first synopsis form, the cp utility copies the contents of the |
---|
2355 | source_file to the target_file. In the second synopsis form, the contents of |
---|
2356 | each named source_file is copied to the destination target_directory. The names |
---|
2357 | of the files themselves are not changed. If cp detects an attempt to copy a |
---|
2358 | file to itself, the copy will fail. |
---|
2359 | |
---|
2360 | The following options are available: |
---|
2361 | |
---|
2362 | *-f* |
---|
2363 | For each existing destination pathname, attempt to overwrite it. If permissions |
---|
2364 | do not allow copy to succeed, remove it and create a new file, without |
---|
2365 | prompting for confirmation. (The -i option is ignored if the -f option is |
---|
2366 | specified.) |
---|
2367 | |
---|
2368 | *-H* |
---|
2369 | If the -R option is specified, symbolic links on the command line are followed. |
---|
2370 | (Symbolic links encountered in the tree traversal are not followed.) |
---|
2371 | |
---|
2372 | *-i* |
---|
2373 | Causes cp to write a prompt to the standard error output before copying a file |
---|
2374 | that would overwrite an existing file. If the response from the standard input |
---|
2375 | begins with the character âyâ, the file copy is attempted. |
---|
2376 | |
---|
2377 | *-L* |
---|
2378 | If the -R option is specified, all symbolic links are followed. |
---|
2379 | |
---|
2380 | *-N* |
---|
2381 | When used with -p, do not copy file flags. |
---|
2382 | |
---|
2383 | *-P* |
---|
2384 | No symbolic links are followed. |
---|
2385 | |
---|
2386 | *-p* |
---|
2387 | Causes cp to preserve in the copy as many of the modification time, access |
---|
2388 | time, file flags, file mode, user ID, and group ID as allowed by permissions. |
---|
2389 | If the user ID and group ID cannot be preserved, no error message is displayed |
---|
2390 | and the exit value is not altered. |
---|
2391 | If the source file has its set user ID bit on and the user ID cannot be |
---|
2392 | preserved, the set user ID bit is not preserved in the copyâs permissions. If |
---|
2393 | the source file has its set group ID bit on and the group ID cannot be |
---|
2394 | preserved, the set group ID bit is not preserved in the copyâs permissions. If |
---|
2395 | the source file has both its set user ID and set group ID bits on, and either |
---|
2396 | the user ID or group ID cannot be preserved, neither the set user ID or set |
---|
2397 | group ID bits are preserved in the copyâs permissions. |
---|
2398 | |
---|
2399 | *-R* |
---|
2400 | If source_file designates a directory, cp copies the directory and the entire |
---|
2401 | subtree connected at that point. This option also causes symbolic links to be |
---|
2402 | copied, rather than indirected through, and for cp to create special files |
---|
2403 | rather than copying them as normal files. Created directories have the same |
---|
2404 | mode as the corresponding source directory, unmodified by the processâs umask. |
---|
2405 | |
---|
2406 | *-v* |
---|
2407 | Cause cp to be verbose, showing files as they are copied. |
---|
2408 | |
---|
2409 | For each destination file that already exists, its contents are overwritten if |
---|
2410 | permissions allow, but its mode, user ID, and group ID are unchanged. |
---|
2411 | |
---|
2412 | In the second synopsis form, target_directory must exist unless there is only |
---|
2413 | one named source_file which is a directory and the -R flag is specified. |
---|
2414 | |
---|
2415 | If the destination file does not exist, the mode of the source file is used as |
---|
2416 | modified by the file mode creation mask (umask, see csh(1)). If the source file |
---|
2417 | has its set user ID bit on, that bit is removed unless both the source file and |
---|
2418 | the destination file are owned by the same user. If the source file has its set |
---|
2419 | group ID bit on, that bit is removed unless both the source file and the |
---|
2420 | destination file are in the same group and the user is a member of that group. |
---|
2421 | If both the set user ID and set group ID bits are set, all of the above |
---|
2422 | conditions must be fulfilled or both bits are removed. |
---|
2423 | |
---|
2424 | Appropriate permissions are required for file creation or overwriting. |
---|
2425 | |
---|
2426 | Symbolic links are always followed unless the -R flag is set, in which case |
---|
2427 | symbolic links are not followed, by default. The -H or -L flags (in conjunction |
---|
2428 | with the -R flag), as well as the -P flag cause symbolic links to be followed |
---|
2429 | as described above. The -H and -L options are ignored unless the -R option is |
---|
2430 | specified. In addition, these options override eachsubhedading other and the |
---|
2431 | commandâs actions are determined by the last one specified. |
---|
2432 | |
---|
2433 | **EXIT STATUS:** |
---|
2434 | |
---|
2435 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2436 | |
---|
2437 | **NOTES:** |
---|
2438 | |
---|
2439 | NONE |
---|
2440 | |
---|
2441 | **EXAMPLES:** |
---|
2442 | |
---|
2443 | The following is an example of how to use ``cp`` to |
---|
2444 | copy a file to a new name in the current directory: |
---|
2445 | .. code:: c |
---|
2446 | |
---|
2447 | SHLL \[/] # cat joel |
---|
2448 | cat: joel: No such file or directory |
---|
2449 | SHLL \[/] # cp etc/passwd joel |
---|
2450 | SHLL \[/] # cat joel |
---|
2451 | root:\*:0:0:root::/:/bin/sh |
---|
2452 | rtems:\*:1:1:RTEMS Application::/:/bin/sh |
---|
2453 | tty:!:2:2:tty owner::/:/bin/false |
---|
2454 | SHLL \[/] # ls |
---|
2455 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
2456 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
2457 | -rw-r--r-- 1 root root 102 Jan 01 00:00 joel |
---|
2458 | 3 files 1710 bytes occupied |
---|
2459 | |
---|
2460 | The following is an example of how to use ``cp`` to |
---|
2461 | copy one or more files to a destination directory and |
---|
2462 | use the same ``basename`` in the destination directory: |
---|
2463 | .. code:: c |
---|
2464 | |
---|
2465 | SHLL \[/] # mkdir tmp |
---|
2466 | SHLL \[/] # ls tmp |
---|
2467 | 0 files 0 bytes occupied |
---|
2468 | SHLL \[/] # cp /etc/passwd tmp |
---|
2469 | SHLL \[/] # ls /tmp |
---|
2470 | -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd |
---|
2471 | 1 files 102 bytes occupied |
---|
2472 | SHLL \[/] # cp /etc/passwd /etc/group /tmp |
---|
2473 | SHLL \[/] # ls /tmp |
---|
2474 | -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd |
---|
2475 | -rw-r--r-- 1 root root 42 Jan 01 00:01 group |
---|
2476 | 2 files 144 bytes occupied |
---|
2477 | SHLL \[/] # |
---|
2478 | |
---|
2479 | **CONFIGURATION:** |
---|
2480 | |
---|
2481 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CP |
---|
2482 | .. index:: CONFIGURE_SHELL_COMMAND_CP |
---|
2483 | |
---|
2484 | This command is included in the default shell command set. |
---|
2485 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CP`` to have this |
---|
2486 | command included. |
---|
2487 | |
---|
2488 | This command can be excluded from the shell command set by |
---|
2489 | defining ``CONFIGURE_SHELL_NO_COMMAND_CP`` when all |
---|
2490 | shell commands have been configured. |
---|
2491 | |
---|
2492 | **PROGRAMMING INFORMATION:** |
---|
2493 | |
---|
2494 | .. index:: rtems_shell_main_cp |
---|
2495 | |
---|
2496 | The ``cp`` command is implemented by a C language function which |
---|
2497 | has the following prototype: |
---|
2498 | .. code:: c |
---|
2499 | |
---|
2500 | int rtems_shell_main_cp( |
---|
2501 | int argc, |
---|
2502 | char \**argv |
---|
2503 | ); |
---|
2504 | |
---|
2505 | The configuration structure for the ``cp`` has the |
---|
2506 | following prototype: |
---|
2507 | .. code:: c |
---|
2508 | |
---|
2509 | extern rtems_shell_cmd_t rtems_shell_CP_Command; |
---|
2510 | |
---|
2511 | **ORIGIN:** |
---|
2512 | |
---|
2513 | The implementation and portions of the documentation for this |
---|
2514 | command are from NetBSD 4.0. |
---|
2515 | |
---|
2516 | dd - convert and copy a file |
---|
2517 | ---------------------------- |
---|
2518 | .. index:: dd |
---|
2519 | |
---|
2520 | **SYNOPSYS:** |
---|
2521 | |
---|
2522 | .. code:: c |
---|
2523 | |
---|
2524 | dd \[operands ...] |
---|
2525 | |
---|
2526 | **DESCRIPTION:** |
---|
2527 | |
---|
2528 | The dd utility copies the standard input to the standard output. |
---|
2529 | Input data is read and written in 512-byte blocks. If input reads are |
---|
2530 | short, input from multiple reads are aggregated to form the output |
---|
2531 | block. When finished, dd displays the number of complete and partial |
---|
2532 | input and output blocks and truncated input records to the standard |
---|
2533 | error output. |
---|
2534 | |
---|
2535 | The following operands are available: |
---|
2536 | |
---|
2537 | *bs=n* |
---|
2538 | Set both input and output block size, superseding the ibs and obs |
---|
2539 | operands. If no conversion values other than noerror, notrunc or sync |
---|
2540 | are specified, then each input block is copied to the output as a |
---|
2541 | single block without any aggregation of short blocks. |
---|
2542 | |
---|
2543 | *cbs=n* |
---|
2544 | Set the conversion record size to n bytes. The conversion record size |
---|
2545 | is required by the record oriented conversion values. |
---|
2546 | |
---|
2547 | *count=n* |
---|
2548 | Copy only n input blocks. |
---|
2549 | |
---|
2550 | *files=n* |
---|
2551 | Copy n input files before terminating. This operand is only |
---|
2552 | applicable when the input device is a tape. |
---|
2553 | |
---|
2554 | *ibs=n* |
---|
2555 | Set the input block size to n bytes instead of the default 512. |
---|
2556 | |
---|
2557 | *if=file* |
---|
2558 | Read input from file instead of the standard input. |
---|
2559 | |
---|
2560 | *obs=n* |
---|
2561 | Set the output block size to n bytes instead of the default 512. |
---|
2562 | |
---|
2563 | *of=file* |
---|
2564 | Write output to file instead of the standard output. Any regular |
---|
2565 | output file is truncated unless the notrunc conversion value is |
---|
2566 | specified. If an initial portion of the output file is skipped (see |
---|
2567 | the seek operand) the output file is truncated at that point. |
---|
2568 | |
---|
2569 | *seek=n* |
---|
2570 | Seek n blocks from the beginning of the output before copying. On |
---|
2571 | non-tape devices, a *lseek* operation is used. Otherwise, existing |
---|
2572 | blocks are read and the data discarded. If the seek operation is past |
---|
2573 | the end of file, space from the current end of file to the specified |
---|
2574 | offset is filled with blocks of NUL bytes. |
---|
2575 | |
---|
2576 | *skip=n* |
---|
2577 | Skip n blocks from the beginning of the input before copying. On |
---|
2578 | input which supports seeks, a *lseek* operation is used. Otherwise, |
---|
2579 | input data is read and discarded. For pipes, the correct number of |
---|
2580 | bytes is read. For all other devices, the correct number of blocks is |
---|
2581 | read without distinguishing between a partial or complete block being |
---|
2582 | read. |
---|
2583 | |
---|
2584 | *progress=n* |
---|
2585 | Switch on display of progress if n is set to any non-zero value. This |
---|
2586 | will cause a â.â to be printed (to the standard error output) for |
---|
2587 | every n full or partial blocks written to the output file. |
---|
2588 | |
---|
2589 | *conv=value[,value...]* |
---|
2590 | Where value is one of the symbols from the following list. |
---|
2591 | |
---|
2592 | *ascii, oldascii* |
---|
2593 | |
---|
2594 | The same as the unblock value except that characters are translated |
---|
2595 | from EBCDIC to ASCII before the records are converted. (These values |
---|
2596 | imply unblock if the operand cbs is also specified.) There are two |
---|
2597 | conversion maps for ASCII. The value ascii specifies the recom- |
---|
2598 | mended one which is compatible with AT&T System V UNIX. The value |
---|
2599 | oldascii specifies the one used in historic AT&T and pre 4.3BSD-Reno |
---|
2600 | systems. |
---|
2601 | |
---|
2602 | *block* |
---|
2603 | |
---|
2604 | Treats the input as a sequence of newline or end-of-file terminated |
---|
2605 | variable length records independent of input and output block |
---|
2606 | boundaries. Any trailing newline character is discarded. Each |
---|
2607 | input record is converted to a fixed length output record where the |
---|
2608 | length is specified by the cbs operand. Input records shorter than |
---|
2609 | the conversion record size are padded with spaces. Input records |
---|
2610 | longer than the conversion record size are truncated. The number of |
---|
2611 | truncated input records, if any, are reported to the standard error |
---|
2612 | output at the completion of the copy. |
---|
2613 | |
---|
2614 | *ebcdic, ibm, oldebcdic, oldibm* |
---|
2615 | |
---|
2616 | The same as the block value except that characters are translated from |
---|
2617 | ASCII to EBCDIC after the records are converted. (These values imply |
---|
2618 | block if the operand cbs is also specified.) There are four |
---|
2619 | conversion maps for EBCDIC. The value ebcdic specifies the |
---|
2620 | recommended one which is compatible with AT&T System V UNIX. The |
---|
2621 | value ibm is a slightly different mapping, which is compatible with |
---|
2622 | the AT&T System V UNIX ibm value. The values oldebcdic and oldibm are |
---|
2623 | maps used in historic AT&T and pre 4.3BSD-Reno systems. |
---|
2624 | |
---|
2625 | *lcase* |
---|
2626 | |
---|
2627 | Transform uppercase characters into lowercase characters. |
---|
2628 | |
---|
2629 | *noerror* |
---|
2630 | |
---|
2631 | Do not stop processing on an input error. When an input error occurs, |
---|
2632 | a diagnostic message followed by the current input and output block |
---|
2633 | counts will be written to the standard error output in the same format |
---|
2634 | as the standard completion message. If the sync conversion is also |
---|
2635 | specified, any missing input data will be replaced with NUL bytes (or |
---|
2636 | with spaces if a block oriented conversion value was specified) and |
---|
2637 | processed as a normal input buffer. If the sync conversion is not |
---|
2638 | specified, the input block is omitted from the output. On input files |
---|
2639 | which are not tapes or pipes, the file offset will be positioned past |
---|
2640 | the block in which the error occurred using lseek(2). |
---|
2641 | |
---|
2642 | *notrunc* |
---|
2643 | |
---|
2644 | Do not truncate the output file. This will preserve any blocks in the |
---|
2645 | output file not explicitly written by dd. The notrunc value is not |
---|
2646 | supported for tapes. |
---|
2647 | |
---|
2648 | *osync* |
---|
2649 | |
---|
2650 | Pad the final output block to the full output block size. If the |
---|
2651 | input file is not a multiple of the output block size after |
---|
2652 | conversion, this conversion forces the final output block to be the |
---|
2653 | same size as preceding blocks for use on devices that require |
---|
2654 | regularly sized blocks to be written. This option is incompatible |
---|
2655 | with use of the bs=n block size specification. |
---|
2656 | |
---|
2657 | *sparse* |
---|
2658 | |
---|
2659 | If one or more non-final output blocks would consist solely of NUL |
---|
2660 | bytes, try to seek the output file by the required space instead of |
---|
2661 | filling them with NULs. This results in a sparse file on some file |
---|
2662 | systems. |
---|
2663 | |
---|
2664 | *swab* |
---|
2665 | |
---|
2666 | Swap every pair of input bytes. If an input buffer has an odd number |
---|
2667 | of bytes, the last byte will be ignored during swapping. |
---|
2668 | |
---|
2669 | *sync* |
---|
2670 | |
---|
2671 | Pad every input block to the input buffer size. Spaces are used for |
---|
2672 | pad bytes if a block oriented conversion value is specified, otherwise |
---|
2673 | NUL bytes are used. |
---|
2674 | |
---|
2675 | *ucase* |
---|
2676 | |
---|
2677 | Transform lowercase characters into uppercase characters. |
---|
2678 | |
---|
2679 | *unblock* |
---|
2680 | |
---|
2681 | Treats the input as a sequence of fixed length records independent of |
---|
2682 | input and output block boundaries. The length of the input records is |
---|
2683 | specified by the cbs operand. Any trailing space characters are |
---|
2684 | discarded and a newline character is appended. |
---|
2685 | |
---|
2686 | Where sizes are specified, a decimal number of bytes is expected. Two |
---|
2687 | or more numbers may be separated by an âxâ to indicate a product. |
---|
2688 | Each number may have one of the following optional suffixes: |
---|
2689 | |
---|
2690 | *b* |
---|
2691 | Block; multiply by 512 |
---|
2692 | |
---|
2693 | *k* |
---|
2694 | Kibi; multiply by 1024 (1 KiB) |
---|
2695 | |
---|
2696 | *m* |
---|
2697 | Mebi; multiply by 1048576 (1 MiB) |
---|
2698 | |
---|
2699 | *g* |
---|
2700 | Gibi; multiply by 1073741824 (1 GiB) |
---|
2701 | |
---|
2702 | *t* |
---|
2703 | Tebi; multiply by 1099511627776 (1 TiB) |
---|
2704 | |
---|
2705 | *w* |
---|
2706 | Word; multiply by the number of bytes in an integer |
---|
2707 | |
---|
2708 | When finished, dd displays the number of complete and partial input |
---|
2709 | and output blocks, truncated input records and odd-length |
---|
2710 | byte-swapping ritten. Partial output blocks to tape devices are |
---|
2711 | considered fatal errors. Otherwise, the rest of the block will be |
---|
2712 | written. Partial output blocks to character devices will produce a |
---|
2713 | warning message. A truncated input block is one where a variable |
---|
2714 | length record oriented conversion value was specified and the input |
---|
2715 | line was too long to fit in the conversion record or was not newline |
---|
2716 | terminated. |
---|
2717 | |
---|
2718 | Normally, data resulting from input or conversion or both are |
---|
2719 | aggregated into output blocks of the specified size. After the end of |
---|
2720 | input is reached, any remaining output is written as a block. This |
---|
2721 | means that the final output block may be shorter than the output block |
---|
2722 | size. |
---|
2723 | |
---|
2724 | **EXIT STATUS:** |
---|
2725 | |
---|
2726 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2727 | |
---|
2728 | **NOTES:** |
---|
2729 | |
---|
2730 | NONE |
---|
2731 | |
---|
2732 | **EXAMPLES:** |
---|
2733 | |
---|
2734 | The following is an example of how to use ``dd``: |
---|
2735 | .. code:: c |
---|
2736 | |
---|
2737 | SHLL \[/] $ dd if=/nfs/boot-image of=/dev/hda1 |
---|
2738 | |
---|
2739 | **CONFIGURATION:** |
---|
2740 | |
---|
2741 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DD |
---|
2742 | .. index:: CONFIGURE_SHELL_COMMAND_DD |
---|
2743 | |
---|
2744 | This command is included in the default shell command set. When |
---|
2745 | building a custom command set, define``CONFIGURE_SHELL_COMMAND_DD`` to have this command included. |
---|
2746 | |
---|
2747 | This command can be excluded from the shell command set by defining``CONFIGURE_SHELL_NO_COMMAND_DD`` when all shell commands have been |
---|
2748 | configured. |
---|
2749 | |
---|
2750 | **PROGRAMMING INFORMATION:** |
---|
2751 | |
---|
2752 | .. index:: rtems_shell_rtems_main_dd |
---|
2753 | |
---|
2754 | The ``dd`` command is implemented by a C language function which |
---|
2755 | has the following prototype: |
---|
2756 | .. code:: c |
---|
2757 | |
---|
2758 | int rtems_shell_rtems_main_dd( |
---|
2759 | int argc, |
---|
2760 | char \**argv |
---|
2761 | ); |
---|
2762 | |
---|
2763 | The configuration structure for the ``dd`` has the following |
---|
2764 | prototype: |
---|
2765 | .. code:: c |
---|
2766 | |
---|
2767 | extern rtems_shell_cmd_t rtems_shell_DD_Command; |
---|
2768 | |
---|
2769 | debugrfs - debug RFS file system |
---|
2770 | -------------------------------- |
---|
2771 | .. index:: debugrfs |
---|
2772 | |
---|
2773 | **SYNOPSYS:** |
---|
2774 | |
---|
2775 | .. code:: c |
---|
2776 | |
---|
2777 | debugrfs \[-hl] path command \[options] |
---|
2778 | |
---|
2779 | **DESCRIPTION:** |
---|
2780 | |
---|
2781 | The command provides debugging information for the RFS file system. |
---|
2782 | |
---|
2783 | The options are: |
---|
2784 | |
---|
2785 | *-h* |
---|
2786 | Print a help message. |
---|
2787 | |
---|
2788 | *-l* |
---|
2789 | List the commands. |
---|
2790 | |
---|
2791 | *path* |
---|
2792 | Path to the mounted RFS file system. The file system has to be mounted |
---|
2793 | to view to use this command. |
---|
2794 | |
---|
2795 | The commands are: |
---|
2796 | |
---|
2797 | *block start \[end]* |
---|
2798 | Display the contents of the blocks from start to end. |
---|
2799 | |
---|
2800 | *data* |
---|
2801 | Display the file system data and configuration. |
---|
2802 | |
---|
2803 | *dir bno* |
---|
2804 | Process the block as a directory displaying the entries. |
---|
2805 | |
---|
2806 | *group start \[end]* |
---|
2807 | Display the group data from the start group to the end group. |
---|
2808 | |
---|
2809 | *inode \[-aef] \[start] \[end]* |
---|
2810 | |
---|
2811 | Display the inodes between start and end. If no start and end is |
---|
2812 | provides all inodes are displayed. |
---|
2813 | |
---|
2814 | *-a* |
---|
2815 | |
---|
2816 | Display all inodes. That is allocated and unallocated inodes. |
---|
2817 | |
---|
2818 | *-e* |
---|
2819 | |
---|
2820 | Search and display on inodes that have an error. |
---|
2821 | |
---|
2822 | *-f* |
---|
2823 | |
---|
2824 | Force display of inodes, even when in error. |
---|
2825 | |
---|
2826 | **EXIT STATUS:** |
---|
2827 | |
---|
2828 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2829 | |
---|
2830 | **NOTES:** |
---|
2831 | |
---|
2832 | NONE |
---|
2833 | |
---|
2834 | **EXAMPLES:** |
---|
2835 | |
---|
2836 | The following is an example of how to use ``debugrfs``: |
---|
2837 | .. code:: c |
---|
2838 | |
---|
2839 | SHLL \[/] $ debugrfs /c data |
---|
2840 | |
---|
2841 | **CONFIGURATION:** |
---|
2842 | |
---|
2843 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS |
---|
2844 | .. index:: CONFIGURE_SHELL_COMMAND_DEBUGRFS |
---|
2845 | |
---|
2846 | This command is included in the default shell command set. |
---|
2847 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DEBUGRFS`` to have this |
---|
2848 | command included. |
---|
2849 | |
---|
2850 | This command can be excluded from the shell command set by |
---|
2851 | defining ``CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS`` when all |
---|
2852 | shell commands have been configured. |
---|
2853 | |
---|
2854 | **PROGRAMMING INFORMATION:** |
---|
2855 | |
---|
2856 | .. index:: rtems_shell_rtems_main_debugrfs |
---|
2857 | |
---|
2858 | The ``debugrfs`` command is implemented by a C language function which |
---|
2859 | has the following prototype: |
---|
2860 | .. code:: c |
---|
2861 | |
---|
2862 | int rtems_shell_rtems_main_debugrfs( |
---|
2863 | int argc, |
---|
2864 | char \**argv |
---|
2865 | ); |
---|
2866 | |
---|
2867 | The configuration structure for ``debugrfs`` has the following |
---|
2868 | prototype: |
---|
2869 | .. code:: c |
---|
2870 | |
---|
2871 | extern rtems_shell_cmd_t rtems_shell_DEBUGRFS_Command; |
---|
2872 | |
---|
2873 | df - display file system disk space usage |
---|
2874 | ----------------------------------------- |
---|
2875 | .. index:: df |
---|
2876 | |
---|
2877 | **SYNOPSYS:** |
---|
2878 | |
---|
2879 | .. code:: c |
---|
2880 | |
---|
2881 | df \[-h] \[-B block_size] |
---|
2882 | |
---|
2883 | **DESCRIPTION:** |
---|
2884 | |
---|
2885 | This command print disk space usage for mounted file systems. |
---|
2886 | |
---|
2887 | **EXIT STATUS:** |
---|
2888 | |
---|
2889 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2890 | |
---|
2891 | **NOTES:** |
---|
2892 | |
---|
2893 | NONE |
---|
2894 | |
---|
2895 | **EXAMPLES:** |
---|
2896 | |
---|
2897 | The following is an example of how to use ``df``: |
---|
2898 | .. code:: c |
---|
2899 | |
---|
2900 | SHLL \[/] $ df -B 4K |
---|
2901 | Filesystem 4K-blocks Used Available Use% Mounted on |
---|
2902 | /dev/rda 124 1 124 0% /mnt/ramdisk |
---|
2903 | SHLL \[/] $ df |
---|
2904 | Filesystem 1K-blocks Used Available Use% Mounted on |
---|
2905 | /dev/rda 495 1 494 0% /mnt/ramdisk |
---|
2906 | SHLL \[/] $ df -h |
---|
2907 | Filesystem Size Used Available Use% Mounted on |
---|
2908 | /dev/rda 495K 1K 494K 0% /mnt/ramdisk |
---|
2909 | |
---|
2910 | **CONFIGURATION:** |
---|
2911 | |
---|
2912 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DF |
---|
2913 | .. index:: CONFIGURE_SHELL_COMMAND_DF |
---|
2914 | |
---|
2915 | This command is included in the default shell command set. |
---|
2916 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DF`` to have this |
---|
2917 | command included. |
---|
2918 | |
---|
2919 | This command can be excluded from the shell command set by |
---|
2920 | defining ``CONFIGURE_SHELL_NO_COMMAND_DF`` when all |
---|
2921 | shell commands have been configured. |
---|
2922 | |
---|
2923 | **PROGRAMMING INFORMATION:** |
---|
2924 | |
---|
2925 | .. index:: rtems_shell_rtems_main_df |
---|
2926 | |
---|
2927 | The ``df`` is implemented by a C language function |
---|
2928 | which has the following prototype: |
---|
2929 | .. code:: c |
---|
2930 | |
---|
2931 | int rtems_shell_main_df( |
---|
2932 | int argc, |
---|
2933 | char \**argv |
---|
2934 | ); |
---|
2935 | |
---|
2936 | The configuration structure for the ``df`` has the |
---|
2937 | following prototype: |
---|
2938 | .. code:: c |
---|
2939 | |
---|
2940 | extern rtems_shell_cmd_t rtems_shell_DF_Command; |
---|
2941 | |
---|
2942 | dir - alias for ls |
---|
2943 | ------------------ |
---|
2944 | .. index:: dir |
---|
2945 | |
---|
2946 | **SYNOPSYS:** |
---|
2947 | |
---|
2948 | .. code:: c |
---|
2949 | |
---|
2950 | dir \[dir] |
---|
2951 | |
---|
2952 | **DESCRIPTION:** |
---|
2953 | |
---|
2954 | This command is an alias or alternate name for the ``ls``. |
---|
2955 | See :ref:`ls <File-and-Directory-Commands-ls-_002d-list-files-in-the-directory>` |
---|
2956 | for more information. |
---|
2957 | |
---|
2958 | **EXIT STATUS:** |
---|
2959 | |
---|
2960 | This command returns 0 on success and non-zero if an error is encountered. |
---|
2961 | |
---|
2962 | **NOTES:** |
---|
2963 | |
---|
2964 | NONE |
---|
2965 | |
---|
2966 | **EXAMPLES:** |
---|
2967 | |
---|
2968 | The following is an example of how to use ``dir``: |
---|
2969 | .. code:: c |
---|
2970 | |
---|
2971 | SHLL \[/] $ dir |
---|
2972 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
2973 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
2974 | 2 files 1608 bytes occupied |
---|
2975 | SHLL \[/] $ dir etc |
---|
2976 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
2977 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
2978 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
2979 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
2980 | 4 files 202 bytes occupied |
---|
2981 | |
---|
2982 | **CONFIGURATION:** |
---|
2983 | |
---|
2984 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DIR |
---|
2985 | .. index:: CONFIGURE_SHELL_COMMAND_DIR |
---|
2986 | |
---|
2987 | This command is included in the default shell command set. |
---|
2988 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DIR`` to have this |
---|
2989 | command included. |
---|
2990 | |
---|
2991 | This command can be excluded from the shell command set by |
---|
2992 | defining ``CONFIGURE_SHELL_NO_COMMAND_DIR`` when all |
---|
2993 | shell commands have been configured. |
---|
2994 | |
---|
2995 | **PROGRAMMING INFORMATION:** |
---|
2996 | |
---|
2997 | .. index:: rtems_shell_rtems_main_dir |
---|
2998 | |
---|
2999 | The ``dir`` is implemented by a C language function |
---|
3000 | which has the following prototype: |
---|
3001 | .. code:: c |
---|
3002 | |
---|
3003 | int rtems_shell_rtems_main_dir( |
---|
3004 | int argc, |
---|
3005 | char \**argv |
---|
3006 | ); |
---|
3007 | |
---|
3008 | The configuration structure for the ``dir`` has the |
---|
3009 | following prototype: |
---|
3010 | .. code:: c |
---|
3011 | |
---|
3012 | extern rtems_shell_cmd_t rtems_shell_DIR_Command; |
---|
3013 | |
---|
3014 | fdisk - format disk |
---|
3015 | ------------------- |
---|
3016 | .. index:: fdisk |
---|
3017 | |
---|
3018 | **SYNOPSYS:** |
---|
3019 | |
---|
3020 | .. code:: c |
---|
3021 | |
---|
3022 | fdisk |
---|
3023 | |
---|
3024 | **CONFIGURATION:** |
---|
3025 | |
---|
3026 | .. index:: CONFIGURE_SHELL_NO_COMMAND_FDISK |
---|
3027 | .. index:: CONFIGURE_SHELL_COMMAND_FDISK |
---|
3028 | |
---|
3029 | This command is included in the default shell command set. |
---|
3030 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_FDISK`` to have this |
---|
3031 | command included. |
---|
3032 | |
---|
3033 | This command can be excluded from the shell command set by |
---|
3034 | defining ``CONFIGURE_SHELL_NO_COMMAND_FDISK`` when all |
---|
3035 | shell commands have been configured. |
---|
3036 | |
---|
3037 | hexdump - ascii/dec/hex/octal dump |
---|
3038 | ---------------------------------- |
---|
3039 | .. index:: hexdump |
---|
3040 | |
---|
3041 | **SYNOPSYS:** |
---|
3042 | |
---|
3043 | .. code:: c |
---|
3044 | |
---|
3045 | hexdump \[-bcCdovx] \[-e format_string] \[-f format_file] \[-n length] |
---|
3046 | \[-s skip] file ... |
---|
3047 | |
---|
3048 | **DESCRIPTION:** |
---|
3049 | |
---|
3050 | The hexdump utility is a filter which displays the specified files, or |
---|
3051 | the standard input, if no files are specified, in a user specified |
---|
3052 | format. |
---|
3053 | |
---|
3054 | The options are as follows: |
---|
3055 | |
---|
3056 | *-b* |
---|
3057 | One-byte octal display. Display the input offset in hexadecimal, |
---|
3058 | followed by sixteen space-separated, three column, zero-filled, bytes |
---|
3059 | of input data, in octal, per line. |
---|
3060 | |
---|
3061 | *-c* |
---|
3062 | One-byte character display. Display the input offset in hexadecimal, |
---|
3063 | followed by sixteen space-separated, three column, space-filled, |
---|
3064 | characters of input data per line. |
---|
3065 | |
---|
3066 | *-C* |
---|
3067 | Canonical hex+ASCII display. Display the input offset in hexadecimal, |
---|
3068 | followed by sixteen space-separated, two column, hexadecimal bytes, |
---|
3069 | followed by the same sixteen bytes in %_p format enclosed in â|â |
---|
3070 | characters. |
---|
3071 | |
---|
3072 | *-d* |
---|
3073 | Two-byte decimal display. Display the input offset in hexadecimal, |
---|
3074 | followed by eight space-separated, five column, zero-filled, two-byte |
---|
3075 | units of input data, in unsigned decimal, per line. |
---|
3076 | |
---|
3077 | *-e format_string* |
---|
3078 | Specify a format string to be used for displaying data. |
---|
3079 | |
---|
3080 | *-f format_file* |
---|
3081 | Specify a file that contains one or more newline separated format |
---|
3082 | strings. Empty lines and lines whose first non-blank character is a |
---|
3083 | hash mark (#) are ignored. |
---|
3084 | |
---|
3085 | *-n length* |
---|
3086 | Interpret only length bytes of input. |
---|
3087 | |
---|
3088 | *-o* |
---|
3089 | Two-byte octal display. Display the input offset in hexadecimal, |
---|
3090 | followed by eight space-separated, six column, zerofilled, two byte |
---|
3091 | quantities of input data, in octal, per line. |
---|
3092 | |
---|
3093 | *-s offset* |
---|
3094 | Skip offset bytes from the beginning of the input. By default, offset |
---|
3095 | is interpreted as a decimal number. With a leading 0x or 0X, offset |
---|
3096 | is interpreted as a hexadecimal number, otherwise, with a leading 0, |
---|
3097 | offset is interpreted as an octal number. Appending the character b, |
---|
3098 | k, or m to offset causes it to be interpreted as a multiple of 512, |
---|
3099 | 1024, or 1048576, respectively. |
---|
3100 | |
---|
3101 | *-v* |
---|
3102 | The -v option causes hexdump to display all input data. Without the |
---|
3103 | -v option, any number of groups of output lines, which would be |
---|
3104 | identical to the immediately preceding group of output lines (except |
---|
3105 | for the input offsets), are replaced with a line containing a single |
---|
3106 | asterisk. |
---|
3107 | |
---|
3108 | *-x* |
---|
3109 | Two-byte hexadecimal display. Display the input offset in |
---|
3110 | hexadecimal, followed by eight, space separated, four column, |
---|
3111 | zero-filled, two-byte quantities of input data, in hexadecimal, per |
---|
3112 | line. |
---|
3113 | |
---|
3114 | For each input file, hexdump sequentially copies the input to standard |
---|
3115 | output, transforming the data according to the format strings |
---|
3116 | specified by the -e and -f options, in the order that they were |
---|
3117 | specified. |
---|
3118 | |
---|
3119 | *Formats* |
---|
3120 | |
---|
3121 | A format string contains any number of format units, separated by |
---|
3122 | whitespace. A format unit contains up to three items: an iteration |
---|
3123 | count, a byte count, and a format. |
---|
3124 | |
---|
3125 | The iteration count is an optional positive integer, which defaults to |
---|
3126 | one. Each format is applied iteration count times. |
---|
3127 | |
---|
3128 | The byte count is an optional positive integer. If specified it |
---|
3129 | defines the number of bytes to be interpreted by each iteration of the |
---|
3130 | format. |
---|
3131 | |
---|
3132 | If an iteration count and/or a byte count is specified, a single slash |
---|
3133 | must be placed after the iteration count and/or before the byte count |
---|
3134 | to disambiguate them. Any whitespace before or after the slash is |
---|
3135 | ignored. |
---|
3136 | |
---|
3137 | The format is required and must be surrounded by double quote (â â) |
---|
3138 | marks. It is interpreted as a fprintf-style format string (see*fprintf*), with the following exceptions: |
---|
3139 | |
---|
3140 | - An asterisk (\*) may not be used as a field width or precision. |
---|
3141 | |
---|
3142 | - A byte count or field precision is required for each âsâ con- |
---|
3143 | version character (unlike the fprintf(3) default which prints the |
---|
3144 | entire string if the precision is unspecified). |
---|
3145 | |
---|
3146 | - The conversion characters âhâ, âlâ, ânâ, âpâ and âqâ are not |
---|
3147 | supported. |
---|
3148 | |
---|
3149 | - The single character escape sequences described in the C standard |
---|
3150 | are supported: |
---|
3151 | |
---|
3152 | NUL \\0 |
---|
3153 | <alert character> \\a |
---|
3154 | <backspace> \\b |
---|
3155 | <form-feed> \\f |
---|
3156 | <newline> \\n |
---|
3157 | <carriage return> \\r |
---|
3158 | <tab> \\t |
---|
3159 | <vertical tab> \\v |
---|
3160 | |
---|
3161 | Hexdump also supports the following additional conversion strings: |
---|
3162 | |
---|
3163 | *_a[dox]* |
---|
3164 | Display the input offset, cumulative across input files, of the next |
---|
3165 | byte to be displayed. The appended characters d, o, and x specify the |
---|
3166 | display base as decimal, octal or hexadecimal respectively. |
---|
3167 | |
---|
3168 | *_A[dox]* |
---|
3169 | Identical to the _a conversion string except that it is only performed |
---|
3170 | once, when all of the input data has been processed. |
---|
3171 | |
---|
3172 | *_c* |
---|
3173 | Output characters in the default character set. Nonprinting |
---|
3174 | characters are displayed in three character, zero-padded octal, except |
---|
3175 | for those representable by standard escape notation (see above), which |
---|
3176 | are displayed as two character strings. |
---|
3177 | |
---|
3178 | *_p* |
---|
3179 | Output characters in the default character set. Nonprinting |
---|
3180 | characters are displayed as a single â.â. |
---|
3181 | |
---|
3182 | *_u* |
---|
3183 | Output US ASCII characters, with the exception that control characters |
---|
3184 | are displayed using the following, lower-case, names. Characters |
---|
3185 | greater than 0xff, hexadecimal, are displayed as hexadecimal |
---|
3186 | strings. |
---|
3187 | 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq |
---|
3188 | 006 ack 007 bel 008 bs 009 ht 00A lf 00B vt |
---|
3189 | 00C ff 00D cr 00E so 00F si 010 dle 011 dc1 |
---|
3190 | 012 dc2 013 dc3 014 dc4 015 nak 016 syn 017 etb |
---|
3191 | 018 can 019 em 01A sub 01B esc 01C fs 01D gs |
---|
3192 | 01E rs 01F us 07F del |
---|
3193 | |
---|
3194 | The default and supported byte counts for the conversion characters |
---|
3195 | are as follows: |
---|
3196 | |
---|
3197 | %_c, %_p, %_u, %c One byte counts only. |
---|
3198 | %d, %i, %o, %u, %X, %x Four byte default, one, two, four |
---|
3199 | and eight byte counts supported. |
---|
3200 | %E, %e, %f, %G, %g Eight byte default, four byte |
---|
3201 | counts supported. |
---|
3202 | |
---|
3203 | The amount of data interpreted by each format string is the sum of the |
---|
3204 | data required by each format unit, which is the iteration count times |
---|
3205 | the byte count, or the iteration count times the number of bytes |
---|
3206 | required by the format if the byte count is not specified. |
---|
3207 | |
---|
3208 | The input is manipulated in âblocksâ, where a block is defined as |
---|
3209 | the largest amount of data specified by any format string. Format |
---|
3210 | strings interpreting less than an input blockâs worth of data, whose |
---|
3211 | last format unit both interprets some number of bytes and does not |
---|
3212 | have a specified iteration count, have the iteration count incremented |
---|
3213 | until the entire input block has been processed or there is not enough |
---|
3214 | data remaining in the block to satisfy the format string. |
---|
3215 | |
---|
3216 | If, either as a result of user specification or hexdump modifying the |
---|
3217 | iteration count as described above, an iteration count is greater than |
---|
3218 | one, no trailing whitespace characters are output during the last |
---|
3219 | iteration. |
---|
3220 | |
---|
3221 | It is an error to specify a byte count as well as multiple conversion |
---|
3222 | characters or strings unless all but one of the conversion characters |
---|
3223 | or strings is _a or _A. |
---|
3224 | |
---|
3225 | If, as a result of the specification of the -n option or end-of-file |
---|
3226 | being reached, input data only partially satisfies a format string, |
---|
3227 | the input block is zero-padded sufficiently to display all available |
---|
3228 | data (i.e. any format units overlapping the end of data will display |
---|
3229 | some num- ber of the zero bytes). |
---|
3230 | |
---|
3231 | Further output by such format strings is replaced by an equivalent |
---|
3232 | number of spaces. An equivalent number of spaces is defined as the |
---|
3233 | number of spaces output by an s conversion character with the same |
---|
3234 | field width and precision as the original conversion character or |
---|
3235 | conversion string but with any â+â, â â, â#â conversion flag |
---|
3236 | characters removed, and ref- erencing a NULL string. |
---|
3237 | |
---|
3238 | If no format strings are specified, the default display is equivalent |
---|
3239 | to specifying the -x option. |
---|
3240 | |
---|
3241 | **EXIT STATUS:** |
---|
3242 | |
---|
3243 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3244 | |
---|
3245 | **NOTES:** |
---|
3246 | |
---|
3247 | NONE |
---|
3248 | |
---|
3249 | **EXAMPLES:** |
---|
3250 | |
---|
3251 | The following is an example of how to use ``hexdump``: |
---|
3252 | .. code:: c |
---|
3253 | |
---|
3254 | SHLL \[/] $ hexdump -C -n 512 /dev/hda1 |
---|
3255 | |
---|
3256 | **CONFIGURATION:** |
---|
3257 | |
---|
3258 | .. index:: CONFIGURE_SHELL_NO_COMMAND_HEXDUMP |
---|
3259 | .. index:: CONFIGURE_SHELL_COMMAND_HEXDUMP |
---|
3260 | |
---|
3261 | This command is included in the default shell command set. When |
---|
3262 | building a custom command set, define``CONFIGURE_SHELL_COMMAND_HEXDUMP`` to have this command included. |
---|
3263 | |
---|
3264 | This command can be excluded from the shell command set by defining``CONFIGURE_SHELL_NO_COMMAND_HEXDUMP`` when all shell commands have |
---|
3265 | been configured. |
---|
3266 | |
---|
3267 | **PROGRAMMING INFORMATION:** |
---|
3268 | |
---|
3269 | .. index:: rtems_shell_rtems_main_hexdump |
---|
3270 | |
---|
3271 | The ``hexdump`` command is implemented by a C language function |
---|
3272 | which has the following prototype: |
---|
3273 | .. code:: c |
---|
3274 | |
---|
3275 | int rtems_shell_rtems_main_hexdump( |
---|
3276 | int argc, |
---|
3277 | char \**argv |
---|
3278 | ); |
---|
3279 | |
---|
3280 | The configuration structure for the ``hexdump`` has the following |
---|
3281 | prototype: |
---|
3282 | .. code:: c |
---|
3283 | |
---|
3284 | extern rtems_shell_cmd_t rtems_shell_HEXDUMP_Command; |
---|
3285 | |
---|
3286 | ln - make links |
---|
3287 | --------------- |
---|
3288 | .. index:: ln |
---|
3289 | |
---|
3290 | **SYNOPSYS:** |
---|
3291 | |
---|
3292 | .. code:: c |
---|
3293 | |
---|
3294 | ln \[-fhinsv] source_file \[target_file] |
---|
3295 | ln \[-fhinsv] source_file ... target_dir |
---|
3296 | |
---|
3297 | **DESCRIPTION:** |
---|
3298 | |
---|
3299 | The ln utility creates a new directory entry (linked file) which has |
---|
3300 | the same modes as the original file. It is useful for maintaining |
---|
3301 | multiple copies of a file in many places at once without using up |
---|
3302 | storage for the âcopiesâ; instead, a link âpointsâ to the original |
---|
3303 | copy. There are two types of links; hard links and symbolic links. |
---|
3304 | How a link âpointsâ to a file is one of the differences between a |
---|
3305 | hard or symbolic link. |
---|
3306 | |
---|
3307 | The options are as follows: |
---|
3308 | |
---|
3309 | *-f* |
---|
3310 | Unlink any already existing file, permitting the link to occur. |
---|
3311 | |
---|
3312 | *-h* |
---|
3313 | If the target_file or target_dir is a symbolic link, do not follow it. |
---|
3314 | This is most useful with the -f option, to replace a symlink which may |
---|
3315 | point to a directory. |
---|
3316 | |
---|
3317 | *-i* |
---|
3318 | Cause ln to write a prompt to standard error if the target file |
---|
3319 | exists. If the response from the standard input begins with the |
---|
3320 | character âyâ or âYâ, then unlink the target file so that the link may |
---|
3321 | occur. Otherwise, do not attempt the link. (The -i option overrides |
---|
3322 | any previous -f options.) |
---|
3323 | |
---|
3324 | *-n* |
---|
3325 | Same as -h, for compatibility with other ln implementations. |
---|
3326 | |
---|
3327 | *-s* |
---|
3328 | Create a symbolic link. |
---|
3329 | |
---|
3330 | *-v* |
---|
3331 | Cause ln to be verbose, showing files as they are processed. |
---|
3332 | |
---|
3333 | By default ln makes hard links. A hard link to a file is |
---|
3334 | indistinguishable from the original directory entry; any changes to a |
---|
3335 | file are effective independent of the name used to reference the file. |
---|
3336 | Hard links may not normally refer to directories and may not span file |
---|
3337 | systems. |
---|
3338 | |
---|
3339 | A symbolic link contains the name of the file to which it is linked. |
---|
3340 | The referenced file is used when an *open* operation is performed on |
---|
3341 | the link. A *stat* on a symbolic link will return the linked-to |
---|
3342 | file; an *lstat* must be done to obtain information about the link. |
---|
3343 | The *readlink* call may be used to read the contents of a symbolic |
---|
3344 | link. Symbolic links may span file systems and may refer to |
---|
3345 | directories. |
---|
3346 | |
---|
3347 | Given one or two arguments, ln creates a link to an existing file |
---|
3348 | source_file. If target_file is given, the link has that name; |
---|
3349 | target_file may also be a directory in which to place the link; |
---|
3350 | otherwise it is placed in the current directory. If only the |
---|
3351 | directory is specified, the link will be made to the last component of |
---|
3352 | source_file. |
---|
3353 | |
---|
3354 | Given more than two arguments, ln makes links in target_dir to all the |
---|
3355 | named source files. The links made will have the same name as the |
---|
3356 | files being linked to. |
---|
3357 | |
---|
3358 | **EXIT STATUS:** |
---|
3359 | |
---|
3360 | The ``ln`` utility exits 0 on success, and >0 if an error occurs. |
---|
3361 | |
---|
3362 | **NOTES:** |
---|
3363 | |
---|
3364 | NONE |
---|
3365 | |
---|
3366 | **EXAMPLES:** |
---|
3367 | |
---|
3368 | .. code:: c |
---|
3369 | |
---|
3370 | SHLL \[/] ln -s /dev/console /dev/con1 |
---|
3371 | |
---|
3372 | **CONFIGURATION:** |
---|
3373 | |
---|
3374 | .. index:: CONFIGURE_SHELL_NO_COMMAND_LN |
---|
3375 | .. index:: CONFIGURE_SHELL_COMMAND_LN |
---|
3376 | |
---|
3377 | This command is included in the default shell command set. When |
---|
3378 | building a custom command set, define``CONFIGURE_SHELL_COMMAND_LN`` to have this command included. |
---|
3379 | |
---|
3380 | This command can be excluded from the shell command set by |
---|
3381 | defining ``CONFIGURE_SHELL_NO_COMMAND_LN`` when all |
---|
3382 | shell commands have been configured. |
---|
3383 | |
---|
3384 | **PROGRAMMING INFORMATION:** |
---|
3385 | |
---|
3386 | .. index:: rtems_shell_rtems_main_ln |
---|
3387 | |
---|
3388 | The ``ln`` command is implemented by a C language function which |
---|
3389 | has the following prototype: |
---|
3390 | .. code:: c |
---|
3391 | |
---|
3392 | int rtems_shell_rtems_main_ln( |
---|
3393 | int argc, |
---|
3394 | char \**argv |
---|
3395 | ); |
---|
3396 | |
---|
3397 | The configuration structure for the ``ln`` has the following |
---|
3398 | prototype: |
---|
3399 | .. code:: c |
---|
3400 | |
---|
3401 | extern rtems_shell_cmd_t rtems_shell_LN_Command; |
---|
3402 | |
---|
3403 | **ORIGIN:** |
---|
3404 | |
---|
3405 | The implementation and portions of the documentation for this command |
---|
3406 | are from NetBSD 4.0. |
---|
3407 | |
---|
3408 | .. _File-and-Directory-Commands-ls-_002d-list-files-in-the-directory: |
---|
3409 | |
---|
3410 | ls - list files in the directory |
---|
3411 | -------------------------------- |
---|
3412 | .. index:: ls |
---|
3413 | |
---|
3414 | **SYNOPSYS:** |
---|
3415 | |
---|
3416 | .. code:: c |
---|
3417 | |
---|
3418 | ls \[dir] |
---|
3419 | |
---|
3420 | **DESCRIPTION:** |
---|
3421 | |
---|
3422 | This command displays the contents of the specified directory. If |
---|
3423 | no arguments are given, then it displays the contents of the current |
---|
3424 | working directory. |
---|
3425 | |
---|
3426 | **EXIT STATUS:** |
---|
3427 | |
---|
3428 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3429 | |
---|
3430 | **NOTES:** |
---|
3431 | |
---|
3432 | This command currently does not display information on a set of |
---|
3433 | files like the POSIX ls(1). It only displays the contents of |
---|
3434 | entire directories. |
---|
3435 | |
---|
3436 | **EXAMPLES:** |
---|
3437 | |
---|
3438 | The following is an example of how to use ``ls``: |
---|
3439 | .. code:: c |
---|
3440 | |
---|
3441 | SHLL \[/] $ ls |
---|
3442 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
3443 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
3444 | 2 files 1608 bytes occupied |
---|
3445 | SHLL \[/] $ ls etc |
---|
3446 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
3447 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
3448 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
3449 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
3450 | 4 files 202 bytes occupied |
---|
3451 | SHLL \[/] $ ls dev etc |
---|
3452 | -rwxr-xr-x 1 rtems root 0 Jan 01 00:00 console |
---|
3453 | -rwxr-xr-x 1 root root 0 Jan 01 00:00 console_b |
---|
3454 | |
---|
3455 | **CONFIGURATION:** |
---|
3456 | |
---|
3457 | .. index:: CONFIGURE_SHELL_NO_COMMAND_LS |
---|
3458 | .. index:: CONFIGURE_SHELL_COMMAND_LS |
---|
3459 | |
---|
3460 | This command is included in the default shell command set. |
---|
3461 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_LS`` to have this |
---|
3462 | command included. |
---|
3463 | |
---|
3464 | This command can be excluded from the shell command set by |
---|
3465 | defining ``CONFIGURE_SHELL_NO_COMMAND_LS`` when all |
---|
3466 | shell commands have been configured. |
---|
3467 | |
---|
3468 | **PROGRAMMING INFORMATION:** |
---|
3469 | |
---|
3470 | .. index:: rtems_shell_rtems_main_ls |
---|
3471 | |
---|
3472 | The ``ls`` is implemented by a C language function |
---|
3473 | which has the following prototype: |
---|
3474 | .. code:: c |
---|
3475 | |
---|
3476 | int rtems_shell_rtems_main_ls( |
---|
3477 | int argc, |
---|
3478 | char \**argv |
---|
3479 | ); |
---|
3480 | |
---|
3481 | The configuration structure for the ``ls`` has the |
---|
3482 | following prototype: |
---|
3483 | .. code:: c |
---|
3484 | |
---|
3485 | extern rtems_shell_cmd_t rtems_shell_LS_Command; |
---|
3486 | |
---|
3487 | md5 - compute the Md5 hash of a file or list of files |
---|
3488 | ----------------------------------------------------- |
---|
3489 | .. index:: md5 |
---|
3490 | |
---|
3491 | **SYNOPSYS:** |
---|
3492 | |
---|
3493 | .. code:: c |
---|
3494 | |
---|
3495 | md5 <files> |
---|
3496 | |
---|
3497 | **DESCRIPTION:** |
---|
3498 | |
---|
3499 | This command prints the MD5 of a file. You can provide one or more |
---|
3500 | files on the command line and a hash for each file is printed in a |
---|
3501 | single line of output. |
---|
3502 | |
---|
3503 | **EXIT STATUS:** |
---|
3504 | |
---|
3505 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3506 | |
---|
3507 | **NOTES:** |
---|
3508 | |
---|
3509 | NONE |
---|
3510 | |
---|
3511 | **EXAMPLES:** |
---|
3512 | |
---|
3513 | The following is an example of how to use ``md5``: |
---|
3514 | .. code:: c |
---|
3515 | |
---|
3516 | SHLL \[/] $ md5 shell-init |
---|
3517 | MD5 (shell-init) = 43b4d2e71b47db79eae679a2efeacf31 |
---|
3518 | |
---|
3519 | **CONFIGURATION:** |
---|
3520 | |
---|
3521 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MD5 |
---|
3522 | .. index:: CONFIGURE_SHELL_COMMAND_MD5 |
---|
3523 | |
---|
3524 | This command is included in the default shell command set. |
---|
3525 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MD5`` to have this |
---|
3526 | command included. |
---|
3527 | |
---|
3528 | This command can be excluded from the shell command set by |
---|
3529 | defining ``CONFIGURE_SHELL_NO_COMMAND_MD5`` when all |
---|
3530 | shell commands have been configured. |
---|
3531 | |
---|
3532 | **PROGRAMMING INFORMATION:** |
---|
3533 | |
---|
3534 | .. index:: rtems_shell_rtems_main_md5 |
---|
3535 | |
---|
3536 | The ``df`` is implemented by a C language function |
---|
3537 | which has the following prototype: |
---|
3538 | .. code:: c |
---|
3539 | |
---|
3540 | int rtems_shell_main_md5( |
---|
3541 | int argc, |
---|
3542 | char \**argv |
---|
3543 | ); |
---|
3544 | |
---|
3545 | The configuration structure for the ``md5`` has the |
---|
3546 | following prototype: |
---|
3547 | .. code:: c |
---|
3548 | |
---|
3549 | extern rtems_shell_cmd_t rtems_shell_MD5_Command; |
---|
3550 | |
---|
3551 | mkdir - create a directory |
---|
3552 | -------------------------- |
---|
3553 | .. index:: mkdir |
---|
3554 | |
---|
3555 | **SYNOPSYS:** |
---|
3556 | |
---|
3557 | .. code:: c |
---|
3558 | |
---|
3559 | mkdir dir \[dir1 .. dirN] |
---|
3560 | |
---|
3561 | **DESCRIPTION:** |
---|
3562 | |
---|
3563 | This command creates the set of directories in the order they |
---|
3564 | are specified on the command line. If an error is encountered |
---|
3565 | making one of the directories, the command will continue to |
---|
3566 | attempt to create the remaining directories on the command line. |
---|
3567 | |
---|
3568 | **EXIT STATUS:** |
---|
3569 | |
---|
3570 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3571 | |
---|
3572 | **NOTES:** |
---|
3573 | |
---|
3574 | If this command is invoked with no arguments, nothing occurs. |
---|
3575 | |
---|
3576 | The user must have sufficient permissions to create the directory. |
---|
3577 | For the ``fileio`` test provided with RTEMS, this means the user |
---|
3578 | must login as ``root`` not ``rtems``. |
---|
3579 | |
---|
3580 | **EXAMPLES:** |
---|
3581 | |
---|
3582 | The following is an example of how to use ``mkdir``: |
---|
3583 | .. code:: c |
---|
3584 | |
---|
3585 | SHLL \[/] # ls |
---|
3586 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
3587 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
3588 | 2 files 1608 bytes occupied |
---|
3589 | SHLL \[/] # mkdir joel |
---|
3590 | SHLL \[/] # ls joel |
---|
3591 | 0 files 0 bytes occupied |
---|
3592 | SHLL \[/] # cp etc/passwd joel |
---|
3593 | SHLL \[/] # ls joel |
---|
3594 | -rw-r--r-- 1 root root 102 Jan 01 00:02 passwd |
---|
3595 | 1 files 102 bytes occupied |
---|
3596 | |
---|
3597 | **CONFIGURATION:** |
---|
3598 | |
---|
3599 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MKDIR |
---|
3600 | .. index:: CONFIGURE_SHELL_COMMAND_MKDIR |
---|
3601 | |
---|
3602 | This command is included in the default shell command set. |
---|
3603 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MKDIR`` to have this |
---|
3604 | command included. |
---|
3605 | |
---|
3606 | This command can be excluded from the shell command set by |
---|
3607 | defining ``CONFIGURE_SHELL_NO_COMMAND_MKDIR`` when all |
---|
3608 | shell commands have been configured. |
---|
3609 | |
---|
3610 | **PROGRAMMING INFORMATION:** |
---|
3611 | |
---|
3612 | .. index:: rtems_shell_rtems_main_mkdir |
---|
3613 | |
---|
3614 | The ``mkdir`` is implemented by a C language function |
---|
3615 | which has the following prototype: |
---|
3616 | .. code:: c |
---|
3617 | |
---|
3618 | int rtems_shell_rtems_main_mkdir( |
---|
3619 | int argc, |
---|
3620 | char \**argv |
---|
3621 | ); |
---|
3622 | |
---|
3623 | The configuration structure for the ``mkdir`` has the |
---|
3624 | following prototype: |
---|
3625 | .. code:: c |
---|
3626 | |
---|
3627 | extern rtems_shell_cmd_t rtems_shell_MKDIR_Command; |
---|
3628 | |
---|
3629 | mldos - DOSFS file system format |
---|
3630 | -------------------------------- |
---|
3631 | .. index:: pwd |
---|
3632 | |
---|
3633 | **SYNOPSYS:** |
---|
3634 | |
---|
3635 | .. code:: c |
---|
3636 | |
---|
3637 | mkdir \[-V label] \[-s sectors/cluster] \[-r size] \[-v] path |
---|
3638 | |
---|
3639 | **DESCRIPTION:** |
---|
3640 | |
---|
3641 | This command formats a block device entry with the DOSFS file system. |
---|
3642 | |
---|
3643 | *-V label* |
---|
3644 | |
---|
3645 | *-s sectors/cluster* |
---|
3646 | |
---|
3647 | *-r size* |
---|
3648 | |
---|
3649 | **EXIT STATUS:** |
---|
3650 | |
---|
3651 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3652 | |
---|
3653 | **NOTES:** |
---|
3654 | |
---|
3655 | NONE |
---|
3656 | |
---|
3657 | **EXAMPLES:** |
---|
3658 | |
---|
3659 | The following is an example of how to use ``mkdos``: |
---|
3660 | .. code:: c |
---|
3661 | |
---|
3662 | SHLL \[/] $ mkdos /dev/rda1 |
---|
3663 | |
---|
3664 | **CONFIGURATION:** |
---|
3665 | |
---|
3666 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MKDOS |
---|
3667 | .. index:: CONFIGURE_SHELL_COMMAND_MKDOS |
---|
3668 | |
---|
3669 | This command is included in the default shell command set. |
---|
3670 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MKDOS`` to have this |
---|
3671 | command included. |
---|
3672 | |
---|
3673 | This command can be excluded from the shell command set by |
---|
3674 | defining ``CONFIGURE_SHELL_NO_COMMAND_MKDOS`` when all |
---|
3675 | shell commands have been configured. |
---|
3676 | |
---|
3677 | **PROGRAMMING INFORMATION:** |
---|
3678 | |
---|
3679 | .. index:: rtems_shell_rtems_main_mkdos |
---|
3680 | |
---|
3681 | The ``mkdos`` is implemented by a C language function |
---|
3682 | which has the following prototype: |
---|
3683 | .. code:: c |
---|
3684 | |
---|
3685 | int rtems_shell_rtems_main_mkdos( |
---|
3686 | int argc, |
---|
3687 | char \**argv |
---|
3688 | ); |
---|
3689 | |
---|
3690 | The configuration structure for the ``mkdos`` has the |
---|
3691 | following prototype: |
---|
3692 | .. code:: c |
---|
3693 | |
---|
3694 | extern rtems_shell_cmd_t rtems_shell_MKDOS_Command; |
---|
3695 | |
---|
3696 | mknod - make device special file |
---|
3697 | -------------------------------- |
---|
3698 | .. index:: mknod |
---|
3699 | |
---|
3700 | **SYNOPSYS:** |
---|
3701 | |
---|
3702 | .. code:: c |
---|
3703 | |
---|
3704 | mknod \[-rR] \[-F fmt] \[-g gid] \[-m mode] \[-u uid] name \[c | b] |
---|
3705 | \[driver | major] minor |
---|
3706 | mknod \[-rR] \[-F fmt] \[-g gid] \[-m mode] \[-u uid] name \[c | b] |
---|
3707 | major unit subunit |
---|
3708 | mknod \[-rR] \[-g gid] \[-m mode] \[-u uid] name \[c | b] number |
---|
3709 | mknod \[-rR] \[-g gid] \[-m mode] \[-u uid] name p |
---|
3710 | |
---|
3711 | **DESCRIPTION:** |
---|
3712 | |
---|
3713 | The mknod command creates device special files, or fifos. Normally |
---|
3714 | the shell script /dev/MAKEDEV is used to create special files for |
---|
3715 | commonly known devices; it executes mknod with the appropriate |
---|
3716 | arguments and can make all the files required for the device. |
---|
3717 | |
---|
3718 | To make nodes manually, the arguments are: |
---|
3719 | |
---|
3720 | *-r* |
---|
3721 | Replace an existing file if its type is incorrect. |
---|
3722 | |
---|
3723 | *-R* |
---|
3724 | Replace an existing file if its type is incorrect. Correct the |
---|
3725 | mode, user and group. |
---|
3726 | |
---|
3727 | *-g gid* |
---|
3728 | Specify the group for the device node. The gid operand may be a |
---|
3729 | numeric group ID or a group name. If a group name is also a numeric |
---|
3730 | group ID, the operand is used as a group name. Precede a numeric |
---|
3731 | group ID with a # to stop it being treated as a name. |
---|
3732 | |
---|
3733 | *-m mode* |
---|
3734 | Specify the mode for the device node. The mode may be absolute or |
---|
3735 | symbolic, see *chmod*. |
---|
3736 | |
---|
3737 | *-u uid* |
---|
3738 | Specify the user for the device node. The uid operand may be a |
---|
3739 | numeric user ID or a user name. If a user name is also a numeric user |
---|
3740 | ID, the operand is used as a user name. Precede a numeric user ID |
---|
3741 | with a # to stop it being treated as a name. |
---|
3742 | |
---|
3743 | *name* |
---|
3744 | Device name, for example âttyâ for a termios serial device or âhdâ |
---|
3745 | for a disk. |
---|
3746 | |
---|
3747 | *b | c | p* |
---|
3748 | Type of device. If the device is a block type device such as a tape |
---|
3749 | or disk drive which needs both cooked and raw special files, the type |
---|
3750 | is b. All other devices are character type devices, such as terminal |
---|
3751 | and pseudo devices, and are type c. Specifying p creates fifo files. |
---|
3752 | |
---|
3753 | *driver | major* |
---|
3754 | The major device number is an integer number which tells the kernel |
---|
3755 | which device driver entry point to use. If the device driver is |
---|
3756 | configured into the current kernel it may be specified by driver name |
---|
3757 | or major number. |
---|
3758 | |
---|
3759 | *minor* |
---|
3760 | The minor device number tells the kernel which one of several similar |
---|
3761 | devices the node corresponds to; for example, it may be a specific |
---|
3762 | serial port or pty. |
---|
3763 | |
---|
3764 | *unit and subunit* |
---|
3765 | The unit and subunit numbers select a subset of a device; for example, |
---|
3766 | the unit may specify a particular disk, and the subunit a partition on |
---|
3767 | that disk. (Currently this form of specification is only supported |
---|
3768 | by the bsdos format, for compatibility with the BSD/OS mknod). |
---|
3769 | |
---|
3770 | *number* |
---|
3771 | A single opaque device number. Useful for netbooted computers which |
---|
3772 | require device numbers packed in a format that isnât supported by |
---|
3773 | -F. |
---|
3774 | |
---|
3775 | **EXIT STATUS:** |
---|
3776 | |
---|
3777 | The ``mknod`` utility exits 0 on success, and >0 if an error occurs. |
---|
3778 | |
---|
3779 | **NOTES:** |
---|
3780 | |
---|
3781 | NONE |
---|
3782 | |
---|
3783 | **EXAMPLES:** |
---|
3784 | |
---|
3785 | .. code:: c |
---|
3786 | |
---|
3787 | SHLL \[/] mknod c 3 0 /dev/ttyS10 |
---|
3788 | |
---|
3789 | **CONFIGURATION:** |
---|
3790 | |
---|
3791 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MKNOD |
---|
3792 | .. index:: CONFIGURE_SHELL_COMMAND_MKNOD |
---|
3793 | |
---|
3794 | This command is included in the default shell command set. When |
---|
3795 | building a custom command set, define``CONFIGURE_SHELL_COMMAND_MKNOD`` to have this command included. |
---|
3796 | |
---|
3797 | This command can be excluded from the shell command set by |
---|
3798 | defining ``CONFIGURE_SHELL_NO_COMMAND_MKNOD`` when all |
---|
3799 | shell commands have been configured. |
---|
3800 | |
---|
3801 | **PROGRAMMING INFORMATION:** |
---|
3802 | |
---|
3803 | .. index:: rtems_shell_rtems_main_mknod |
---|
3804 | |
---|
3805 | The ``mknod`` command is implemented by a C language function which |
---|
3806 | has the following prototype: |
---|
3807 | .. code:: c |
---|
3808 | |
---|
3809 | int rtems_shell_rtems_main_mknod( |
---|
3810 | int argc, |
---|
3811 | char \**argv |
---|
3812 | ); |
---|
3813 | |
---|
3814 | The configuration structure for the ``mknod`` has the following |
---|
3815 | prototype: |
---|
3816 | .. code:: c |
---|
3817 | |
---|
3818 | extern rtems_shell_cmd_t rtems_shell_MKNOD_Command; |
---|
3819 | |
---|
3820 | **ORIGIN:** |
---|
3821 | |
---|
3822 | The implementation and portions of the documentation for this command |
---|
3823 | are from NetBSD 4.0. |
---|
3824 | |
---|
3825 | mkrfs - format RFS file system |
---|
3826 | ------------------------------ |
---|
3827 | .. index:: mkrfs |
---|
3828 | |
---|
3829 | **SYNOPSYS:** |
---|
3830 | |
---|
3831 | .. code:: c |
---|
3832 | |
---|
3833 | mkrfs \[-vsbiIo] device |
---|
3834 | |
---|
3835 | **DESCRIPTION:** |
---|
3836 | |
---|
3837 | Format the block device with the RTEMS File System (RFS). The default |
---|
3838 | configuration with not parameters selects a suitable block size based |
---|
3839 | on the size of the media being formatted. |
---|
3840 | |
---|
3841 | The media is broken up into groups of blocks. The number of blocks in |
---|
3842 | a group is based on the number of bits a block contains. The large a |
---|
3843 | block the more blocks a group contains and the fewer groups in the |
---|
3844 | file system. |
---|
3845 | |
---|
3846 | The following options are provided: |
---|
3847 | |
---|
3848 | *-v* |
---|
3849 | Display configuration and progress of the format. |
---|
3850 | |
---|
3851 | *-s* |
---|
3852 | Set the block size in bytes. |
---|
3853 | |
---|
3854 | *-b* |
---|
3855 | The number of blocks in a group. The block count must be equal or less |
---|
3856 | than the number of bits in a block. |
---|
3857 | |
---|
3858 | *-i* |
---|
3859 | Number of inodes in a group. The inode count must be equal or less |
---|
3860 | than the number of bits in a block. |
---|
3861 | |
---|
3862 | *-I* |
---|
3863 | Initialise the inodes. The default is not to initialise the inodes and |
---|
3864 | to rely on the inode being initialised when allocated. Initialising |
---|
3865 | the inode table helps recovery if a problem appears. |
---|
3866 | |
---|
3867 | *-o* |
---|
3868 | Integer percentage of the media used by inodes. The default is 1%. |
---|
3869 | |
---|
3870 | *device* |
---|
3871 | Path of the device to format. |
---|
3872 | |
---|
3873 | **EXIT STATUS:** |
---|
3874 | |
---|
3875 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3876 | |
---|
3877 | **NOTES:** |
---|
3878 | |
---|
3879 | NONE |
---|
3880 | |
---|
3881 | **EXAMPLES:** |
---|
3882 | |
---|
3883 | The following is an example of how to use ``mkrfs``: |
---|
3884 | .. code:: c |
---|
3885 | |
---|
3886 | SHLL \[/] $ mkrfs /dev/fdda |
---|
3887 | |
---|
3888 | **CONFIGURATION:** |
---|
3889 | |
---|
3890 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MKRFS |
---|
3891 | .. index:: CONFIGURE_SHELL_COMMAND_MKRFS |
---|
3892 | |
---|
3893 | This command is included in the default shell command set. |
---|
3894 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MKRFS`` to have this |
---|
3895 | command included. |
---|
3896 | |
---|
3897 | This command can be excluded from the shell command set by |
---|
3898 | defining ``CONFIGURE_SHELL_NO_COMMAND_MKRFS`` when all |
---|
3899 | shell commands have been configured. |
---|
3900 | |
---|
3901 | **PROGRAMMING INFORMATION:** |
---|
3902 | |
---|
3903 | .. index:: rtems_shell_rtems_main_mkrfs |
---|
3904 | |
---|
3905 | The ``mkrfs`` command is implemented by a C language function which |
---|
3906 | has the following prototype: |
---|
3907 | .. code:: c |
---|
3908 | |
---|
3909 | int rtems_shell_rtems_main_mkrfs( |
---|
3910 | int argc, |
---|
3911 | char \**argv |
---|
3912 | ); |
---|
3913 | |
---|
3914 | The configuration structure for ``mkrfs`` has the following |
---|
3915 | prototype: |
---|
3916 | .. code:: c |
---|
3917 | |
---|
3918 | extern rtems_shell_cmd_t rtems_shell_MKRFS_Command; |
---|
3919 | |
---|
3920 | mount - mount disk |
---|
3921 | ------------------ |
---|
3922 | .. index:: mount |
---|
3923 | |
---|
3924 | **SYNOPSYS:** |
---|
3925 | |
---|
3926 | .. code:: c |
---|
3927 | |
---|
3928 | mount \[-t fstype] \[-r] \[-L] device path |
---|
3929 | |
---|
3930 | **DESCRIPTION:** |
---|
3931 | |
---|
3932 | The ``mount`` command will mount a block device to a mount point |
---|
3933 | using the specified file system. The files systems are: |
---|
3934 | |
---|
3935 | - msdos - MSDOS File System |
---|
3936 | |
---|
3937 | - tftp - TFTP Network File System |
---|
3938 | |
---|
3939 | - ftp - FTP Network File System |
---|
3940 | |
---|
3941 | - nfs - Network File System |
---|
3942 | |
---|
3943 | - rfs - RTEMS File System |
---|
3944 | |
---|
3945 | When the file system type is âmsdosâ or ârfsâ the driver is a "block |
---|
3946 | device driver" node present in the file system. The driver is ignored |
---|
3947 | with the âtftpâ and âftpâ file systems. For the ânfsâ file system the |
---|
3948 | driver is the âhost:/pathâ string that described NFS host and the |
---|
3949 | exported file system path. |
---|
3950 | |
---|
3951 | **EXIT STATUS:** |
---|
3952 | |
---|
3953 | This command returns 0 on success and non-zero if an error is encountered. |
---|
3954 | |
---|
3955 | **NOTES:** |
---|
3956 | |
---|
3957 | The mount point must exist. |
---|
3958 | |
---|
3959 | The services offered by each file-system vary. For example you cannot list the |
---|
3960 | directory of a TFTP file-system as this server is not provided in the TFTP |
---|
3961 | protocol. You need to check each file-systemâs documentation for the services |
---|
3962 | provided. |
---|
3963 | |
---|
3964 | **EXAMPLES:** |
---|
3965 | |
---|
3966 | Mount the Flash Disk driver to the â/fdâ mount point: |
---|
3967 | .. code:: c |
---|
3968 | |
---|
3969 | SHLL \[/] $ mount -t msdos /dev/flashdisk0 /fd |
---|
3970 | |
---|
3971 | Mount the NFS file system exported path âbarâ by host âfooâ: |
---|
3972 | .. code:: c |
---|
3973 | |
---|
3974 | $ mount -t nfs foo:/bar /nfs |
---|
3975 | |
---|
3976 | Mount the TFTP file system on â/tftpâ: |
---|
3977 | .. code:: c |
---|
3978 | |
---|
3979 | $ mount -t tftp /tftp |
---|
3980 | |
---|
3981 | To access the TFTP files on server â10.10.10.10â: |
---|
3982 | .. code:: c |
---|
3983 | |
---|
3984 | $ cat /tftp/10.10.10.10/test.txt |
---|
3985 | |
---|
3986 | **CONFIGURATION:** |
---|
3987 | |
---|
3988 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MOUNT |
---|
3989 | .. index:: CONFIGURE_SHELL_COMMAND_MOUNT |
---|
3990 | |
---|
3991 | This command is included in the default shell command set. |
---|
3992 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MOUNT`` to have this |
---|
3993 | command included. |
---|
3994 | |
---|
3995 | This command can be excluded from the shell command set by |
---|
3996 | defining ``CONFIGURE_SHELL_NO_COMMAND_MOUNT`` when all |
---|
3997 | shell commands have been configured. |
---|
3998 | |
---|
3999 | The mount command includes references to file-system code. If you do not wish |
---|
4000 | to include file-system that you do not use do not define the mount command |
---|
4001 | support for that file-system. The file-system mount command defines are: |
---|
4002 | |
---|
4003 | - msdos - CONFIGURE_SHELL_MOUNT_MSDOS |
---|
4004 | |
---|
4005 | - tftp - CONFIGURE_SHELL_MOUNT_TFTP |
---|
4006 | |
---|
4007 | - ftp - CONFIGURE_SHELL_MOUNT_FTP |
---|
4008 | |
---|
4009 | - nfs - CONFIGURE_SHELL_MOUNT_NFS |
---|
4010 | |
---|
4011 | - rfs - CONFIGURE_SHELL_MOUNT_RFS |
---|
4012 | |
---|
4013 | An example configuration is: |
---|
4014 | .. code:: c |
---|
4015 | |
---|
4016 | #define CONFIGURE_SHELL_MOUNT_MSDOS |
---|
4017 | #ifdef RTEMS_NETWORKING |
---|
4018 | #define CONFIGURE_SHELL_MOUNT_TFTP |
---|
4019 | #define CONFIGURE_SHELL_MOUNT_FTP |
---|
4020 | #define CONFIGURE_SHELL_MOUNT_NFS |
---|
4021 | #define CONFIGURE_SHELL_MOUNT_RFS |
---|
4022 | #endif |
---|
4023 | |
---|
4024 | **PROGRAMMING INFORMATION:** |
---|
4025 | |
---|
4026 | .. index:: rtems_shell_rtems_main_mount |
---|
4027 | |
---|
4028 | The ``mount`` is implemented by a C language function |
---|
4029 | which has the following prototype: |
---|
4030 | .. code:: c |
---|
4031 | |
---|
4032 | int rtems_shell_rtems_main_mount( |
---|
4033 | int argc, |
---|
4034 | char \**argv |
---|
4035 | ); |
---|
4036 | |
---|
4037 | The configuration structure for the ``mount`` has the |
---|
4038 | following prototype: |
---|
4039 | .. code:: c |
---|
4040 | |
---|
4041 | extern rtems_shell_cmd_t rtems_shell_MOUNT_Command; |
---|
4042 | |
---|
4043 | mv - move files |
---|
4044 | --------------- |
---|
4045 | .. index:: mv |
---|
4046 | |
---|
4047 | **SYNOPSYS:** |
---|
4048 | |
---|
4049 | .. code:: c |
---|
4050 | |
---|
4051 | mv \[-fiv] source_file target_file |
---|
4052 | mv \[-fiv] source_file... target_file |
---|
4053 | |
---|
4054 | **DESCRIPTION:** |
---|
4055 | |
---|
4056 | In its first form, the mv utility renames the file named by the source |
---|
4057 | operand to the destination path named by the target operand. This |
---|
4058 | form is assumed when the last operand does not name an already |
---|
4059 | existing directory. |
---|
4060 | |
---|
4061 | In its second form, mv moves each file named by a source operand to a |
---|
4062 | destination file in the existing directory named by the directory |
---|
4063 | operand. The destination path for each operand is the pathname |
---|
4064 | produced by the concatenation of the last operand, a slash, and the |
---|
4065 | final pathname component of the named file. |
---|
4066 | |
---|
4067 | The following options are available: |
---|
4068 | |
---|
4069 | *-f* |
---|
4070 | Do not prompt for confirmation before overwriting the destination |
---|
4071 | path. |
---|
4072 | |
---|
4073 | *-i* |
---|
4074 | Causes mv to write a prompt to standard error before moving a file |
---|
4075 | that would overwrite an existing file. If the response from the |
---|
4076 | standard input begins with the character âyâ, the move is attempted. |
---|
4077 | |
---|
4078 | *-v* |
---|
4079 | Cause mv to be verbose, showing files as they are processed. |
---|
4080 | |
---|
4081 | The last of any -f or -i options is the one which affects mvâs |
---|
4082 | behavior. |
---|
4083 | |
---|
4084 | It is an error for any of the source operands to specify a nonexistent |
---|
4085 | file or directory. |
---|
4086 | |
---|
4087 | It is an error for the source operand to specify a directory if the |
---|
4088 | target exists and is not a directory. |
---|
4089 | |
---|
4090 | If the destination path does not have a mode which permits writing, mv |
---|
4091 | prompts the user for confirmation as specified for the -i option. |
---|
4092 | |
---|
4093 | Should the *rename* call fail because source and target are on |
---|
4094 | different file systems, ``mv`` will remove the destination file, |
---|
4095 | copy the source file to the destination, and then remove the source. |
---|
4096 | The effect is roughly equivalent to: |
---|
4097 | .. code:: c |
---|
4098 | |
---|
4099 | rm -f destination_path && \\ |
---|
4100 | cp -PRp source_file destination_path && \\ |
---|
4101 | rm -rf source_file |
---|
4102 | |
---|
4103 | **EXIT STATUS:** |
---|
4104 | |
---|
4105 | The ``mv`` utility exits 0 on success, and >0 if an error occurs. |
---|
4106 | |
---|
4107 | **NOTES:** |
---|
4108 | |
---|
4109 | NONE |
---|
4110 | |
---|
4111 | **EXAMPLES:** |
---|
4112 | |
---|
4113 | .. code:: c |
---|
4114 | |
---|
4115 | SHLL \[/] mv /dev/console /dev/con1 |
---|
4116 | |
---|
4117 | **CONFIGURATION:** |
---|
4118 | |
---|
4119 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MV |
---|
4120 | .. index:: CONFIGURE_SHELL_COMMAND_MV |
---|
4121 | |
---|
4122 | This command is included in the default shell command set. When |
---|
4123 | building a custom command set, define``CONFIGURE_SHELL_COMMAND_MV`` to have this command included. |
---|
4124 | |
---|
4125 | This command can be excluded from the shell command set by |
---|
4126 | defining ``CONFIGURE_SHELL_NO_COMMAND_MV`` when all |
---|
4127 | shell commands have been configured. |
---|
4128 | |
---|
4129 | **PROGRAMMING INFORMATION:** |
---|
4130 | |
---|
4131 | .. index:: rtems_shell_main_mv |
---|
4132 | |
---|
4133 | The ``mv`` command is implemented by a C language function which |
---|
4134 | has the following prototype: |
---|
4135 | .. code:: c |
---|
4136 | |
---|
4137 | int rtems_shell_main_mv( |
---|
4138 | int argc, |
---|
4139 | char \**argv |
---|
4140 | ); |
---|
4141 | |
---|
4142 | The configuration structure for the ``mv`` has the |
---|
4143 | following prototype: |
---|
4144 | .. code:: c |
---|
4145 | |
---|
4146 | extern rtems_shell_cmd_t rtems_shell_MV_Command; |
---|
4147 | |
---|
4148 | **ORIGIN:** |
---|
4149 | |
---|
4150 | The implementation and portions of the documentation for this command |
---|
4151 | are from NetBSD 4.0. |
---|
4152 | |
---|
4153 | pwd - print work directory |
---|
4154 | -------------------------- |
---|
4155 | .. index:: pwd |
---|
4156 | |
---|
4157 | **SYNOPSYS:** |
---|
4158 | |
---|
4159 | .. code:: c |
---|
4160 | |
---|
4161 | pwd |
---|
4162 | |
---|
4163 | **DESCRIPTION:** |
---|
4164 | |
---|
4165 | This command prints the fully qualified filename of the current |
---|
4166 | working directory. |
---|
4167 | |
---|
4168 | **EXIT STATUS:** |
---|
4169 | |
---|
4170 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4171 | |
---|
4172 | **NOTES:** |
---|
4173 | |
---|
4174 | NONE |
---|
4175 | |
---|
4176 | **EXAMPLES:** |
---|
4177 | |
---|
4178 | The following is an example of how to use ``pwd``: |
---|
4179 | .. code:: c |
---|
4180 | |
---|
4181 | SHLL \[/] $ pwd |
---|
4182 | / |
---|
4183 | SHLL \[/] $ cd dev |
---|
4184 | SHLL \[/dev] $ pwd |
---|
4185 | /dev |
---|
4186 | |
---|
4187 | **CONFIGURATION:** |
---|
4188 | |
---|
4189 | .. index:: CONFIGURE_SHELL_NO_COMMAND_PWD |
---|
4190 | .. index:: CONFIGURE_SHELL_COMMAND_PWD |
---|
4191 | |
---|
4192 | This command is included in the default shell command set. |
---|
4193 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_PWD`` to have this |
---|
4194 | command included. |
---|
4195 | |
---|
4196 | This command can be excluded from the shell command set by |
---|
4197 | defining ``CONFIGURE_SHELL_NO_COMMAND_PWD`` when all |
---|
4198 | shell commands have been configured. |
---|
4199 | |
---|
4200 | **PROGRAMMING INFORMATION:** |
---|
4201 | |
---|
4202 | .. index:: rtems_shell_rtems_main_pwd |
---|
4203 | |
---|
4204 | The ``pwd`` is implemented by a C language function |
---|
4205 | which has the following prototype: |
---|
4206 | .. code:: c |
---|
4207 | |
---|
4208 | int rtems_shell_rtems_main_pwd( |
---|
4209 | int argc, |
---|
4210 | char \**argv |
---|
4211 | ); |
---|
4212 | |
---|
4213 | The configuration structure for the ``pwd`` has the |
---|
4214 | following prototype: |
---|
4215 | .. code:: c |
---|
4216 | |
---|
4217 | extern rtems_shell_cmd_t rtems_shell_PWD_Command; |
---|
4218 | |
---|
4219 | rmdir - remove empty directories |
---|
4220 | -------------------------------- |
---|
4221 | .. index:: rmdir |
---|
4222 | |
---|
4223 | **SYNOPSYS:** |
---|
4224 | |
---|
4225 | .. code:: c |
---|
4226 | |
---|
4227 | rmdir \[dir1 .. dirN] |
---|
4228 | |
---|
4229 | **DESCRIPTION:** |
---|
4230 | |
---|
4231 | This command removes the specified set of directories. If no |
---|
4232 | directories are provided on the command line, no actions are taken. |
---|
4233 | |
---|
4234 | **EXIT STATUS:** |
---|
4235 | |
---|
4236 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4237 | |
---|
4238 | **NOTES:** |
---|
4239 | |
---|
4240 | This command is a implemented using the ``rmdir(2)`` system |
---|
4241 | call and all reasons that call may fail apply to this command. |
---|
4242 | |
---|
4243 | **EXAMPLES:** |
---|
4244 | |
---|
4245 | The following is an example of how to use ``rmdir``: |
---|
4246 | .. code:: c |
---|
4247 | |
---|
4248 | SHLL \[/] # mkdir joeldir |
---|
4249 | SHLL \[/] # rmdir joeldir |
---|
4250 | SHLL \[/] # ls joeldir |
---|
4251 | joeldir: No such file or directory. |
---|
4252 | |
---|
4253 | **CONFIGURATION:** |
---|
4254 | |
---|
4255 | .. index:: CONFIGURE_SHELL_NO_COMMAND_RMDIR |
---|
4256 | .. index:: CONFIGURE_SHELL_COMMAND_RMDIR |
---|
4257 | |
---|
4258 | This command is included in the default shell command set. |
---|
4259 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_RMDIR`` to have this |
---|
4260 | command included. |
---|
4261 | |
---|
4262 | This command can be excluded from the shell command set by |
---|
4263 | defining ``CONFIGURE_SHELL_NO_COMMAND_RMDIR`` when all |
---|
4264 | shell commands have been configured. |
---|
4265 | |
---|
4266 | **PROGRAMMING INFORMATION:** |
---|
4267 | |
---|
4268 | .. index:: rtems_shell_rtems_main_rmdir |
---|
4269 | |
---|
4270 | The ``rmdir`` is implemented by a C language function |
---|
4271 | which has the following prototype: |
---|
4272 | .. code:: c |
---|
4273 | |
---|
4274 | int rtems_shell_rtems_main_rmdir( |
---|
4275 | int argc, |
---|
4276 | char \**argv |
---|
4277 | ); |
---|
4278 | |
---|
4279 | The configuration structure for the ``rmdir`` has the |
---|
4280 | following prototype: |
---|
4281 | .. code:: c |
---|
4282 | |
---|
4283 | extern rtems_shell_cmd_t rtems_shell_RMDIR_Command; |
---|
4284 | |
---|
4285 | rm - remove files |
---|
4286 | ----------------- |
---|
4287 | .. index:: rm |
---|
4288 | |
---|
4289 | **SYNOPSYS:** |
---|
4290 | |
---|
4291 | .. code:: c |
---|
4292 | |
---|
4293 | rm file1 \[file2 ... fileN] |
---|
4294 | |
---|
4295 | **DESCRIPTION:** |
---|
4296 | |
---|
4297 | This command deletes a name from the filesystem. If the specified file name |
---|
4298 | was the last link to a file and there are no ``open`` file descriptor |
---|
4299 | references to that file, then it is deleted and the associated space in |
---|
4300 | the file system is made available for subsequent use. |
---|
4301 | |
---|
4302 | If the filename specified was the last link to a file but there |
---|
4303 | are open file descriptor references to it, then the file will |
---|
4304 | remain in existence until the last file descriptor referencing |
---|
4305 | it is closed. |
---|
4306 | |
---|
4307 | **EXIT STATUS:** |
---|
4308 | |
---|
4309 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4310 | |
---|
4311 | **NOTES:** |
---|
4312 | |
---|
4313 | NONE |
---|
4314 | |
---|
4315 | **EXAMPLES:** |
---|
4316 | |
---|
4317 | The following is an example of how to use ``rm``: |
---|
4318 | .. code:: c |
---|
4319 | |
---|
4320 | SHLL \[/] # cp /etc/passwd tmpfile |
---|
4321 | SHLL \[/] # cat tmpfile |
---|
4322 | root:\*:0:0:root::/:/bin/sh |
---|
4323 | rtems:\*:1:1:RTEMS Application::/:/bin/sh |
---|
4324 | tty:!:2:2:tty owner::/:/bin/false |
---|
4325 | SHLL \[/] # rm tmpfile |
---|
4326 | SHLL \[/] # cat tmpfile |
---|
4327 | cat: tmpfile: No such file or directory |
---|
4328 | |
---|
4329 | **CONFIGURATION:** |
---|
4330 | |
---|
4331 | .. index:: CONFIGURE_SHELL_NO_COMMAND_RM |
---|
4332 | .. index:: CONFIGURE_SHELL_COMMAND_RM |
---|
4333 | |
---|
4334 | This command is included in the default shell command set. |
---|
4335 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_RM`` to have this |
---|
4336 | command included. |
---|
4337 | |
---|
4338 | This command can be excluded from the shell command set by |
---|
4339 | defining ``CONFIGURE_SHELL_NO_COMMAND_RM`` when all |
---|
4340 | shell commands have been configured. |
---|
4341 | |
---|
4342 | **PROGRAMMING INFORMATION:** |
---|
4343 | |
---|
4344 | .. index:: rtems_shell_main_rm |
---|
4345 | |
---|
4346 | The ``rm`` is implemented by a C language function |
---|
4347 | which has the following prototype: |
---|
4348 | .. code:: c |
---|
4349 | |
---|
4350 | int rtems_shell_main_rm( |
---|
4351 | int argc, |
---|
4352 | char \**argv |
---|
4353 | ); |
---|
4354 | |
---|
4355 | The configuration structure for the ``rm`` has the |
---|
4356 | following prototype: |
---|
4357 | .. code:: c |
---|
4358 | |
---|
4359 | extern rtems_shell_cmd_t rtems_shell_RM_Command; |
---|
4360 | |
---|
4361 | umask - set file mode creation mask |
---|
4362 | ----------------------------------- |
---|
4363 | .. index:: umask |
---|
4364 | |
---|
4365 | **SYNOPSYS:** |
---|
4366 | |
---|
4367 | .. code:: c |
---|
4368 | |
---|
4369 | umask \[new_umask] |
---|
4370 | |
---|
4371 | **DESCRIPTION:** |
---|
4372 | |
---|
4373 | This command sets the user file creation mask to ``new_umask``. The |
---|
4374 | argument ``new_umask`` may be octal, hexadecimal, or decimal. |
---|
4375 | |
---|
4376 | **EXIT STATUS:** |
---|
4377 | |
---|
4378 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4379 | |
---|
4380 | **NOTES:** |
---|
4381 | |
---|
4382 | This command does not currently support symbolic mode masks. |
---|
4383 | |
---|
4384 | **EXAMPLES:** |
---|
4385 | |
---|
4386 | The following is an example of how to use ``umask``: |
---|
4387 | .. code:: c |
---|
4388 | |
---|
4389 | SHLL \[/] $ umask |
---|
4390 | 022 |
---|
4391 | SHLL \[/] $ umask 0666 |
---|
4392 | 0666 |
---|
4393 | SHLL \[/] $ umask |
---|
4394 | 0666 |
---|
4395 | |
---|
4396 | **CONFIGURATION:** |
---|
4397 | |
---|
4398 | .. index:: CONFIGURE_SHELL_NO_COMMAND_UMASK |
---|
4399 | .. index:: CONFIGURE_SHELL_COMMAND_UMASK |
---|
4400 | |
---|
4401 | This command is included in the default shell command set. |
---|
4402 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_UMASK`` to have this |
---|
4403 | command included. |
---|
4404 | |
---|
4405 | This command can be excluded from the shell command set by |
---|
4406 | defining ``CONFIGURE_SHELL_NO_COMMAND_UMASK`` when all |
---|
4407 | shell commands have been configured. |
---|
4408 | |
---|
4409 | **PROGRAMMING INFORMATION:** |
---|
4410 | |
---|
4411 | .. index:: rtems_shell_rtems_main_umask |
---|
4412 | |
---|
4413 | The ``umask`` is implemented by a C language function |
---|
4414 | which has the following prototype: |
---|
4415 | .. code:: c |
---|
4416 | |
---|
4417 | int rtems_shell_rtems_main_umask( |
---|
4418 | int argc, |
---|
4419 | char \**argv |
---|
4420 | ); |
---|
4421 | |
---|
4422 | The configuration structure for the ``umask`` has the |
---|
4423 | following prototype: |
---|
4424 | .. code:: c |
---|
4425 | |
---|
4426 | extern rtems_shell_cmd_t rtems_shell_UMASK_Command; |
---|
4427 | |
---|
4428 | unmount - unmount disk |
---|
4429 | ---------------------- |
---|
4430 | .. index:: unmount |
---|
4431 | |
---|
4432 | **SYNOPSYS:** |
---|
4433 | |
---|
4434 | .. code:: c |
---|
4435 | |
---|
4436 | unmount path |
---|
4437 | |
---|
4438 | **DESCRIPTION:** |
---|
4439 | |
---|
4440 | This command unmounts the device at the specified ``path``. |
---|
4441 | |
---|
4442 | **EXIT STATUS:** |
---|
4443 | |
---|
4444 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4445 | |
---|
4446 | **NOTES:** |
---|
4447 | |
---|
4448 | TBD - Surely there must be some warnings to go here. |
---|
4449 | |
---|
4450 | **EXAMPLES:** |
---|
4451 | |
---|
4452 | The following is an example of how to use ``unmount``: |
---|
4453 | .. code:: c |
---|
4454 | |
---|
4455 | EXAMPLE_TBD |
---|
4456 | |
---|
4457 | **CONFIGURATION:** |
---|
4458 | |
---|
4459 | .. index:: CONFIGURE_SHELL_NO_COMMAND_UNMOUNT |
---|
4460 | .. index:: CONFIGURE_SHELL_COMMAND_UNMOUNT |
---|
4461 | |
---|
4462 | This command is included in the default shell command set. |
---|
4463 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_UNMOUNT`` to have this |
---|
4464 | command included. |
---|
4465 | |
---|
4466 | This command can be excluded from the shell command set by |
---|
4467 | defining ``CONFIGURE_SHELL_NO_COMMAND_UNMOUNT`` when all |
---|
4468 | shell commands have been configured. |
---|
4469 | |
---|
4470 | **PROGRAMMING INFORMATION:** |
---|
4471 | |
---|
4472 | .. index:: rtems_shell_rtems_main_unmount |
---|
4473 | |
---|
4474 | The ``unmount`` is implemented by a C language function |
---|
4475 | which has the following prototype: |
---|
4476 | .. code:: c |
---|
4477 | |
---|
4478 | int rtems_shell_rtems_main_unmount( |
---|
4479 | int argc, |
---|
4480 | char \**argv |
---|
4481 | ); |
---|
4482 | |
---|
4483 | The configuration structure for the ``unmount`` has the |
---|
4484 | following prototype: |
---|
4485 | .. code:: c |
---|
4486 | |
---|
4487 | extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command; |
---|
4488 | |
---|
4489 | .. COMMENT: COPYRIGHT (c) 1988-2012. |
---|
4490 | |
---|
4491 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
4492 | |
---|
4493 | .. COMMENT: All rights reserved. |
---|
4494 | |
---|
4495 | Memory Commands |
---|
4496 | ############### |
---|
4497 | |
---|
4498 | Introduction |
---|
4499 | ============ |
---|
4500 | |
---|
4501 | The RTEMS shell has the following memory commands: |
---|
4502 | |
---|
4503 | - ``mdump`` - Display contents of memory |
---|
4504 | |
---|
4505 | - ``wdump`` - Display contents of memory (word) |
---|
4506 | |
---|
4507 | - ``ldump`` - Display contents of memory (longword) |
---|
4508 | |
---|
4509 | - ``medit`` - Modify contents of memory |
---|
4510 | |
---|
4511 | - ``mfill`` - File memory with pattern |
---|
4512 | |
---|
4513 | - ``mmove`` - Move contents of memory |
---|
4514 | |
---|
4515 | - ``malloc`` - Obtain information on C Program Heap |
---|
4516 | |
---|
4517 | Commands |
---|
4518 | ======== |
---|
4519 | |
---|
4520 | This section details the Memory Commands available. A |
---|
4521 | subsection is dedicated to each of the commands and |
---|
4522 | describes the behavior and configuration of that |
---|
4523 | command as well as providing an example usage. |
---|
4524 | |
---|
4525 | mdump - display contents of memory |
---|
4526 | ---------------------------------- |
---|
4527 | .. index:: mdump |
---|
4528 | |
---|
4529 | **SYNOPSYS:** |
---|
4530 | |
---|
4531 | .. code:: c |
---|
4532 | |
---|
4533 | mdump \[address \[length \[size]]] |
---|
4534 | |
---|
4535 | **DESCRIPTION:** |
---|
4536 | |
---|
4537 | This command displays the contents of memory at the ``address`` |
---|
4538 | and ``length`` in ``size`` byte units specified on the command line. |
---|
4539 | |
---|
4540 | When ``size`` is not provided, it defaults to ``1`` byte units. |
---|
4541 | Values of ``1``, ``2``, and ``4`` are valid; all others will |
---|
4542 | cause an error to be reported. |
---|
4543 | |
---|
4544 | When ``length`` is not provided, it defaults to ``320`` which |
---|
4545 | is twenty lines of output with sixteen bytes of output per line. |
---|
4546 | |
---|
4547 | When ``address`` is not provided, it defaults to ``0x00000000``. |
---|
4548 | |
---|
4549 | **EXIT STATUS:** |
---|
4550 | |
---|
4551 | This command always returns 0 to indicate success. |
---|
4552 | |
---|
4553 | **NOTES:** |
---|
4554 | |
---|
4555 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
4556 | program fault. |
---|
4557 | |
---|
4558 | **EXAMPLES:** |
---|
4559 | |
---|
4560 | The following is an example of how to use ``mdump``: |
---|
4561 | .. code:: c |
---|
4562 | |
---|
4563 | SHLL \[/] $ mdump 0x10000 32 |
---|
4564 | 0x0001000000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ |
---|
4565 | 0x0001001000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ |
---|
4566 | SHLL \[/] $ mdump 0x02000000 32 |
---|
4567 | 0x02000000A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!. |
---|
4568 | 0x02000010A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!. |
---|
4569 | SHLL \[/] $ mdump 0x02001000 32 |
---|
4570 | 0x0200100003 00 80 00 82 10 60 00-81 98 40 00 83 48 00 00 ......`.....H.. |
---|
4571 | 0x0200101084 00 60 01 84 08 A0 07-86 10 20 01 87 28 C0 02 ..`....... ..(.. |
---|
4572 | |
---|
4573 | **CONFIGURATION:** |
---|
4574 | |
---|
4575 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MDUMP |
---|
4576 | .. index:: CONFIGURE_SHELL_COMMAND_MDUMP |
---|
4577 | |
---|
4578 | This command is included in the default shell command set. |
---|
4579 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MDUMP`` to have this |
---|
4580 | command included. |
---|
4581 | |
---|
4582 | This command can be excluded from the shell command set by |
---|
4583 | defining ``CONFIGURE_SHELL_NO_COMMAND_MDUMP`` when all |
---|
4584 | shell commands have been configured. |
---|
4585 | |
---|
4586 | **PROGRAMMING INFORMATION:** |
---|
4587 | |
---|
4588 | .. index:: rtems_shell_rtems_main_mdump |
---|
4589 | |
---|
4590 | The ``mdump`` is implemented by a C language function |
---|
4591 | which has the following prototype: |
---|
4592 | .. code:: c |
---|
4593 | |
---|
4594 | int rtems_shell_rtems_main_mdump( |
---|
4595 | int argc, |
---|
4596 | char \**argv |
---|
4597 | ); |
---|
4598 | |
---|
4599 | The configuration structure for the ``mdump`` has the |
---|
4600 | following prototype: |
---|
4601 | .. code:: c |
---|
4602 | |
---|
4603 | extern rtems_shell_cmd_t rtems_shell_MDUMP_Command; |
---|
4604 | |
---|
4605 | wdump - display contents of memory (word) |
---|
4606 | ----------------------------------------- |
---|
4607 | .. index:: wdump |
---|
4608 | |
---|
4609 | **SYNOPSYS:** |
---|
4610 | |
---|
4611 | .. code:: c |
---|
4612 | |
---|
4613 | wdump \[address \[length]] |
---|
4614 | |
---|
4615 | **DESCRIPTION:** |
---|
4616 | |
---|
4617 | This command displays the contents of memory at the ``address`` |
---|
4618 | and ``length`` in bytes specified on the command line. |
---|
4619 | |
---|
4620 | This command is equivalent to ``mdump address length 2``. |
---|
4621 | |
---|
4622 | When ``length`` is not provided, it defaults to ``320`` which |
---|
4623 | is twenty lines of output with eight words of output per line. |
---|
4624 | |
---|
4625 | When ``address`` is not provided, it defaults to ``0x00000000``. |
---|
4626 | |
---|
4627 | **EXIT STATUS:** |
---|
4628 | |
---|
4629 | This command always returns 0 to indicate success. |
---|
4630 | |
---|
4631 | **NOTES:** |
---|
4632 | |
---|
4633 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
4634 | program fault. |
---|
4635 | |
---|
4636 | **EXAMPLES:** |
---|
4637 | |
---|
4638 | The following is an example of how to use ``wdump``: |
---|
4639 | .. code:: c |
---|
4640 | |
---|
4641 | SHLL \[/] $ wdump 0x02010000 32 |
---|
4642 | 0x02010000 0201 08D8 0201 08C0-0201 08AC 0201 0874 ...............t |
---|
4643 | 0x02010010 0201 0894 0201 0718-0201 0640 0201 0798 ............... |
---|
4644 | |
---|
4645 | **CONFIGURATION:** |
---|
4646 | |
---|
4647 | .. index:: CONFIGURE_SHELL_NO_COMMAND_WDUMP |
---|
4648 | .. index:: CONFIGURE_SHELL_COMMAND_WDUMP |
---|
4649 | |
---|
4650 | This command is included in the default shell command set. |
---|
4651 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_WDUMP`` to have this |
---|
4652 | command included. |
---|
4653 | |
---|
4654 | This command can be excluded from the shell command set by |
---|
4655 | defining ``CONFIGURE_SHELL_NO_COMMAND_WDUMP`` when all |
---|
4656 | shell commands have been configured. |
---|
4657 | |
---|
4658 | **PROGRAMMING INFORMATION:** |
---|
4659 | |
---|
4660 | .. index:: rtems_shell_rtems_main_wdump |
---|
4661 | |
---|
4662 | The ``wdump`` is implemented by a C language function |
---|
4663 | which has the following prototype: |
---|
4664 | .. code:: c |
---|
4665 | |
---|
4666 | int rtems_shell_rtems_main_wdump( |
---|
4667 | int argc, |
---|
4668 | char \**argv |
---|
4669 | ); |
---|
4670 | |
---|
4671 | The configuration structure for the ``wdump`` has the |
---|
4672 | following prototype: |
---|
4673 | .. code:: c |
---|
4674 | |
---|
4675 | extern rtems_shell_cmd_t rtems_shell_WDUMP_Command; |
---|
4676 | |
---|
4677 | ldump - display contents of memory (longword) |
---|
4678 | --------------------------------------------- |
---|
4679 | .. index:: ldump |
---|
4680 | |
---|
4681 | **SYNOPSYS:** |
---|
4682 | |
---|
4683 | .. code:: c |
---|
4684 | |
---|
4685 | ldump \[address \[length]] |
---|
4686 | |
---|
4687 | **DESCRIPTION:** |
---|
4688 | |
---|
4689 | This command displays the contents of memory at the ``address`` |
---|
4690 | and ``length`` in bytes specified on the command line. |
---|
4691 | |
---|
4692 | This command is equivalent to ``mdump address length 4``. |
---|
4693 | |
---|
4694 | When ``length`` is not provided, it defaults to ``320`` which |
---|
4695 | is twenty lines of output with four longwords of output per line. |
---|
4696 | |
---|
4697 | When ``address`` is not provided, it defaults to ``0x00000000``. |
---|
4698 | |
---|
4699 | **EXIT STATUS:** |
---|
4700 | |
---|
4701 | This command always returns 0 to indicate success. |
---|
4702 | |
---|
4703 | **NOTES:** |
---|
4704 | |
---|
4705 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
4706 | program fault. |
---|
4707 | |
---|
4708 | **EXAMPLES:** |
---|
4709 | |
---|
4710 | The following is an example of how to use ``ldump``: |
---|
4711 | .. code:: c |
---|
4712 | |
---|
4713 | SHLL \[/] $ ldump 0x02010000 32 |
---|
4714 | 0x02010000 020108D8 020108C0-020108AC 02010874 ...............t |
---|
4715 | 0x02010010 020 0894 02010718-02010640 02010798 ............... |
---|
4716 | |
---|
4717 | **CONFIGURATION:** |
---|
4718 | |
---|
4719 | .. index:: CONFIGURE_SHELL_NO_COMMAND_LDUMP |
---|
4720 | .. index:: CONFIGURE_SHELL_COMMAND_LDUMP |
---|
4721 | |
---|
4722 | This command is included in the default shell command set. |
---|
4723 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_LDUMP`` to have this |
---|
4724 | command included. |
---|
4725 | |
---|
4726 | This command can be excluded from the shell command set by |
---|
4727 | defining ``CONFIGURE_SHELL_NO_COMMAND_LDUMP`` when all |
---|
4728 | shell commands have been configured. |
---|
4729 | |
---|
4730 | **PROGRAMMING INFORMATION:** |
---|
4731 | |
---|
4732 | .. index:: rtems_shell_rtems_main_ldump |
---|
4733 | |
---|
4734 | The ``ldump`` is implemented by a C language function |
---|
4735 | which has the following prototype: |
---|
4736 | .. code:: c |
---|
4737 | |
---|
4738 | int rtems_shell_rtems_main_ldump( |
---|
4739 | int argc, |
---|
4740 | char \**argv |
---|
4741 | ); |
---|
4742 | |
---|
4743 | The configuration structure for the ``ldump`` has the |
---|
4744 | following prototype: |
---|
4745 | .. code:: c |
---|
4746 | |
---|
4747 | extern rtems_shell_cmd_t rtems_shell_LDUMP_Command; |
---|
4748 | |
---|
4749 | medit - modify contents of memory |
---|
4750 | --------------------------------- |
---|
4751 | .. index:: medit |
---|
4752 | |
---|
4753 | **SYNOPSYS:** |
---|
4754 | |
---|
4755 | .. code:: c |
---|
4756 | |
---|
4757 | medit address value1 \[value2 ... valueN] |
---|
4758 | |
---|
4759 | **DESCRIPTION:** |
---|
4760 | |
---|
4761 | This command is used to modify the contents of the memory starting |
---|
4762 | at ``address`` using the octets specified by the parameters``value1`` through ``valueN``. |
---|
4763 | |
---|
4764 | **EXIT STATUS:** |
---|
4765 | |
---|
4766 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4767 | |
---|
4768 | **NOTES:** |
---|
4769 | |
---|
4770 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
4771 | program fault. |
---|
4772 | |
---|
4773 | **EXAMPLES:** |
---|
4774 | |
---|
4775 | The following is an example of how to use ``medit``: |
---|
4776 | .. code:: c |
---|
4777 | |
---|
4778 | SHLL \[/] $ mdump 0x02000000 32 |
---|
4779 | 0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!. |
---|
4780 | 0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!. |
---|
4781 | SHLL \[/] $ medit 0x02000000 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 |
---|
4782 | SHLL \[/] $ mdump 0x02000000 32 |
---|
4783 | 0x02000000 01 02 03 04 05 06 07 08-09 00 22 BC A6 10 21 00 .........."...!. |
---|
4784 | 0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!. |
---|
4785 | |
---|
4786 | **CONFIGURATION:** |
---|
4787 | |
---|
4788 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MEDIT |
---|
4789 | .. index:: CONFIGURE_SHELL_COMMAND_MEDIT |
---|
4790 | |
---|
4791 | This command is included in the default shell command set. |
---|
4792 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MEDIT`` to have this |
---|
4793 | command included. |
---|
4794 | |
---|
4795 | This command can be excluded from the shell command set by |
---|
4796 | defining ``CONFIGURE_SHELL_NO_COMMAND_MEDIT`` when all |
---|
4797 | shell commands have been configured. |
---|
4798 | |
---|
4799 | **PROGRAMMING INFORMATION:** |
---|
4800 | |
---|
4801 | .. index:: rtems_shell_rtems_main_medit |
---|
4802 | |
---|
4803 | The ``medit`` is implemented by a C language function |
---|
4804 | which has the following prototype: |
---|
4805 | .. code:: c |
---|
4806 | |
---|
4807 | int rtems_shell_rtems_main_medit( |
---|
4808 | int argc, |
---|
4809 | char \**argv |
---|
4810 | ); |
---|
4811 | |
---|
4812 | The configuration structure for the ``medit`` has the |
---|
4813 | following prototype: |
---|
4814 | .. code:: c |
---|
4815 | |
---|
4816 | extern rtems_shell_cmd_t rtems_shell_MEDIT_Command; |
---|
4817 | |
---|
4818 | mfill - file memory with pattern |
---|
4819 | -------------------------------- |
---|
4820 | .. index:: mfill |
---|
4821 | |
---|
4822 | **SYNOPSYS:** |
---|
4823 | |
---|
4824 | .. code:: c |
---|
4825 | |
---|
4826 | mfill address length value |
---|
4827 | |
---|
4828 | **DESCRIPTION:** |
---|
4829 | |
---|
4830 | This command is used to fill the memory starting at ``address`` |
---|
4831 | for the specified ``length`` in octets when the specified at``value``. |
---|
4832 | |
---|
4833 | **EXIT STATUS:** |
---|
4834 | |
---|
4835 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4836 | |
---|
4837 | **NOTES:** |
---|
4838 | |
---|
4839 | Filling a non-existent address range may result in an unrecoverable |
---|
4840 | program fault. Similarly overwriting interrupt vector tables, code |
---|
4841 | space or critical data areas can be fatal as shown in the example. |
---|
4842 | |
---|
4843 | **EXAMPLES:** |
---|
4844 | |
---|
4845 | In this example, the address used (``0x23d89a0``) as the base |
---|
4846 | address of the filled area is the end of the stack for the |
---|
4847 | Idle thread. This address was determined manually using gdb and |
---|
4848 | is very specific to this application and BSP. The first command |
---|
4849 | in this example is an ``mdump`` to display the initial contents |
---|
4850 | of this memory. We see that the first 8 bytes are 0xA5 which is |
---|
4851 | the pattern used as a guard by the Stack Checker. On |
---|
4852 | the first context switch after the pattern is overwritten |
---|
4853 | by the ``mfill`` command, the Stack Checker detect the pattern |
---|
4854 | has been corrupted and generates a fatal error. |
---|
4855 | .. code:: c |
---|
4856 | |
---|
4857 | SHLL \[/] $ mdump 0x23d89a0 16 |
---|
4858 | 0x023D89A0 A5 A5 A5 A5 A5 A5 A5 A5-FE ED F0 0D 0B AD 0D 06 ................ |
---|
4859 | SHLL \[/] $ mfill 0x23d89a0 13 0x5a |
---|
4860 | SHLL \[/] $ BLOWN STACK!!! Offending task(0x23D4418): id=0x09010001; name=0x0203D908 |
---|
4861 | stack covers range 0x23D89A0 - 0x23D99AF (4112 bytes) |
---|
4862 | Damaged pattern begins at 0x023D89A8 and is 16 bytes long |
---|
4863 | |
---|
4864 | **CONFIGURATION:** |
---|
4865 | |
---|
4866 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MFILL |
---|
4867 | .. index:: CONFIGURE_SHELL_COMMAND_MFILL |
---|
4868 | |
---|
4869 | This command is included in the default shell command set. |
---|
4870 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MFILL`` to have this |
---|
4871 | command included. |
---|
4872 | |
---|
4873 | This command can be excluded from the shell command set by |
---|
4874 | defining ``CONFIGURE_SHELL_NO_COMMAND_MFILL`` when all |
---|
4875 | shell commands have been configured. |
---|
4876 | |
---|
4877 | **PROGRAMMING INFORMATION:** |
---|
4878 | |
---|
4879 | .. index:: rtems_shell_rtems_main_mfill |
---|
4880 | |
---|
4881 | The ``mfill`` is implemented by a C language function |
---|
4882 | which has the following prototype: |
---|
4883 | .. code:: c |
---|
4884 | |
---|
4885 | int rtems_shell_rtems_main_mfill( |
---|
4886 | int argc, |
---|
4887 | char \**argv |
---|
4888 | ); |
---|
4889 | |
---|
4890 | The configuration structure for the ``mfill`` has the |
---|
4891 | following prototype: |
---|
4892 | .. code:: c |
---|
4893 | |
---|
4894 | extern rtems_shell_cmd_t rtems_shell_MFILL_Command; |
---|
4895 | |
---|
4896 | mmove - move contents of memory |
---|
4897 | ------------------------------- |
---|
4898 | .. index:: mmove |
---|
4899 | |
---|
4900 | **SYNOPSYS:** |
---|
4901 | |
---|
4902 | .. code:: c |
---|
4903 | |
---|
4904 | mmove dst src length |
---|
4905 | |
---|
4906 | **DESCRIPTION:** |
---|
4907 | |
---|
4908 | This command is used to copy the contents of the memory |
---|
4909 | starting at ``src`` to the memory located at ``dst`` |
---|
4910 | for the specified ``length`` in octets. |
---|
4911 | |
---|
4912 | **EXIT STATUS:** |
---|
4913 | |
---|
4914 | This command returns 0 on success and non-zero if an error is encountered. |
---|
4915 | |
---|
4916 | **NOTES:** |
---|
4917 | |
---|
4918 | NONE |
---|
4919 | |
---|
4920 | **EXAMPLES:** |
---|
4921 | |
---|
4922 | The following is an example of how to use ``mmove``: |
---|
4923 | .. code:: c |
---|
4924 | |
---|
4925 | SHLL \[/] $ mdump 0x023d99a0 16 |
---|
4926 | 0x023D99A0 A5 A5 A5 A5 A5 A5 A5 A5-A5 A5 A5 A5 A5 A5 A5 A5 ................ |
---|
4927 | SHLL \[/] $ mdump 0x02000000 16 |
---|
4928 | 0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!. |
---|
4929 | SHLL \[/] $ mmove 0x023d99a0 0x02000000 13 |
---|
4930 | SHLL \[/] $ mdump 0x023d99a0 16 |
---|
4931 | 0x023D99A0 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 A5 A5 A5 .H..)..3.."..... |
---|
4932 | |
---|
4933 | **CONFIGURATION:** |
---|
4934 | |
---|
4935 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MMOVE |
---|
4936 | .. index:: CONFIGURE_SHELL_COMMAND_MMOVE |
---|
4937 | |
---|
4938 | This command is included in the default shell command set. |
---|
4939 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MMOVE`` to have this |
---|
4940 | command included. |
---|
4941 | |
---|
4942 | This command can be excluded from the shell command set by |
---|
4943 | defining ``CONFIGURE_SHELL_NO_COMMAND_MMOVE`` when all |
---|
4944 | shell commands have been configured. |
---|
4945 | |
---|
4946 | **PROGRAMMING INFORMATION:** |
---|
4947 | |
---|
4948 | .. index:: rtems_shell_rtems_main_mmove |
---|
4949 | |
---|
4950 | The ``mmove`` is implemented by a C language function |
---|
4951 | which has the following prototype: |
---|
4952 | .. code:: c |
---|
4953 | |
---|
4954 | int rtems_shell_rtems_main_mmove( |
---|
4955 | int argc, |
---|
4956 | char \**argv |
---|
4957 | ); |
---|
4958 | |
---|
4959 | The configuration structure for the ``mmove`` has the |
---|
4960 | following prototype: |
---|
4961 | .. code:: c |
---|
4962 | |
---|
4963 | extern rtems_shell_cmd_t rtems_shell_MMOVE_Command; |
---|
4964 | |
---|
4965 | malloc - obtain information on C program heap |
---|
4966 | --------------------------------------------- |
---|
4967 | .. index:: malloc |
---|
4968 | |
---|
4969 | **SYNOPSYS:** |
---|
4970 | |
---|
4971 | .. code:: c |
---|
4972 | |
---|
4973 | malloc \[walk] |
---|
4974 | |
---|
4975 | **DESCRIPTION:** |
---|
4976 | |
---|
4977 | This command prints information about the current state of the C Program Heap |
---|
4978 | used by the ``malloc()`` family of calls if no or invalid options are passed |
---|
4979 | to the command. This includes the following information: |
---|
4980 | |
---|
4981 | - Number of free blocks |
---|
4982 | |
---|
4983 | - Largest free block |
---|
4984 | |
---|
4985 | - Total bytes free |
---|
4986 | |
---|
4987 | - Number of used blocks |
---|
4988 | |
---|
4989 | - Largest used block |
---|
4990 | |
---|
4991 | - Total bytes used |
---|
4992 | |
---|
4993 | - Size of the allocatable area in bytes |
---|
4994 | |
---|
4995 | - Minimum free size ever in bytes |
---|
4996 | |
---|
4997 | - Maximum number of free blocks ever |
---|
4998 | |
---|
4999 | - Maximum number of blocks searched ever |
---|
5000 | |
---|
5001 | - Lifetime number of bytes allocated |
---|
5002 | |
---|
5003 | - Lifetime number of bytes freed |
---|
5004 | |
---|
5005 | - Total number of searches |
---|
5006 | |
---|
5007 | - Total number of successful allocations |
---|
5008 | |
---|
5009 | - Total number of failed allocations |
---|
5010 | |
---|
5011 | - Total number of successful frees |
---|
5012 | |
---|
5013 | - Total number of successful resizes |
---|
5014 | |
---|
5015 | When the subcommand ``walk`` is specified, then a heap walk will be |
---|
5016 | performed and information about each block is printed out. |
---|
5017 | |
---|
5018 | **EXIT STATUS:** |
---|
5019 | |
---|
5020 | This command returns 0 on success and non-zero if an error is encountered. |
---|
5021 | |
---|
5022 | **NOTES:** |
---|
5023 | |
---|
5024 | NONE |
---|
5025 | |
---|
5026 | **EXAMPLES:** |
---|
5027 | |
---|
5028 | The following is an example of how to use the ``malloc`` command. |
---|
5029 | .. code:: c |
---|
5030 | |
---|
5031 | SHLL \[/] $ malloc |
---|
5032 | C Program Heap and RTEMS Workspace are the same. |
---|
5033 | Number of free blocks: 2 |
---|
5034 | Largest free block: 266207504 |
---|
5035 | Total bytes free: 266208392 |
---|
5036 | Number of used blocks: 167 |
---|
5037 | Largest used block: 16392 |
---|
5038 | Total bytes used: 83536 |
---|
5039 | Size of the allocatable area in bytes: 266291928 |
---|
5040 | Minimum free size ever in bytes: 266207360 |
---|
5041 | Maximum number of free blocks ever: 6 |
---|
5042 | Maximum number of blocks searched ever: 5 |
---|
5043 | Lifetime number of bytes allocated: 91760 |
---|
5044 | Lifetime number of bytes freed: 8224 |
---|
5045 | Total number of searches: 234 |
---|
5046 | Total number of successful allocations: 186 |
---|
5047 | Total number of failed allocations: 0 |
---|
5048 | Total number of successful frees: 19 |
---|
5049 | Total number of successful resizes: 0 |
---|
5050 | SHLL \[/] $ malloc walk |
---|
5051 | malloc walk |
---|
5052 | PASS[0]: page size 8, min block size 48 |
---|
5053 | area begin 0x00210210, area end 0x0FFFC000 |
---|
5054 | first block 0x00210214, last block 0x0FFFBFDC |
---|
5055 | first free 0x00228084, last free 0x00228354 |
---|
5056 | PASS[0]: block 0x00210214: size 88 |
---|
5057 | ... |
---|
5058 | PASS[0]: block 0x00220154: size 144 |
---|
5059 | PASS[0]: block 0x002201E4: size 168, prev 0x002205BC, next 0x00228354 (= last free) |
---|
5060 | PASS[0]: block 0x0022028C: size 168, prev_size 168 |
---|
5061 | ... |
---|
5062 | PASS[0]: block 0x00226E7C: size 4136 |
---|
5063 | PASS[0]: block 0x00227EA4: size 408, prev 0x00228084 (= first free), next 0x00226CE4 |
---|
5064 | PASS[0]: block 0x0022803C: size 72, prev_size 408 |
---|
5065 | PASS[0]: block 0x00228084: size 648, prev 0x0020F75C (= head), next 0x00227EA4 |
---|
5066 | PASS[0]: block 0x0022830C: size 72, prev_size 648 |
---|
5067 | PASS[0]: block 0x00228354: size 266157192, prev 0x002201E4, next 0x0020F75C (= tail) |
---|
5068 | PASS[0]: block 0x0FFFBFDC: size 4028711480, prev_size 266157192 |
---|
5069 | |
---|
5070 | **CONFIGURATION:** |
---|
5071 | |
---|
5072 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MALLOC |
---|
5073 | .. index:: CONFIGURE_SHELL_COMMAND_MALLOC |
---|
5074 | |
---|
5075 | This command is included in the default shell command set. |
---|
5076 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_MALLOC`` to have this |
---|
5077 | command included. |
---|
5078 | |
---|
5079 | This command can be excluded from the shell command set by |
---|
5080 | defining ``CONFIGURE_SHELL_NO_COMMAND_MALLOC`` when all |
---|
5081 | shell commands have been configured. |
---|
5082 | |
---|
5083 | **PROGRAMMING INFORMATION:** |
---|
5084 | |
---|
5085 | .. index:: rtems_shell_rtems_main_malloc |
---|
5086 | |
---|
5087 | The ``malloc`` is implemented by a C language function |
---|
5088 | which has the following prototype: |
---|
5089 | .. code:: c |
---|
5090 | |
---|
5091 | int rtems_shell_rtems_main_malloc( |
---|
5092 | int argc, |
---|
5093 | char \**argv |
---|
5094 | ); |
---|
5095 | |
---|
5096 | The configuration structure for the ``malloc`` has the |
---|
5097 | following prototype: |
---|
5098 | .. code:: c |
---|
5099 | |
---|
5100 | extern rtems_shell_cmd_t rtems_shell_MALLOC_Command; |
---|
5101 | |
---|
5102 | .. COMMENT: COPYRIGHT (c) 1988-2008. |
---|
5103 | |
---|
5104 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
5105 | |
---|
5106 | .. COMMENT: All rights reserved. |
---|
5107 | |
---|
5108 | RTEMS Specific Commands |
---|
5109 | ####################### |
---|
5110 | |
---|
5111 | Introduction |
---|
5112 | ============ |
---|
5113 | |
---|
5114 | The RTEMS shell has the following rtems commands: |
---|
5115 | |
---|
5116 | - ``shutdown`` - Shutdown the system |
---|
5117 | |
---|
5118 | - ``cpuuse`` - print or reset per thread cpu usage |
---|
5119 | |
---|
5120 | - ``stackuse`` - print per thread stack usage |
---|
5121 | |
---|
5122 | - ``perioduse`` - print or reset per period usage |
---|
5123 | |
---|
5124 | - ``profreport`` - print a profiling report |
---|
5125 | |
---|
5126 | - ``wkspace`` - Display information on Executive Workspace |
---|
5127 | |
---|
5128 | - ``config`` - Show the system configuration. |
---|
5129 | |
---|
5130 | - ``itask`` - List init tasks for the system |
---|
5131 | |
---|
5132 | - ``extension`` - Display information about extensions |
---|
5133 | |
---|
5134 | - ``task`` - Display information about tasks |
---|
5135 | |
---|
5136 | - ``queue`` - Display information about message queues |
---|
5137 | |
---|
5138 | - ``sema`` - display information about semaphores |
---|
5139 | |
---|
5140 | - ``region`` - display information about regions |
---|
5141 | |
---|
5142 | - ``part`` - display information about partitions |
---|
5143 | |
---|
5144 | - ``object`` - Display information about RTEMS objects |
---|
5145 | |
---|
5146 | - ``driver`` - Display the RTEMS device driver table |
---|
5147 | |
---|
5148 | - ``dname`` - Displays information about named drivers |
---|
5149 | |
---|
5150 | - ``pthread`` - Displays information about POSIX threads |
---|
5151 | |
---|
5152 | Commands |
---|
5153 | ======== |
---|
5154 | |
---|
5155 | This section details the RTEMS Specific Commands available. A |
---|
5156 | subsection is dedicated to each of the commands and |
---|
5157 | describes the behavior and configuration of that |
---|
5158 | command as well as providing an example usage. |
---|
5159 | |
---|
5160 | shutdown - Shutdown the system |
---|
5161 | ------------------------------ |
---|
5162 | .. index:: shutdown |
---|
5163 | |
---|
5164 | **SYNOPSYS:** |
---|
5165 | |
---|
5166 | .. code:: c |
---|
5167 | |
---|
5168 | shutdown |
---|
5169 | |
---|
5170 | **DESCRIPTION:** |
---|
5171 | |
---|
5172 | This command is used to shutdown the RTEMS application. |
---|
5173 | |
---|
5174 | **EXIT STATUS:** |
---|
5175 | |
---|
5176 | This command does not return. |
---|
5177 | |
---|
5178 | **NOTES:** |
---|
5179 | |
---|
5180 | **EXAMPLES:** |
---|
5181 | |
---|
5182 | The following is an example of how to use ``shutdown``: |
---|
5183 | .. code:: c |
---|
5184 | |
---|
5185 | SHLL \[/] $ shutdown |
---|
5186 | System shutting down at user request |
---|
5187 | |
---|
5188 | The user will not see another prompt and the system will |
---|
5189 | shutdown. |
---|
5190 | |
---|
5191 | **CONFIGURATION:** |
---|
5192 | |
---|
5193 | .. index:: CONFIGURE_SHELL_NO_COMMAND_SHUTDOWN |
---|
5194 | .. index:: CONFIGURE_SHELL_COMMAND_SHUTDOWN |
---|
5195 | |
---|
5196 | This command is included in the default shell command set. |
---|
5197 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_SHUTDOWN`` to have this |
---|
5198 | command included. |
---|
5199 | |
---|
5200 | This command can be excluded from the shell command set by |
---|
5201 | defining ``CONFIGURE_SHELL_NO_COMMAND_SHUTDOWN`` when all |
---|
5202 | shell commands have been configured. |
---|
5203 | |
---|
5204 | **PROGRAMMING INFORMATION:** |
---|
5205 | |
---|
5206 | The configuration structure for the ``shutdown`` has the |
---|
5207 | following prototype: |
---|
5208 | .. code:: c |
---|
5209 | |
---|
5210 | extern rtems_shell_cmd_t rtems_shell_SHUTDOWN_Command; |
---|
5211 | |
---|
5212 | cpuuse - print or reset per thread cpu usage |
---|
5213 | -------------------------------------------- |
---|
5214 | .. index:: cpuuse |
---|
5215 | |
---|
5216 | **SYNOPSYS:** |
---|
5217 | |
---|
5218 | .. code:: c |
---|
5219 | |
---|
5220 | cpuuse \[-r] |
---|
5221 | |
---|
5222 | **DESCRIPTION:** |
---|
5223 | |
---|
5224 | This command may be used to print a report on the per thread |
---|
5225 | cpu usage or to reset the per thread CPU usage statistics. When |
---|
5226 | invoked with the ``-r`` option, the CPU usage statistics |
---|
5227 | are reset. |
---|
5228 | |
---|
5229 | **EXIT STATUS:** |
---|
5230 | |
---|
5231 | This command returns 0 on success and non-zero if an error is encountered. |
---|
5232 | |
---|
5233 | **NOTES:** |
---|
5234 | |
---|
5235 | The granularity of the timing information reported is dependent |
---|
5236 | upon the BSP and the manner in which RTEMS was built. In the |
---|
5237 | default RTEMS configuration, if the BSP supports nanosecond |
---|
5238 | granularity timestamps, then the information reported will be |
---|
5239 | highly accurate. Otherwise, the accuracy of the information |
---|
5240 | reported is limited by the clock tick quantum. |
---|
5241 | |
---|
5242 | **EXAMPLES:** |
---|
5243 | |
---|
5244 | The following is an example of how to use ``cpuuse``: |
---|
5245 | .. code:: c |
---|
5246 | |
---|
5247 | SHLL \[/] $ cpuuse |
---|
5248 | CPU Usage by thread |
---|
5249 | ID NAME SECONDS PERCENT |
---|
5250 | 0x09010001 IDLE 49.745393 98.953 |
---|
5251 | 0x0a010001 UI1 0.000000 0.000 |
---|
5252 | 0x0a010002 SHLL 0.525928 1.046 |
---|
5253 | Time since last CPU Usage reset 50.271321 seconds |
---|
5254 | SHLL \[/] $ cpuuse -r |
---|
5255 | Resetting CPU Usage information |
---|
5256 | SHLL \[/] $ cpuuse |
---|
5257 | CPU Usage by thread |
---|
5258 | ID NAME SECONDS PERCENT |
---|
5259 | 0x09010001 IDLE 0.000000 0.000 |
---|
5260 | 0x0a010001 UI1 0.000000 0.000 |
---|
5261 | 0x0a010002 SHLL 0.003092 100.000 |
---|
5262 | Time since last CPU Usage reset 0.003092 seconds |
---|
5263 | |
---|
5264 | In the above example, the system had set idle for nearly |
---|
5265 | a minute when the first report was generated. The``cpuuse -r`` and ``cpuuse`` commands were pasted |
---|
5266 | from another window so were executed with no gap between. |
---|
5267 | In the second report, only the ``shell`` thread has |
---|
5268 | run since the CPU Usage was reset. It has consumed |
---|
5269 | approximately 3.092 milliseconds of CPU time processing |
---|
5270 | the two commands and generating the output. |
---|
5271 | |
---|
5272 | **CONFIGURATION:** |
---|
5273 | |
---|
5274 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CPUUSE |
---|
5275 | .. index:: CONFIGURE_SHELL_COMMAND_CPUUSE |
---|
5276 | |
---|
5277 | This command is included in the default shell command set. |
---|
5278 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CPUUSE`` to have this |
---|
5279 | command included. |
---|
5280 | |
---|
5281 | This command can be excluded from the shell command set by |
---|
5282 | defining ``CONFIGURE_SHELL_NO_COMMAND_CPUUSE`` when all |
---|
5283 | shell commands have been configured. |
---|
5284 | |
---|
5285 | **PROGRAMMING INFORMATION:** |
---|
5286 | |
---|
5287 | .. index:: rtems_shell_rtems_main_cpuuse |
---|
5288 | |
---|
5289 | The ``cpuuse`` is implemented by a C language function |
---|
5290 | which has the following prototype: |
---|
5291 | .. code:: c |
---|
5292 | |
---|
5293 | int rtems_shell_rtems_main_cpuuse( |
---|
5294 | int argc, |
---|
5295 | char \**argv |
---|
5296 | ); |
---|
5297 | |
---|
5298 | The configuration structure for the ``cpuuse`` has the |
---|
5299 | following prototype: |
---|
5300 | .. code:: c |
---|
5301 | |
---|
5302 | extern rtems_shell_cmd_t rtems_shell_CPUUSE_Command; |
---|
5303 | |
---|
5304 | stackuse - print per thread stack usage |
---|
5305 | --------------------------------------- |
---|
5306 | .. index:: stackuse |
---|
5307 | |
---|
5308 | **SYNOPSYS:** |
---|
5309 | |
---|
5310 | .. code:: c |
---|
5311 | |
---|
5312 | stackuse |
---|
5313 | |
---|
5314 | **DESCRIPTION:** |
---|
5315 | |
---|
5316 | This command prints a Stack Usage Report for all of the tasks |
---|
5317 | and threads in the system. On systems which support it, the |
---|
5318 | usage of the interrupt stack is also included in the report. |
---|
5319 | |
---|
5320 | **EXIT STATUS:** |
---|
5321 | |
---|
5322 | This command always succeeds and returns 0. |
---|
5323 | |
---|
5324 | **NOTES:** |
---|
5325 | |
---|
5326 | The ``CONFIGURE_STACK_CHECKER_ENABLED`` ``confdefs.h`` constant |
---|
5327 | must be defined when the application is configured for this |
---|
5328 | command to have any information to report. |
---|
5329 | |
---|
5330 | **EXAMPLES:** |
---|
5331 | |
---|
5332 | The following is an example of how to use ``stackuse``: |
---|
5333 | .. code:: c |
---|
5334 | |
---|
5335 | SHLL \[/] $ stackuse |
---|
5336 | Stack usage by thread |
---|
5337 | ID NAME LOW HIGH CURRENT AVAILABLE USED |
---|
5338 | 0x09010001 IDLE 0x023d89a0 - 0x023d99af 0x023d9760 4096 608 |
---|
5339 | 0x0a010001 UI1 0x023d9f30 - 0x023daf3f 0x023dad18 4096 1804 |
---|
5340 | 0x0a010002 SHLL 0x023db4c0 - 0x023df4cf 0x023de9d0 16384 5116 |
---|
5341 | 0xffffffff INTR 0x023d2760 - 0x023d375f 0x00000000 4080 316 |
---|
5342 | |
---|
5343 | **CONFIGURATION:** |
---|
5344 | |
---|
5345 | .. index:: CONFIGURE_SHELL_NO_COMMAND_STACKUSE |
---|
5346 | .. index:: CONFIGURE_SHELL_COMMAND_STACKUSE |
---|
5347 | |
---|
5348 | This command is included in the default shell command set. |
---|
5349 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_STACKUSE`` to have this |
---|
5350 | command included. |
---|
5351 | |
---|
5352 | This command can be excluded from the shell command set by |
---|
5353 | defining ``CONFIGURE_SHELL_NO_COMMAND_STACKUSE`` when all |
---|
5354 | shell commands have been configured. |
---|
5355 | |
---|
5356 | **PROGRAMMING INFORMATION:** |
---|
5357 | |
---|
5358 | .. index:: rtems_shell_rtems_main_stackuse |
---|
5359 | |
---|
5360 | The ``stackuse`` is implemented by a C language function |
---|
5361 | which has the following prototype: |
---|
5362 | .. code:: c |
---|
5363 | |
---|
5364 | int rtems_shell_rtems_main_stackuse( |
---|
5365 | int argc, |
---|
5366 | char \**argv |
---|
5367 | ); |
---|
5368 | |
---|
5369 | The configuration structure for the ``stackuse`` has the |
---|
5370 | following prototype: |
---|
5371 | .. code:: c |
---|
5372 | |
---|
5373 | extern rtems_shell_cmd_t rtems_shell_STACKUSE_Command; |
---|
5374 | |
---|
5375 | perioduse - print or reset per period usage |
---|
5376 | ------------------------------------------- |
---|
5377 | .. index:: perioduse |
---|
5378 | |
---|
5379 | **SYNOPSYS:** |
---|
5380 | |
---|
5381 | .. code:: c |
---|
5382 | |
---|
5383 | perioduse \[-r] |
---|
5384 | |
---|
5385 | **DESCRIPTION:** |
---|
5386 | |
---|
5387 | This command may be used to print a statistics report on the rate |
---|
5388 | monotonic periods in the application or to reset the rate monotonic |
---|
5389 | period usage statistics. When invoked with the ``-r`` option, the |
---|
5390 | usage statistics are reset. |
---|
5391 | |
---|
5392 | **EXIT STATUS:** |
---|
5393 | |
---|
5394 | This command returns 0 on success and non-zero if an error is encountered. |
---|
5395 | |
---|
5396 | **NOTES:** |
---|
5397 | |
---|
5398 | The granularity of the timing information reported is dependent |
---|
5399 | upon the BSP and the manner in which RTEMS was built. In the |
---|
5400 | default RTEMS configuration, if the BSP supports nanosecond |
---|
5401 | granularity timestamps, then the information reported will be |
---|
5402 | highly accurate. Otherwise, the accuracy of the information |
---|
5403 | reported is limited by the clock tick quantum. |
---|
5404 | |
---|
5405 | **EXAMPLES:** |
---|
5406 | |
---|
5407 | The following is an example of how to use ``perioduse``: |
---|
5408 | .. code:: c |
---|
5409 | |
---|
5410 | SHLL \[/] $ perioduse |
---|
5411 | Period information by period |
---|
5412 | --- CPU times are in seconds --- |
---|
5413 | --- Wall times are in seconds --- |
---|
5414 | ID OWNER COUNT MISSED CPU TIME WALL TIME |
---|
5415 | MIN/MAX/AVG MIN/MAX/AVG |
---|
5416 | 0x42010001 TA1 502 0 0:000039/0:042650/0:004158 0:000039/0:020118/0:002848 |
---|
5417 | 0x42010002 TA2 502 0 0:000041/0:042657/0:004309 0:000041/0:020116/0:002848 |
---|
5418 | 0x42010003 TA3 501 0 0:000041/0:041564/0:003653 0:000041/0:020003/0:002814 |
---|
5419 | 0x42010004 TA4 501 0 0:000043/0:044075/0:004911 0:000043/0:020004/0:002814 |
---|
5420 | 0x42010005 TA5 10 0 0:000065/0:005413/0:002739 0:000065/1:000457/0:041058 |
---|
5421 | MIN/MAX/AVG MIN/MAX/AVG |
---|
5422 | SHLL \[/] $ perioduse -r |
---|
5423 | Resetting Period Usage information |
---|
5424 | SHLL \[/] $ perioduse |
---|
5425 | --- CPU times are in seconds --- |
---|
5426 | --- Wall times are in seconds --- |
---|
5427 | ID OWNER COUNT MISSED CPU TIME WALL TIME |
---|
5428 | MIN/MAX/AVG MIN/MAX/AVG |
---|
5429 | 0x42010001 TA1 0 0 |
---|
5430 | 0x42010002 TA2 0 0 |
---|
5431 | 0x42010003 TA3 0 0 |
---|
5432 | 0x42010004 TA4 0 0 |
---|
5433 | 0x42010005 TA5 0 0 |
---|
5434 | |
---|
5435 | **CONFIGURATION:** |
---|
5436 | |
---|
5437 | .. index:: CONFIGURE_SHELL_NO_COMMAND_PERIODUSE |
---|
5438 | .. index:: CONFIGURE_SHELL_COMMAND_PERIODUSE |
---|
5439 | |
---|
5440 | This command is included in the default shell command set. |
---|
5441 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_PERIODUSE`` to have this |
---|
5442 | command included. |
---|
5443 | |
---|
5444 | This command can be excluded from the shell command set by |
---|
5445 | defining ``CONFIGURE_SHELL_NO_COMMAND_PERIODUSE`` when all |
---|
5446 | shell commands have been configured. |
---|
5447 | |
---|
5448 | **PROGRAMMING INFORMATION:** |
---|
5449 | |
---|
5450 | .. index:: rtems_shell_rtems_main_perioduse |
---|
5451 | |
---|
5452 | The ``perioduse`` is implemented by a C language function |
---|
5453 | which has the following prototype: |
---|
5454 | .. code:: c |
---|
5455 | |
---|
5456 | int rtems_shell_rtems_main_perioduse( |
---|
5457 | int argc, |
---|
5458 | char \**argv |
---|
5459 | ); |
---|
5460 | |
---|
5461 | The configuration structure for the ``perioduse`` has the |
---|
5462 | following prototype: |
---|
5463 | .. code:: c |
---|
5464 | |
---|
5465 | extern rtems_shell_cmd_t rtems_shell_PERIODUSE_Command; |
---|
5466 | |
---|
5467 | profreport - print a profiling report |
---|
5468 | ------------------------------------- |
---|
5469 | .. index:: profreport |
---|
5470 | |
---|
5471 | **SYNOPSYS:** |
---|
5472 | |
---|
5473 | .. code:: c |
---|
5474 | |
---|
5475 | profreport |
---|
5476 | |
---|
5477 | **DESCRIPTION:** |
---|
5478 | |
---|
5479 | This command may be used to print a profiling report. |
---|
5480 | |
---|
5481 | **EXIT STATUS:** |
---|
5482 | |
---|
5483 | This command returns 0. |
---|
5484 | |
---|
5485 | **NOTES:** |
---|
5486 | |
---|
5487 | Profiling must be enabled at build configuration time to get profiling |
---|
5488 | information. |
---|
5489 | |
---|
5490 | **EXAMPLES:** |
---|
5491 | |
---|
5492 | The following is an example of how to use ``profreport``: |
---|
5493 | .. code:: c |
---|
5494 | |
---|
5495 | SHLL \[/] $ profreport |
---|
5496 | <ProfilingReport name="Shell"> |
---|
5497 | <PerCPUProfilingReport processorIndex="0"> |
---|
5498 | <MaxThreadDispatchDisabledTime unit="ns">10447</MaxThreadDispatchDisabledTime> |
---|
5499 | <MeanThreadDispatchDisabledTime unit="ns">2</MeanThreadDispatchDisabledTime> |
---|
5500 | <TotalThreadDispatchDisabledTime unit="ns">195926627</TotalThreadDispatchDisabledTime> |
---|
5501 | <ThreadDispatchDisabledCount>77908688</ThreadDispatchDisabledCount> |
---|
5502 | <MaxInterruptDelay unit="ns">0</MaxInterruptDelay> |
---|
5503 | <MaxInterruptTime unit="ns">688</MaxInterruptTime> |
---|
5504 | <MeanInterruptTime unit="ns">127</MeanInterruptTime> |
---|
5505 | <TotalInterruptTime unit="ns">282651157</TotalInterruptTime> |
---|
5506 | <InterruptCount>2215855</InterruptCount> |
---|
5507 | </PerCPUProfilingReport> |
---|
5508 | <PerCPUProfilingReport processorIndex="1"> |
---|
5509 | <MaxThreadDispatchDisabledTime unit="ns">9053</MaxThreadDispatchDisabledTime> |
---|
5510 | <MeanThreadDispatchDisabledTime unit="ns">41</MeanThreadDispatchDisabledTime> |
---|
5511 | <TotalThreadDispatchDisabledTime unit="ns">3053830335</TotalThreadDispatchDisabledTime> |
---|
5512 | <ThreadDispatchDisabledCount>73334202</ThreadDispatchDisabledCount> |
---|
5513 | <MaxInterruptDelay unit="ns">0</MaxInterruptDelay> |
---|
5514 | <MaxInterruptTime unit="ns">57</MaxInterruptTime> |
---|
5515 | <MeanInterruptTime unit="ns">35</MeanInterruptTime> |
---|
5516 | <TotalInterruptTime unit="ns">76980203</TotalInterruptTime> |
---|
5517 | <InterruptCount>2141179</InterruptCount> |
---|
5518 | </PerCPUProfilingReport> |
---|
5519 | <SMPLockProfilingReport name="SMP lock stats"> |
---|
5520 | <MaxAcquireTime unit="ns">608</MaxAcquireTime> |
---|
5521 | <MaxSectionTime unit="ns">1387</MaxSectionTime> |
---|
5522 | <MeanAcquireTime unit="ns">112</MeanAcquireTime> |
---|
5523 | <MeanSectionTime unit="ns">338</MeanSectionTime> |
---|
5524 | <TotalAcquireTime unit="ns">119031</TotalAcquireTime> |
---|
5525 | <TotalSectionTime unit="ns">357222</TotalSectionTime> |
---|
5526 | <UsageCount>1055</UsageCount> |
---|
5527 | <ContentionCount initialQueueLength="0">1055</ContentionCount> |
---|
5528 | <ContentionCount initialQueueLength="1">0</ContentionCount> |
---|
5529 | <ContentionCount initialQueueLength="2">0</ContentionCount> |
---|
5530 | <ContentionCount initialQueueLength="3">0</ContentionCount> |
---|
5531 | </SMPLockProfilingReport> |
---|
5532 | <SMPLockProfilingReport name="Giant"> |
---|
5533 | <MaxAcquireTime unit="ns">4186</MaxAcquireTime> |
---|
5534 | <MaxSectionTime unit="ns">7575</MaxSectionTime> |
---|
5535 | <MeanAcquireTime unit="ns">160</MeanAcquireTime> |
---|
5536 | <MeanSectionTime unit="ns">183</MeanSectionTime> |
---|
5537 | <TotalAcquireTime unit="ns">1772793111</TotalAcquireTime> |
---|
5538 | <TotalSectionTime unit="ns">2029733879</TotalSectionTime> |
---|
5539 | <UsageCount>11039140</UsageCount> |
---|
5540 | <ContentionCount initialQueueLength="0">11037655</ContentionCount> |
---|
5541 | <ContentionCount initialQueueLength="1">1485</ContentionCount> |
---|
5542 | <ContentionCount initialQueueLength="2">0</ContentionCount> |
---|
5543 | <ContentionCount initialQueueLength="3">0</ContentionCount> |
---|
5544 | </SMPLockProfilingReport> |
---|
5545 | </ProfilingReport> |
---|
5546 | |
---|
5547 | **CONFIGURATION:** |
---|
5548 | |
---|
5549 | .. index:: CONFIGURE_SHELL_NO_COMMAND_PROFREPORT |
---|
5550 | .. index:: CONFIGURE_SHELL_COMMAND_PROFREPORT |
---|
5551 | |
---|
5552 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_PROFREPORT`` to have this |
---|
5553 | command included. |
---|
5554 | |
---|
5555 | This command can be excluded from the shell command set by |
---|
5556 | defining ``CONFIGURE_SHELL_NO_COMMAND_PROFREPORT`` when all |
---|
5557 | shell commands have been configured. |
---|
5558 | |
---|
5559 | **PROGRAMMING INFORMATION:** |
---|
5560 | |
---|
5561 | The configuration structure for the ``profreport`` has the |
---|
5562 | following prototype: |
---|
5563 | .. code:: c |
---|
5564 | |
---|
5565 | extern rtems_shell_cmd_t rtems_shell_PROFREPORT_Command; |
---|
5566 | |
---|
5567 | wkspace - display information on executive workspace |
---|
5568 | ---------------------------------------------------- |
---|
5569 | .. index:: wkspace |
---|
5570 | |
---|
5571 | **SYNOPSYS:** |
---|
5572 | |
---|
5573 | .. code:: c |
---|
5574 | |
---|
5575 | wkspace |
---|
5576 | |
---|
5577 | **DESCRIPTION:** |
---|
5578 | |
---|
5579 | This command prints information on the current state of |
---|
5580 | the RTEMS Executive Workspace reported. This includes the |
---|
5581 | following information: |
---|
5582 | |
---|
5583 | - Number of free blocks |
---|
5584 | |
---|
5585 | - Largest free block |
---|
5586 | |
---|
5587 | - Total bytes free |
---|
5588 | |
---|
5589 | - Number of used blocks |
---|
5590 | |
---|
5591 | - Largest used block |
---|
5592 | |
---|
5593 | - Total bytes used |
---|
5594 | |
---|
5595 | **EXIT STATUS:** |
---|
5596 | |
---|
5597 | This command always succeeds and returns 0. |
---|
5598 | |
---|
5599 | **NOTES:** |
---|
5600 | |
---|
5601 | NONE |
---|
5602 | |
---|
5603 | **EXAMPLES:** |
---|
5604 | |
---|
5605 | The following is an example of how to use ``wkspace``: |
---|
5606 | .. code:: c |
---|
5607 | |
---|
5608 | SHLL \[/] $ wkspace |
---|
5609 | Number of free blocks: 1 |
---|
5610 | Largest free block: 132336 |
---|
5611 | Total bytes free: 132336 |
---|
5612 | Number of used blocks: 36 |
---|
5613 | Largest used block: 16408 |
---|
5614 | Total bytes used: 55344 |
---|
5615 | |
---|
5616 | **CONFIGURATION:** |
---|
5617 | |
---|
5618 | .. index:: CONFIGURE_SHELL_NO_COMMAND_WKSPACE |
---|
5619 | .. index:: CONFIGURE_SHELL_COMMAND_WKSPACE |
---|
5620 | |
---|
5621 | This command is included in the default shell command set. |
---|
5622 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_WKSPACE`` to have this |
---|
5623 | command included. |
---|
5624 | |
---|
5625 | This command can be excluded from the shell command set by |
---|
5626 | defining ``CONFIGURE_SHELL_NO_COMMAND_WKSPACE`` when all |
---|
5627 | shell commands have been configured. |
---|
5628 | |
---|
5629 | **PROGRAMMING INFORMATION:** |
---|
5630 | |
---|
5631 | .. index:: rtems_shell_rtems_main_wkspace |
---|
5632 | |
---|
5633 | The ``wkspace`` is implemented by a C language function |
---|
5634 | which has the following prototype: |
---|
5635 | .. code:: c |
---|
5636 | |
---|
5637 | int rtems_shell_rtems_main_wkspace( |
---|
5638 | int argc, |
---|
5639 | char \**argv |
---|
5640 | ); |
---|
5641 | |
---|
5642 | The configuration structure for the ``wkspace`` has the |
---|
5643 | following prototype: |
---|
5644 | .. code:: c |
---|
5645 | |
---|
5646 | extern rtems_shell_cmd_t rtems_shell_WKSPACE_Command; |
---|
5647 | |
---|
5648 | config - show the system configuration. |
---|
5649 | --------------------------------------- |
---|
5650 | .. index:: config |
---|
5651 | |
---|
5652 | **SYNOPSYS:** |
---|
5653 | |
---|
5654 | .. code:: c |
---|
5655 | |
---|
5656 | config |
---|
5657 | |
---|
5658 | **DESCRIPTION:** |
---|
5659 | |
---|
5660 | This command display information about the RTEMS Configuration. |
---|
5661 | |
---|
5662 | **EXIT STATUS:** |
---|
5663 | |
---|
5664 | This command always succeeds and returns 0. |
---|
5665 | |
---|
5666 | **NOTES:** |
---|
5667 | |
---|
5668 | At this time, it does not report every configuration parameter. |
---|
5669 | This is an area in which user submissions or sponsorship of |
---|
5670 | a developer would be appreciated. |
---|
5671 | |
---|
5672 | **EXAMPLES:** |
---|
5673 | |
---|
5674 | The following is an example of how to use ``config``: |
---|
5675 | .. code:: c |
---|
5676 | |
---|
5677 | INITIAL (startup) Configuration Info |
---|
5678 | |
---|
5679 | WORKSPACE start: 0x23d22e0; size: 0x2dd20 |
---|
5680 | TIME usec/tick: 10000; tick/timeslice: 50; tick/sec: 100 |
---|
5681 | MAXIMUMS tasks: 20; timers: 0; sems: 50; que's: 20; ext's: 1 |
---|
5682 | partitions: 0; regions: 0; ports: 0; periods: 0 |
---|
5683 | |
---|
5684 | **CONFIGURATION:** |
---|
5685 | |
---|
5686 | .. index:: CONFIGURE_SHELL_NO_COMMAND_CONFIG |
---|
5687 | .. index:: CONFIGURE_SHELL_COMMAND_CONFIG |
---|
5688 | |
---|
5689 | This command is included in the default shell command set. |
---|
5690 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_CONFIG`` to have this |
---|
5691 | command included. |
---|
5692 | |
---|
5693 | This command can be excluded from the shell command set by |
---|
5694 | defining ``CONFIGURE_SHELL_NO_COMMAND_CONFIG`` when all |
---|
5695 | shell commands have been configured. |
---|
5696 | |
---|
5697 | **PROGRAMMING INFORMATION:** |
---|
5698 | |
---|
5699 | .. index:: rtems_shell_rtems_main_config |
---|
5700 | |
---|
5701 | The ``config`` is implemented by a C language function |
---|
5702 | which has the following prototype: |
---|
5703 | .. code:: c |
---|
5704 | |
---|
5705 | int rtems_shell_rtems_main_config( |
---|
5706 | int argc, |
---|
5707 | char \**argv |
---|
5708 | ); |
---|
5709 | |
---|
5710 | The configuration structure for the ``config`` has the |
---|
5711 | following prototype: |
---|
5712 | .. code:: c |
---|
5713 | |
---|
5714 | extern rtems_shell_cmd_t rtems_shell_CONFIG_Command; |
---|
5715 | |
---|
5716 | itask - list init tasks for the system |
---|
5717 | -------------------------------------- |
---|
5718 | .. index:: itask |
---|
5719 | |
---|
5720 | **SYNOPSYS:** |
---|
5721 | |
---|
5722 | .. code:: c |
---|
5723 | |
---|
5724 | itask |
---|
5725 | |
---|
5726 | **DESCRIPTION:** |
---|
5727 | |
---|
5728 | This command prints a report on the set of initialization |
---|
5729 | tasks and threads in the system. |
---|
5730 | |
---|
5731 | **EXIT STATUS:** |
---|
5732 | |
---|
5733 | This command always succeeds and returns 0. |
---|
5734 | |
---|
5735 | **NOTES:** |
---|
5736 | |
---|
5737 | At this time, it includes only Classic API Initialization Tasks. |
---|
5738 | This is an area in which user submissions or sponsorship of |
---|
5739 | a developer would be appreciated. |
---|
5740 | |
---|
5741 | **EXAMPLES:** |
---|
5742 | |
---|
5743 | The following is an example of how to use ``itask``: |
---|
5744 | .. code:: c |
---|
5745 | |
---|
5746 | SHLL \[/] $ itask |
---|
5747 | # NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE |
---|
5748 | ------------------------------------------------------------------------------ |
---|
5749 | 0 UI1 \[0x2002258] 0 \[0x0] 1 nP DEFAULT 4096 \[0x1000] |
---|
5750 | |
---|
5751 | **CONFIGURATION:** |
---|
5752 | |
---|
5753 | .. index:: CONFIGURE_SHELL_NO_COMMAND_ITASK |
---|
5754 | .. index:: CONFIGURE_SHELL_COMMAND_ITASK |
---|
5755 | |
---|
5756 | This command is included in the default shell command set. |
---|
5757 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_ITASK`` to have this |
---|
5758 | command included. |
---|
5759 | |
---|
5760 | This command can be excluded from the shell command set by |
---|
5761 | defining ``CONFIGURE_SHELL_NO_COMMAND_ITASK`` when all |
---|
5762 | shell commands have been configured. |
---|
5763 | |
---|
5764 | **PROGRAMMING INFORMATION:** |
---|
5765 | |
---|
5766 | .. index:: rtems_shell_rtems_main_itask |
---|
5767 | |
---|
5768 | The ``itask`` is implemented by a C language function |
---|
5769 | which has the following prototype: |
---|
5770 | .. code:: c |
---|
5771 | |
---|
5772 | int rtems_shell_rtems_main_itask( |
---|
5773 | int argc, |
---|
5774 | char \**argv |
---|
5775 | ); |
---|
5776 | |
---|
5777 | The configuration structure for the ``itask`` has the |
---|
5778 | following prototype: |
---|
5779 | .. code:: c |
---|
5780 | |
---|
5781 | extern rtems_shell_cmd_t rtems_shell_ITASK_Command; |
---|
5782 | |
---|
5783 | extension - display information about extensions |
---|
5784 | ------------------------------------------------ |
---|
5785 | .. index:: extension |
---|
5786 | |
---|
5787 | **SYNOPSYS:** |
---|
5788 | |
---|
5789 | .. code:: c |
---|
5790 | |
---|
5791 | extension \[id \[id ...] ] |
---|
5792 | |
---|
5793 | **DESCRIPTION:** |
---|
5794 | |
---|
5795 | When invoked with no arguments, this command prints information on |
---|
5796 | the set of User Extensions currently active in the system. |
---|
5797 | |
---|
5798 | If invoked with a set of ids as arguments, then just |
---|
5799 | those objects are included in the information printed. |
---|
5800 | |
---|
5801 | **EXIT STATUS:** |
---|
5802 | |
---|
5803 | This command returns 0 on success and non-zero if an error is encountered. |
---|
5804 | |
---|
5805 | **NOTES:** |
---|
5806 | |
---|
5807 | NONE |
---|
5808 | |
---|
5809 | **EXAMPLES:** |
---|
5810 | |
---|
5811 | The following is an example of using the ``extension`` command |
---|
5812 | on a system with no user extensions. |
---|
5813 | .. code:: c |
---|
5814 | |
---|
5815 | SHLL \[/] $ extension |
---|
5816 | ID NAME |
---|
5817 | ------------------------------------------------------------------------------ |
---|
5818 | |
---|
5819 | **CONFIGURATION:** |
---|
5820 | |
---|
5821 | .. index:: CONFIGURE_SHELL_NO_COMMAND_EXTENSION |
---|
5822 | .. index:: CONFIGURE_SHELL_COMMAND_EXTENSION |
---|
5823 | |
---|
5824 | This command is included in the default shell command set. |
---|
5825 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_EXTENSION`` to have this |
---|
5826 | command included. |
---|
5827 | |
---|
5828 | This command can be excluded from the shell command set by |
---|
5829 | defining ``CONFIGURE_SHELL_NO_COMMAND_EXTENSION`` when all |
---|
5830 | shell commands have been configured. |
---|
5831 | |
---|
5832 | **PROGRAMMING INFORMATION:** |
---|
5833 | |
---|
5834 | .. index:: rtems_shell_rtems_main_extension |
---|
5835 | |
---|
5836 | The ``extension`` is implemented by a C language function |
---|
5837 | which has the following prototype: |
---|
5838 | .. code:: c |
---|
5839 | |
---|
5840 | int rtems_shell_rtems_main_extension( |
---|
5841 | int argc, |
---|
5842 | char \**argv |
---|
5843 | ); |
---|
5844 | |
---|
5845 | The configuration structure for the ``extension`` has the |
---|
5846 | following prototype: |
---|
5847 | .. code:: c |
---|
5848 | |
---|
5849 | extern rtems_shell_cmd_t rtems_shell_EXTENSION_Command; |
---|
5850 | |
---|
5851 | task - display information about tasks |
---|
5852 | -------------------------------------- |
---|
5853 | .. index:: task |
---|
5854 | |
---|
5855 | **SYNOPSYS:** |
---|
5856 | |
---|
5857 | .. code:: c |
---|
5858 | |
---|
5859 | task \[id \[id ...] ] |
---|
5860 | |
---|
5861 | **DESCRIPTION:** |
---|
5862 | |
---|
5863 | When invoked with no arguments, this command prints information on |
---|
5864 | the set of Classic API Tasks currently active in the system. |
---|
5865 | |
---|
5866 | If invoked with a set of ids as arguments, then just |
---|
5867 | those objects are included in the information printed. |
---|
5868 | |
---|
5869 | **EXIT STATUS:** |
---|
5870 | |
---|
5871 | This command returns 0 on success and non-zero if an error is encountered. |
---|
5872 | |
---|
5873 | **NOTES:** |
---|
5874 | |
---|
5875 | NONE |
---|
5876 | |
---|
5877 | **EXAMPLES:** |
---|
5878 | |
---|
5879 | The following is an example of how to use the ``task`` on an |
---|
5880 | application with just two Classic API tasks: |
---|
5881 | .. code:: c |
---|
5882 | |
---|
5883 | SHLL \[/] $ task |
---|
5884 | ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES |
---|
5885 | ------------------------------------------------------------------------------ |
---|
5886 | 0a010001 UI1 1 SUSP P:T:nA NONE |
---|
5887 | 0a010002 SHLL 100 READY P:T:nA NONE |
---|
5888 | |
---|
5889 | **CONFIGURATION:** |
---|
5890 | |
---|
5891 | .. index:: CONFIGURE_SHELL_NO_COMMAND_TASK |
---|
5892 | .. index:: CONFIGURE_SHELL_COMMAND_TASK |
---|
5893 | |
---|
5894 | This command is included in the default shell command set. |
---|
5895 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_TASK`` to have this |
---|
5896 | command included. |
---|
5897 | |
---|
5898 | This command can be excluded from the shell command set by |
---|
5899 | defining ``CONFIGURE_SHELL_NO_COMMAND_TASK`` when all |
---|
5900 | shell commands have been configured. |
---|
5901 | |
---|
5902 | **PROGRAMMING INFORMATION:** |
---|
5903 | |
---|
5904 | .. index:: rtems_shell_rtems_main_task |
---|
5905 | |
---|
5906 | The ``task`` is implemented by a C language function |
---|
5907 | which has the following prototype: |
---|
5908 | .. code:: c |
---|
5909 | |
---|
5910 | int rtems_shell_rtems_main_task( |
---|
5911 | int argc, |
---|
5912 | char \**argv |
---|
5913 | ); |
---|
5914 | |
---|
5915 | The configuration structure for the ``task`` has the |
---|
5916 | following prototype: |
---|
5917 | .. code:: c |
---|
5918 | |
---|
5919 | extern rtems_shell_cmd_t rtems_shell_TASK_Command; |
---|
5920 | |
---|
5921 | queue - display information about message queues |
---|
5922 | ------------------------------------------------ |
---|
5923 | .. index:: queue |
---|
5924 | |
---|
5925 | **SYNOPSYS:** |
---|
5926 | |
---|
5927 | .. code:: c |
---|
5928 | |
---|
5929 | queue \[id \[id ... ] ] |
---|
5930 | |
---|
5931 | **DESCRIPTION:** |
---|
5932 | |
---|
5933 | When invoked with no arguments, this command prints information on |
---|
5934 | the set of Classic API Message Queues currently active in the system. |
---|
5935 | |
---|
5936 | If invoked with a set of ids as arguments, then just |
---|
5937 | those objects are included in the information printed. |
---|
5938 | |
---|
5939 | **EXIT STATUS:** |
---|
5940 | |
---|
5941 | This command returns 0 on success and non-zero if an error is encountered. |
---|
5942 | |
---|
5943 | **NOTES:** |
---|
5944 | |
---|
5945 | NONE |
---|
5946 | |
---|
5947 | **EXAMPLES:** |
---|
5948 | |
---|
5949 | The following is an example of using the ``queue`` command |
---|
5950 | on a system with no Classic API Message Queues. |
---|
5951 | .. code:: c |
---|
5952 | |
---|
5953 | SHLL \[/] $ queue |
---|
5954 | ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE |
---|
5955 | ------------------------------------------------------------------------------ |
---|
5956 | |
---|
5957 | **CONFIGURATION:** |
---|
5958 | |
---|
5959 | .. index:: CONFIGURE_SHELL_NO_COMMAND_QUEUE |
---|
5960 | .. index:: CONFIGURE_SHELL_COMMAND_QUEUE |
---|
5961 | |
---|
5962 | This command is included in the default shell command set. |
---|
5963 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_QUEUE`` to have this |
---|
5964 | command included. |
---|
5965 | |
---|
5966 | This command can be excluded from the shell command set by |
---|
5967 | defining ``CONFIGURE_SHELL_NO_COMMAND_QUEUE`` when all |
---|
5968 | shell commands have been configured. |
---|
5969 | |
---|
5970 | **PROGRAMMING INFORMATION:** |
---|
5971 | |
---|
5972 | .. index:: rtems_shell_rtems_main_queue |
---|
5973 | |
---|
5974 | The ``queue`` is implemented by a C language function |
---|
5975 | which has the following prototype: |
---|
5976 | .. code:: c |
---|
5977 | |
---|
5978 | int rtems_shell_rtems_main_queue( |
---|
5979 | int argc, |
---|
5980 | char \**argv |
---|
5981 | ); |
---|
5982 | |
---|
5983 | The configuration structure for the ``queue`` has the |
---|
5984 | following prototype: |
---|
5985 | .. code:: c |
---|
5986 | |
---|
5987 | extern rtems_shell_cmd_t rtems_shell_QUEUE_Command; |
---|
5988 | |
---|
5989 | sema - display information about semaphores |
---|
5990 | ------------------------------------------- |
---|
5991 | .. index:: sema |
---|
5992 | |
---|
5993 | **SYNOPSYS:** |
---|
5994 | |
---|
5995 | .. code:: c |
---|
5996 | |
---|
5997 | sema \[id \[id ... ] ] |
---|
5998 | |
---|
5999 | **DESCRIPTION:** |
---|
6000 | |
---|
6001 | When invoked with no arguments, this command prints information on |
---|
6002 | the set of Classic API Semaphores currently active in the system. |
---|
6003 | |
---|
6004 | If invoked with a set of objects ids as arguments, then just |
---|
6005 | those objects are included in the information printed. |
---|
6006 | |
---|
6007 | **EXIT STATUS:** |
---|
6008 | |
---|
6009 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6010 | |
---|
6011 | **NOTES:** |
---|
6012 | |
---|
6013 | NONE |
---|
6014 | |
---|
6015 | **EXAMPLES:** |
---|
6016 | |
---|
6017 | The following is an example of how to use ``sema``: |
---|
6018 | .. code:: c |
---|
6019 | |
---|
6020 | SHLL \[/] $ sema |
---|
6021 | ID NAME ATTR PRICEIL CURR_CNT HOLDID |
---|
6022 | ------------------------------------------------------------------------------ |
---|
6023 | 1a010001 LBIO PR:BI:IN 0 1 00000000 |
---|
6024 | 1a010002 TRmi PR:BI:IN 0 1 00000000 |
---|
6025 | 1a010003 LBI00 PR:BI:IN 0 1 00000000 |
---|
6026 | 1a010004 TRia PR:BI:IN 0 1 00000000 |
---|
6027 | 1a010005 TRoa PR:BI:IN 0 1 00000000 |
---|
6028 | 1a010006 TRxa <assoc.c: BAD NAME> 0 0 09010001 |
---|
6029 | 1a010007 LBI01 PR:BI:IN 0 1 00000000 |
---|
6030 | 1a010008 LBI02 PR:BI:IN 0 1 00000000 |
---|
6031 | |
---|
6032 | **CONFIGURATION:** |
---|
6033 | |
---|
6034 | .. index:: CONFIGURE_SHELL_NO_COMMAND_SEMA |
---|
6035 | .. index:: CONFIGURE_SHELL_COMMAND_SEMA |
---|
6036 | |
---|
6037 | This command is included in the default shell command set. |
---|
6038 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_SEMA`` to have this |
---|
6039 | command included. |
---|
6040 | |
---|
6041 | This command can be excluded from the shell command set by |
---|
6042 | defining ``CONFIGURE_SHELL_NO_COMMAND_SEMA`` when all |
---|
6043 | shell commands have been configured. |
---|
6044 | |
---|
6045 | **PROGRAMMING INFORMATION:** |
---|
6046 | |
---|
6047 | .. index:: rtems_shell_rtems_main_sema |
---|
6048 | |
---|
6049 | The ``sema`` is implemented by a C language function |
---|
6050 | which has the following prototype: |
---|
6051 | .. code:: c |
---|
6052 | |
---|
6053 | int rtems_shell_rtems_main_sema( |
---|
6054 | int argc, |
---|
6055 | char \**argv |
---|
6056 | ); |
---|
6057 | |
---|
6058 | The configuration structure for the ``sema`` has the |
---|
6059 | following prototype: |
---|
6060 | .. code:: c |
---|
6061 | |
---|
6062 | extern rtems_shell_cmd_t rtems_shell_SEMA_Command; |
---|
6063 | |
---|
6064 | region - display information about regions |
---|
6065 | ------------------------------------------ |
---|
6066 | .. index:: region |
---|
6067 | |
---|
6068 | **SYNOPSYS:** |
---|
6069 | |
---|
6070 | .. code:: c |
---|
6071 | |
---|
6072 | region \[id \[id ... ] ] |
---|
6073 | |
---|
6074 | **DESCRIPTION:** |
---|
6075 | |
---|
6076 | When invoked with no arguments, this command prints information on |
---|
6077 | the set of Classic API Regions currently active in the system. |
---|
6078 | |
---|
6079 | If invoked with a set of object ids as arguments, then just |
---|
6080 | those object are included in the information printed. |
---|
6081 | |
---|
6082 | **EXIT STATUS:** |
---|
6083 | |
---|
6084 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6085 | |
---|
6086 | **NOTES:** |
---|
6087 | |
---|
6088 | NONE |
---|
6089 | |
---|
6090 | **EXAMPLES:** |
---|
6091 | |
---|
6092 | The following is an example of using the ``region`` command |
---|
6093 | on a system with no user extensions. |
---|
6094 | .. code:: c |
---|
6095 | |
---|
6096 | SHLL \[/] $ region |
---|
6097 | ID NAME ATTR STARTADDR LENGTH PAGE_SIZE USED_BLOCKS |
---|
6098 | ------------------------------------------------------------------------------ |
---|
6099 | |
---|
6100 | **CONFIGURATION:** |
---|
6101 | |
---|
6102 | .. index:: CONFIGURE_SHELL_NO_COMMAND_REGION |
---|
6103 | .. index:: CONFIGURE_SHELL_COMMAND_REGION |
---|
6104 | |
---|
6105 | This command is included in the default shell command set. |
---|
6106 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_REGION`` to have this |
---|
6107 | command included. |
---|
6108 | |
---|
6109 | This command can be excluded from the shell command set by |
---|
6110 | defining ``CONFIGURE_SHELL_NO_COMMAND_REGION`` when all |
---|
6111 | shell commands have been configured. |
---|
6112 | |
---|
6113 | **PROGRAMMING INFORMATION:** |
---|
6114 | |
---|
6115 | .. index:: rtems_shell_rtems_main_region |
---|
6116 | |
---|
6117 | The ``region`` is implemented by a C language function |
---|
6118 | which has the following prototype: |
---|
6119 | .. code:: c |
---|
6120 | |
---|
6121 | int rtems_shell_rtems_main_region( |
---|
6122 | int argc, |
---|
6123 | char \**argv |
---|
6124 | ); |
---|
6125 | |
---|
6126 | The configuration structure for the ``region`` has the |
---|
6127 | following prototype: |
---|
6128 | .. code:: c |
---|
6129 | |
---|
6130 | extern rtems_shell_cmd_t rtems_shell_REGION_Command; |
---|
6131 | |
---|
6132 | part - display information about partitions |
---|
6133 | ------------------------------------------- |
---|
6134 | .. index:: part |
---|
6135 | |
---|
6136 | **SYNOPSYS:** |
---|
6137 | |
---|
6138 | .. code:: c |
---|
6139 | |
---|
6140 | part \[id \[id ... ] ] |
---|
6141 | |
---|
6142 | **DESCRIPTION:** |
---|
6143 | |
---|
6144 | When invoked with no arguments, this command prints information on |
---|
6145 | the set of Classic API Partitions currently active in the system. |
---|
6146 | |
---|
6147 | If invoked with a set of object ids as arguments, then just |
---|
6148 | those objects are included in the information printed. |
---|
6149 | |
---|
6150 | **EXIT STATUS:** |
---|
6151 | |
---|
6152 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6153 | |
---|
6154 | **NOTES:** |
---|
6155 | |
---|
6156 | NONE |
---|
6157 | |
---|
6158 | **EXAMPLES:** |
---|
6159 | |
---|
6160 | The following is an example of using the ``part`` command |
---|
6161 | on a system with no user extensions. |
---|
6162 | .. code:: c |
---|
6163 | |
---|
6164 | SHLL \[/] $ part |
---|
6165 | ID NAME ATTR STARTADDR LENGTH BUF_SIZE USED_BLOCKS |
---|
6166 | ------------------------------------------------------------------------------ |
---|
6167 | |
---|
6168 | **CONFIGURATION:** |
---|
6169 | |
---|
6170 | .. index:: CONFIGURE_SHELL_NO_COMMAND_PART |
---|
6171 | .. index:: CONFIGURE_SHELL_COMMAND_PART |
---|
6172 | |
---|
6173 | This command is included in the default shell command set. |
---|
6174 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_PART`` to have this |
---|
6175 | command included. |
---|
6176 | |
---|
6177 | This command can be excluded from the shell command set by |
---|
6178 | defining ``CONFIGURE_SHELL_NO_COMMAND_PART`` when all |
---|
6179 | shell commands have been configured. |
---|
6180 | |
---|
6181 | **PROGRAMMING INFORMATION:** |
---|
6182 | |
---|
6183 | .. index:: rtems_shell_rtems_main_part |
---|
6184 | |
---|
6185 | The ``part`` is implemented by a C language function |
---|
6186 | which has the following prototype: |
---|
6187 | .. code:: c |
---|
6188 | |
---|
6189 | int rtems_shell_rtems_main_part( |
---|
6190 | int argc, |
---|
6191 | char \**argv |
---|
6192 | ); |
---|
6193 | |
---|
6194 | The configuration structure for the ``part`` has the |
---|
6195 | following prototype: |
---|
6196 | .. code:: c |
---|
6197 | |
---|
6198 | extern rtems_shell_cmd_t rtems_shell_PART_Command; |
---|
6199 | |
---|
6200 | object - display information about rtems objects |
---|
6201 | ------------------------------------------------ |
---|
6202 | .. index:: object |
---|
6203 | |
---|
6204 | **SYNOPSYS:** |
---|
6205 | |
---|
6206 | .. code:: c |
---|
6207 | |
---|
6208 | object \[id \[id ...] ] |
---|
6209 | |
---|
6210 | **DESCRIPTION:** |
---|
6211 | |
---|
6212 | When invoked with a set of object ids as arguments, then |
---|
6213 | a report on those objects is printed. |
---|
6214 | |
---|
6215 | **EXIT STATUS:** |
---|
6216 | |
---|
6217 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6218 | |
---|
6219 | **NOTES:** |
---|
6220 | |
---|
6221 | NONE |
---|
6222 | |
---|
6223 | **EXAMPLES:** |
---|
6224 | |
---|
6225 | The following is an example of how to use ``object``: |
---|
6226 | .. code:: c |
---|
6227 | |
---|
6228 | SHLL \[/] $ object 0a010001 1a010002 |
---|
6229 | ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES |
---|
6230 | ------------------------------------------------------------------------------ |
---|
6231 | 0a010001 UI1 1 SUSP P:T:nA NONE |
---|
6232 | ID NAME ATTR PRICEIL CURR_CNT HOLDID |
---|
6233 | ------------------------------------------------------------------------------ |
---|
6234 | 1a010002 TRmi PR:BI:IN 0 1 00000000 |
---|
6235 | |
---|
6236 | **CONFIGURATION:** |
---|
6237 | |
---|
6238 | .. index:: CONFIGURE_SHELL_NO_COMMAND_OBJECT |
---|
6239 | .. index:: CONFIGURE_SHELL_COMMAND_OBJECT |
---|
6240 | |
---|
6241 | This command is included in the default shell command set. |
---|
6242 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_OBJECT`` to have this |
---|
6243 | command included. |
---|
6244 | |
---|
6245 | This command can be excluded from the shell command set by |
---|
6246 | defining ``CONFIGURE_SHELL_NO_COMMAND_OBJECT`` when all |
---|
6247 | shell commands have been configured. |
---|
6248 | |
---|
6249 | **PROGRAMMING INFORMATION:** |
---|
6250 | |
---|
6251 | .. index:: rtems_shell_rtems_main_object |
---|
6252 | |
---|
6253 | The ``object`` is implemented by a C language function |
---|
6254 | which has the following prototype: |
---|
6255 | .. code:: c |
---|
6256 | |
---|
6257 | int rtems_shell_rtems_main_object( |
---|
6258 | int argc, |
---|
6259 | char \**argv |
---|
6260 | ); |
---|
6261 | |
---|
6262 | The configuration structure for the ``object`` has the |
---|
6263 | following prototype: |
---|
6264 | .. code:: c |
---|
6265 | |
---|
6266 | extern rtems_shell_cmd_t rtems_shell_OBJECT_Command; |
---|
6267 | |
---|
6268 | driver - display the rtems device driver table |
---|
6269 | ---------------------------------------------- |
---|
6270 | .. index:: driver |
---|
6271 | |
---|
6272 | **SYNOPSYS:** |
---|
6273 | |
---|
6274 | .. code:: c |
---|
6275 | |
---|
6276 | driver [ major [ major ... ] ] |
---|
6277 | |
---|
6278 | **DESCRIPTION:** |
---|
6279 | |
---|
6280 | When invoked with no arguments, this command prints information on |
---|
6281 | the set of Device Drivers currently active in the system. |
---|
6282 | |
---|
6283 | If invoked with a set of major numbers as arguments, then just |
---|
6284 | those Device Drivers are included in the information printed. |
---|
6285 | |
---|
6286 | **EXIT STATUS:** |
---|
6287 | |
---|
6288 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6289 | |
---|
6290 | **NOTES:** |
---|
6291 | |
---|
6292 | NONE |
---|
6293 | |
---|
6294 | **EXAMPLES:** |
---|
6295 | |
---|
6296 | The following is an example of how to use ``driver``: |
---|
6297 | .. code:: c |
---|
6298 | |
---|
6299 | SHLL \[/] $ driver |
---|
6300 | Major Entry points |
---|
6301 | ------------------------------------------------------------------------------ |
---|
6302 | 0 init: \[0x200256c]; control: \[0x20024c8] |
---|
6303 | open: \[0x2002518]; close: \[0x2002504] |
---|
6304 | read: \[0x20024f0]; write: \[0x20024dc] |
---|
6305 | 1 init: \[0x20023fc]; control: \[0x2002448] |
---|
6306 | open: \[0x0]; close: \[0x0] |
---|
6307 | read: \[0x0]; write: \[0x0] |
---|
6308 | SHLL \[/] $ |
---|
6309 | |
---|
6310 | **CONFIGURATION:** |
---|
6311 | |
---|
6312 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DRIVER |
---|
6313 | .. index:: CONFIGURE_SHELL_COMMAND_DRIVER |
---|
6314 | |
---|
6315 | This command is included in the default shell command set. |
---|
6316 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DRIVER`` to have this |
---|
6317 | command included. |
---|
6318 | |
---|
6319 | This command can be excluded from the shell command set by |
---|
6320 | defining ``CONFIGURE_SHELL_NO_COMMAND_DRIVER`` when all |
---|
6321 | shell commands have been configured. |
---|
6322 | |
---|
6323 | **PROGRAMMING INFORMATION:** |
---|
6324 | |
---|
6325 | .. index:: rtems_shell_rtems_main_driver |
---|
6326 | |
---|
6327 | The ``driver`` is implemented by a C language function |
---|
6328 | which has the following prototype: |
---|
6329 | .. code:: c |
---|
6330 | |
---|
6331 | int rtems_shell_rtems_main_driver( |
---|
6332 | int argc, |
---|
6333 | char \**argv |
---|
6334 | ); |
---|
6335 | |
---|
6336 | The configuration structure for the ``driver`` has the |
---|
6337 | following prototype: |
---|
6338 | .. code:: c |
---|
6339 | |
---|
6340 | extern rtems_shell_cmd_t rtems_shell_DRIVER_Command; |
---|
6341 | |
---|
6342 | dname - displays information about named drivers |
---|
6343 | ------------------------------------------------ |
---|
6344 | .. index:: dname |
---|
6345 | |
---|
6346 | **SYNOPSYS:** |
---|
6347 | |
---|
6348 | .. code:: c |
---|
6349 | |
---|
6350 | dname |
---|
6351 | |
---|
6352 | **DESCRIPTION:** |
---|
6353 | |
---|
6354 | This command XXX |
---|
6355 | |
---|
6356 | WARNING! XXX This command does not appear to work as of 27 February 2008. |
---|
6357 | |
---|
6358 | **EXIT STATUS:** |
---|
6359 | |
---|
6360 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6361 | |
---|
6362 | **NOTES:** |
---|
6363 | |
---|
6364 | NONE |
---|
6365 | |
---|
6366 | **EXAMPLES:** |
---|
6367 | |
---|
6368 | The following is an example of how to use ``dname``: |
---|
6369 | .. code:: c |
---|
6370 | |
---|
6371 | EXAMPLE_TBD |
---|
6372 | |
---|
6373 | **CONFIGURATION:** |
---|
6374 | |
---|
6375 | .. index:: CONFIGURE_SHELL_NO_COMMAND_DNAME |
---|
6376 | .. index:: CONFIGURE_SHELL_COMMAND_DNAME |
---|
6377 | |
---|
6378 | This command is included in the default shell command set. |
---|
6379 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DNAME`` to have this |
---|
6380 | command included. |
---|
6381 | |
---|
6382 | This command can be excluded from the shell command set by |
---|
6383 | defining ``CONFIGURE_SHELL_NO_COMMAND_DNAME`` when all |
---|
6384 | shell commands have been configured. |
---|
6385 | |
---|
6386 | **PROGRAMMING INFORMATION:** |
---|
6387 | |
---|
6388 | .. index:: rtems_shell_rtems_main_dname |
---|
6389 | |
---|
6390 | The ``dname`` is implemented by a C language function |
---|
6391 | which has the following prototype: |
---|
6392 | .. code:: c |
---|
6393 | |
---|
6394 | int rtems_shell_rtems_main_dname( |
---|
6395 | int argc, |
---|
6396 | char \**argv |
---|
6397 | ); |
---|
6398 | |
---|
6399 | The configuration structure for the ``dname`` has the |
---|
6400 | following prototype: |
---|
6401 | .. code:: c |
---|
6402 | |
---|
6403 | extern rtems_shell_cmd_t rtems_shell_DNAME_Command; |
---|
6404 | |
---|
6405 | pthread - display information about POSIX threads |
---|
6406 | ------------------------------------------------- |
---|
6407 | .. index:: pthread |
---|
6408 | |
---|
6409 | **SYNOPSYS:** |
---|
6410 | |
---|
6411 | .. code:: c |
---|
6412 | |
---|
6413 | pthread \[id \[id ...] ] |
---|
6414 | |
---|
6415 | **DESCRIPTION:** |
---|
6416 | |
---|
6417 | When invoked with no arguments, this command prints information on |
---|
6418 | the set of POSIX API threads currently active in the system. |
---|
6419 | |
---|
6420 | If invoked with a set of ids as arguments, then just |
---|
6421 | those objects are included in the information printed. |
---|
6422 | |
---|
6423 | **EXIT STATUS:** |
---|
6424 | |
---|
6425 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6426 | |
---|
6427 | **NOTES:** |
---|
6428 | |
---|
6429 | This command is only available when the POSIX API is configured. |
---|
6430 | |
---|
6431 | **EXAMPLES:** |
---|
6432 | |
---|
6433 | The following is an example of how to use the ``task`` on an |
---|
6434 | application with four POSIX threads: |
---|
6435 | .. code:: c |
---|
6436 | |
---|
6437 | SHLL \[/] $ pthread |
---|
6438 | ID NAME PRI STATE MODES EVENTS WAITID WAITARG NOTES |
---|
6439 | ------------------------------------------------------------------------------ |
---|
6440 | 0b010002 Main 133 READY P:T:nA NONE 43010001 0x7b1148 |
---|
6441 | 0b010003 ISR 133 Wcvar P:T:nA NONE 43010003 0x7b1148 |
---|
6442 | 0b01000c 133 READY P:T:nA NONE 33010002 0x7b1148 |
---|
6443 | 0b01000d 133 Wmutex P:T:nA NONE 33010002 0x7b1148 |
---|
6444 | |
---|
6445 | **CONFIGURATION:** |
---|
6446 | |
---|
6447 | This command is part of the monitor commands which are always |
---|
6448 | available in the shell. |
---|
6449 | |
---|
6450 | **PROGRAMMING INFORMATION:** |
---|
6451 | |
---|
6452 | This command is not directly available for invocation. |
---|
6453 | |
---|
6454 | .. COMMENT: COPYRIGHT (c) 1988-2008. |
---|
6455 | |
---|
6456 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
6457 | |
---|
6458 | .. COMMENT: All rights reserved. |
---|
6459 | |
---|
6460 | Network Commands |
---|
6461 | ################ |
---|
6462 | |
---|
6463 | Introduction |
---|
6464 | ============ |
---|
6465 | |
---|
6466 | The RTEMS shell has the following network commands: |
---|
6467 | |
---|
6468 | - ``netstats`` - obtain network statistics |
---|
6469 | |
---|
6470 | - ``ifconfig`` - configure a network interface |
---|
6471 | |
---|
6472 | - ``route`` - show or manipulate the IP routing table |
---|
6473 | |
---|
6474 | - ``ping`` - ping a host or IP address |
---|
6475 | |
---|
6476 | Commands |
---|
6477 | ======== |
---|
6478 | |
---|
6479 | This section details the Network Commands available. A |
---|
6480 | subsection is dedicated to each of the commands and |
---|
6481 | describes the behavior and configuration of that |
---|
6482 | command as well as providing an example usage. |
---|
6483 | |
---|
6484 | netstats - obtain network statistics |
---|
6485 | ------------------------------------ |
---|
6486 | .. index:: netstats |
---|
6487 | |
---|
6488 | **SYNOPSYS:** |
---|
6489 | |
---|
6490 | .. code:: c |
---|
6491 | |
---|
6492 | netstats \[-Aimfpcut] |
---|
6493 | |
---|
6494 | **DESCRIPTION:** |
---|
6495 | |
---|
6496 | This command is used to display various types of network statistics. The |
---|
6497 | information displayed can be specified using command line arguments in |
---|
6498 | various combinations. The arguments are interpreted as follows: |
---|
6499 | |
---|
6500 | *-A* |
---|
6501 | print All statistics |
---|
6502 | |
---|
6503 | *-i* |
---|
6504 | print Inet Routes |
---|
6505 | |
---|
6506 | *-m* |
---|
6507 | print MBUF Statistics |
---|
6508 | |
---|
6509 | *-f* |
---|
6510 | print IF Statistics |
---|
6511 | |
---|
6512 | *-p* |
---|
6513 | print IP Statistics |
---|
6514 | |
---|
6515 | *-c* |
---|
6516 | print ICMP Statistics |
---|
6517 | |
---|
6518 | *-u* |
---|
6519 | print UDP Statistics |
---|
6520 | |
---|
6521 | *-t* |
---|
6522 | print TCP Statistics |
---|
6523 | |
---|
6524 | **EXIT STATUS:** |
---|
6525 | |
---|
6526 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6527 | |
---|
6528 | **NOTES:** |
---|
6529 | |
---|
6530 | NONE |
---|
6531 | |
---|
6532 | **EXAMPLES:** |
---|
6533 | |
---|
6534 | The following is an example of how to use ``netstats``: |
---|
6535 | |
---|
6536 | The following is an example of using the ``netstats`` |
---|
6537 | command to print the IP routing table: |
---|
6538 | .. code:: c |
---|
6539 | |
---|
6540 | [/] $ netstats -i |
---|
6541 | Destination Gateway/Mask/Hw Flags Refs Use Expire Interface |
---|
6542 | default 192.168.1.14 UGS 0 0 0 eth1 |
---|
6543 | 192.168.1.0 255.255.255.0 U 0 0 1 eth1 |
---|
6544 | 192.168.1.14 00:A0:C8:1C:EE:28 UHL 1 0 1219 eth1 |
---|
6545 | 192.168.1.51 00:1D:7E:0C:D0:7C UHL 0 840 1202 eth1 |
---|
6546 | 192.168.1.151 00:1C:23:B2:0F:BB UHL 1 23 1219 eth1 |
---|
6547 | |
---|
6548 | The following is an example of using the ``netstats`` |
---|
6549 | command to print the MBUF statistics: |
---|
6550 | .. code:: c |
---|
6551 | |
---|
6552 | [/] $ netstats -m |
---|
6553 | \************ MBUF STATISTICS \************ |
---|
6554 | mbufs:2048 clusters: 128 free: 63 |
---|
6555 | drops: 0 waits: 0 drains: 0 |
---|
6556 | free:1967 data:79 header:2 socket:0 |
---|
6557 | pcb:0 rtable:0 htable:0 atable:0 |
---|
6558 | soname:0 soopts:0 ftable:0 rights:0 |
---|
6559 | ifaddr:0 control:0 oobdata:0 |
---|
6560 | |
---|
6561 | The following is an example of using the ``netstats`` |
---|
6562 | command to print the print the interface statistics: |
---|
6563 | .. code:: c |
---|
6564 | |
---|
6565 | [/] $ netstats -f |
---|
6566 | \************ INTERFACE STATISTICS \************ |
---|
6567 | \***** eth1 \***** |
---|
6568 | Ethernet Address: 00:04:9F:00:5B:21 |
---|
6569 | Address:192.168.1.244 Broadcast Address:192.168.1.255 Net mask:255.255.255.0 |
---|
6570 | Flags: Up Broadcast Running Active Multicast |
---|
6571 | Send queue limit:50 length:1 Dropped:0 |
---|
6572 | Rx Interrupts:889 Not First:0 Not Last:0 |
---|
6573 | Giant:0 Non-octet:0 |
---|
6574 | Bad CRC:0 Overrun:0 Collision:0 |
---|
6575 | Tx Interrupts:867 Deferred:0 Late Collision:0 |
---|
6576 | Retransmit Limit:0 Underrun:0 Misaligned:0 |
---|
6577 | |
---|
6578 | The following is an example of using the ``netstats`` |
---|
6579 | command to print the print IP statistics: |
---|
6580 | .. code:: c |
---|
6581 | |
---|
6582 | [/] $ netstats -p |
---|
6583 | \************ IP Statistics \************ |
---|
6584 | total packets received 894 |
---|
6585 | packets rcvd for unreachable dest 13 |
---|
6586 | datagrams delivered to upper level 881 |
---|
6587 | total ip packets generated here 871 |
---|
6588 | |
---|
6589 | The following is an example of using the ``netstats`` |
---|
6590 | command to print the ICMP statistics: |
---|
6591 | .. code:: c |
---|
6592 | |
---|
6593 | [/] $ netstats -c |
---|
6594 | \************ ICMP Statistics \************ |
---|
6595 | Type 0 sent 843 |
---|
6596 | number of responses 843 |
---|
6597 | Type 8 received 843 |
---|
6598 | |
---|
6599 | The following is an example of using the ``netstats`` |
---|
6600 | command to print the UDP statistics: |
---|
6601 | .. code:: c |
---|
6602 | |
---|
6603 | [/] $ netstats -u |
---|
6604 | \************ UDP Statistics \************ |
---|
6605 | |
---|
6606 | The following is an example of using the ``netstats`` |
---|
6607 | command to print the TCP statistics: |
---|
6608 | .. code:: c |
---|
6609 | |
---|
6610 | [/] $ netstats -t |
---|
6611 | \************ TCP Statistics \************ |
---|
6612 | connections accepted 1 |
---|
6613 | connections established 1 |
---|
6614 | segs where we tried to get rtt 34 |
---|
6615 | times we succeeded 35 |
---|
6616 | delayed acks sent 2 |
---|
6617 | total packets sent 37 |
---|
6618 | data packets sent 35 |
---|
6619 | data bytes sent 2618 |
---|
6620 | ack-only packets sent 2 |
---|
6621 | total packets received 47 |
---|
6622 | packets received in sequence 12 |
---|
6623 | bytes received in sequence 307 |
---|
6624 | rcvd ack packets 35 |
---|
6625 | bytes acked by rcvd acks 2590 |
---|
6626 | times hdr predict ok for acks 27 |
---|
6627 | times hdr predict ok for data pkts 10 |
---|
6628 | |
---|
6629 | **CONFIGURATION:** |
---|
6630 | |
---|
6631 | .. index:: CONFIGURE_SHELL_NO_COMMAND_NETSTATS |
---|
6632 | .. index:: CONFIGURE_SHELL_COMMAND_NETSTATS |
---|
6633 | |
---|
6634 | This command is included in the default shell command set. |
---|
6635 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_NETSTATS`` to have this |
---|
6636 | command included. |
---|
6637 | |
---|
6638 | This command can be excluded from the shell command set by |
---|
6639 | defining ``CONFIGURE_SHELL_NO_COMMAND_NETSTATS`` when all |
---|
6640 | shell commands have been configured. |
---|
6641 | |
---|
6642 | **PROGRAMMING INFORMATION:** |
---|
6643 | |
---|
6644 | .. index:: rtems_shell_rtems_main_netstats |
---|
6645 | |
---|
6646 | The ``netstats`` is implemented by a C language function |
---|
6647 | which has the following prototype: |
---|
6648 | .. code:: c |
---|
6649 | |
---|
6650 | int rtems_shell_rtems_main_netstats( |
---|
6651 | int argc, |
---|
6652 | char \**argv |
---|
6653 | ); |
---|
6654 | |
---|
6655 | The configuration structure for the ``netstats`` has the |
---|
6656 | following prototype: |
---|
6657 | .. code:: c |
---|
6658 | |
---|
6659 | extern rtems_shell_cmd_t rtems_shell_NETSTATS_Command; |
---|
6660 | |
---|
6661 | ifconfig - configure a network interface |
---|
6662 | ---------------------------------------- |
---|
6663 | .. index:: ifconfig |
---|
6664 | |
---|
6665 | **SYNOPSYS:** |
---|
6666 | |
---|
6667 | .. code:: c |
---|
6668 | |
---|
6669 | ifconfig |
---|
6670 | ifconfig interface |
---|
6671 | ifconfig interface \[up|down] |
---|
6672 | ifconfig interface \[netmask|pointtopoint|broadcast] IP |
---|
6673 | |
---|
6674 | **DESCRIPTION:** |
---|
6675 | |
---|
6676 | This command may be used to display information about the |
---|
6677 | network interfaces in the system or configure them. |
---|
6678 | |
---|
6679 | **EXIT STATUS:** |
---|
6680 | |
---|
6681 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6682 | |
---|
6683 | **NOTES:** |
---|
6684 | |
---|
6685 | Just like its counterpart on GNU/Linux and BSD systems, this command |
---|
6686 | is complicated. More example usages would be a welcome submission. |
---|
6687 | |
---|
6688 | **EXAMPLES:** |
---|
6689 | |
---|
6690 | The following is an example of how to use ``ifconfig``: |
---|
6691 | .. code:: c |
---|
6692 | |
---|
6693 | ************ INTERFACE STATISTICS \************ |
---|
6694 | \***** eth1 \***** |
---|
6695 | Ethernet Address: 00:04:9F:00:5B:21 |
---|
6696 | Address:192.168.1.244 Broadcast Address:192.168.1.255 Net mask:255.255.255.0 |
---|
6697 | Flags: Up Broadcast Running Active Multicast |
---|
6698 | Send queue limit:50 length:1 Dropped:0 |
---|
6699 | Rx Interrupts:5391 Not First:0 Not Last:0 |
---|
6700 | Giant:0 Non-octet:0 |
---|
6701 | Bad CRC:0 Overrun:0 Collision:0 |
---|
6702 | Tx Interrupts:5256 Deferred:0 Late Collision:0 |
---|
6703 | Retransmit Limit:0 Underrun:0 Misaligned:0 |
---|
6704 | |
---|
6705 | **CONFIGURATION:** |
---|
6706 | |
---|
6707 | .. index:: CONFIGURE_SHELL_NO_COMMAND_IFCONFIG |
---|
6708 | .. index:: CONFIGURE_SHELL_COMMAND_IFCONFIG |
---|
6709 | |
---|
6710 | This command is included in the default shell command set. |
---|
6711 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_IFCONFIG`` to have this |
---|
6712 | command included. |
---|
6713 | |
---|
6714 | This command can be excluded from the shell command set by |
---|
6715 | defining ``CONFIGURE_SHELL_NO_COMMAND_IFCONFIG`` when all |
---|
6716 | shell commands have been configured. |
---|
6717 | |
---|
6718 | **PROGRAMMING INFORMATION:** |
---|
6719 | |
---|
6720 | .. index:: rtems_shell_rtems_main_ifconfig |
---|
6721 | |
---|
6722 | The ``ifconfig`` is implemented by a C language function |
---|
6723 | which has the following prototype: |
---|
6724 | .. code:: c |
---|
6725 | |
---|
6726 | int rtems_shell_rtems_main_ifconfig( |
---|
6727 | int argc, |
---|
6728 | char \**argv |
---|
6729 | ); |
---|
6730 | |
---|
6731 | The configuration structure for the ``ifconfig`` has the |
---|
6732 | following prototype: |
---|
6733 | .. code:: c |
---|
6734 | |
---|
6735 | extern rtems_shell_cmd_t rtems_shell_IFCONFIG_Command; |
---|
6736 | |
---|
6737 | route - show or manipulate the ip routing table |
---|
6738 | ----------------------------------------------- |
---|
6739 | .. index:: route |
---|
6740 | |
---|
6741 | **SYNOPSYS:** |
---|
6742 | |
---|
6743 | .. code:: c |
---|
6744 | |
---|
6745 | route \[subcommand] \[args] |
---|
6746 | |
---|
6747 | **DESCRIPTION:** |
---|
6748 | |
---|
6749 | This command is used to display and manipulate the routing table. |
---|
6750 | When invoked with no arguments, the current routing information is |
---|
6751 | displayed. When invoked with the subcommands ``add`` or ``del``, |
---|
6752 | then additional arguments must be provided to describe the route. |
---|
6753 | |
---|
6754 | Command templates include the following: |
---|
6755 | .. code:: c |
---|
6756 | |
---|
6757 | route \[add|del] -net IP_ADDRESS gw GATEWAY_ADDRESS \[netmask MASK] |
---|
6758 | route \[add|del] -host IP_ADDRESS gw GATEWAY_ADDRES \[netmask MASK] |
---|
6759 | |
---|
6760 | When not provided the netmask defaults to ``255.255.255.0`` |
---|
6761 | |
---|
6762 | **EXIT STATUS:** |
---|
6763 | |
---|
6764 | This command returns 0 on success and non-zero if an error is encountered. |
---|
6765 | |
---|
6766 | **NOTES:** |
---|
6767 | |
---|
6768 | Just like its counterpart on GNU/Linux and BSD systems, this command |
---|
6769 | is complicated. More example usages would be a welcome submission. |
---|
6770 | |
---|
6771 | **EXAMPLES:** |
---|
6772 | |
---|
6773 | The following is an example of how to use ``route`` to display, |
---|
6774 | add, and delete a new route: |
---|
6775 | .. code:: c |
---|
6776 | |
---|
6777 | [/] $ route |
---|
6778 | Destination Gateway/Mask/Hw Flags Refs Use Expire Interface |
---|
6779 | default 192.168.1.14 UGS 0 0 0 eth1 |
---|
6780 | 192.168.1.0 255.255.255.0 U 0 0 1 eth1 |
---|
6781 | 192.168.1.14 00:A0:C8:1C:EE:28 UHL 1 0 1444 eth1 |
---|
6782 | 192.168.1.51 00:1D:7E:0C:D0:7C UHL 0 10844 1202 eth1 |
---|
6783 | 192.168.1.151 00:1C:23:B2:0F:BB UHL 2 37 1399 eth1 |
---|
6784 | \[/] $ route add -net 192.168.3.0 gw 192.168.1.14 |
---|
6785 | \[/] $ route |
---|
6786 | Destination Gateway/Mask/Hw Flags Refs Use Expire Interface |
---|
6787 | default 192.168.1.14 UGS 0 0 0 eth1 |
---|
6788 | 192.168.1.0 255.255.255.0 U 0 0 1 eth1 |
---|
6789 | 192.168.1.14 00:A0:C8:1C:EE:28 UHL 2 0 1498 eth1 |
---|
6790 | 192.168.1.51 00:1D:7E:0C:D0:7C UHL 0 14937 1202 eth1 |
---|
6791 | 192.168.1.151 00:1C:23:B2:0F:BB UHL 2 96 1399 eth1 |
---|
6792 | 192.168.3.0 192.168.1.14 UGS 0 0 0 eth1 |
---|
6793 | \[/] $ route del -net 192.168.3.0 gw 192.168.1.14 |
---|
6794 | \[/] $ route |
---|
6795 | Destination Gateway/Mask/Hw Flags Refs Use Expire Interface |
---|
6796 | default 192.168.1.14 UGS 0 0 0 eth1 |
---|
6797 | 192.168.1.0 255.255.255.0 U 0 0 1 eth1 |
---|
6798 | 192.168.1.14 00:A0:C8:1C:EE:28 UHL 1 0 1498 eth1 |
---|
6799 | 192.168.1.51 00:1D:7E:0C:D0:7C UHL 0 15945 1202 eth1 |
---|
6800 | 192.168.1.151 00:1C:23:B2:0F:BB UHL 2 117 1399 eth1 |
---|
6801 | |
---|
6802 | **CONFIGURATION:** |
---|
6803 | |
---|
6804 | .. index:: CONFIGURE_SHELL_NO_COMMAND_ROUTE |
---|
6805 | .. index:: CONFIGURE_SHELL_COMMAND_ROUTE |
---|
6806 | |
---|
6807 | This command is included in the default shell command set. |
---|
6808 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_ROUTE`` to have this |
---|
6809 | command included. |
---|
6810 | |
---|
6811 | This command can be excluded from the shell command set by |
---|
6812 | defining ``CONFIGURE_SHELL_NO_COMMAND_ROUTE`` when all |
---|
6813 | shell commands have been configured. |
---|
6814 | |
---|
6815 | **PROGRAMMING INFORMATION:** |
---|
6816 | |
---|
6817 | .. index:: rtems_shell_rtems_main_route |
---|
6818 | |
---|
6819 | The ``route`` is implemented by a C language function |
---|
6820 | which has the following prototype: |
---|
6821 | .. code:: c |
---|
6822 | |
---|
6823 | int rtems_shell_rtems_main_route( |
---|
6824 | int argc, |
---|
6825 | char \**argv |
---|
6826 | ); |
---|
6827 | |
---|
6828 | The configuration structure for the ``route`` has the |
---|
6829 | following prototype: |
---|
6830 | .. code:: c |
---|
6831 | |
---|
6832 | extern rtems_shell_cmd_t rtems_shell_ROUTE_Command; |
---|
6833 | |
---|
6834 | ping - ping a host or IP address |
---|
6835 | -------------------------------- |
---|
6836 | .. index:: ping |
---|
6837 | |
---|
6838 | **SYNOPSYS:** |
---|
6839 | |
---|
6840 | .. code:: c |
---|
6841 | |
---|
6842 | ping \[-AaDdfnoQqRrv] \[-c count] \[-G sweepmaxsize] \[-g sweepminsize] |
---|
6843 | \[-h sweepincrsize] \[-i wait] \[-l preload] \[-M mask | time] \[-m ttl] |
---|
6844 | \[-p pattern] \[-S src_addr] \[-s packetsize] \[-t timeout] |
---|
6845 | \[-W waittime] \[-z tos] host |
---|
6846 | ping \[-AaDdfLnoQqRrv] \[-c count] \[-I iface] \[-i wait] \[-l preload] |
---|
6847 | \[-M mask | time] \[-m ttl] \[-p pattern] \[-S src_addr] |
---|
6848 | \[-s packetsize] \[-T ttl] \[-t timeout] \[-W waittime] |
---|
6849 | \[-z tos] mcast-group |
---|
6850 | |
---|
6851 | **DESCRIPTION:** |
---|
6852 | |
---|
6853 | The ping utility uses the ICMP protocolâs mandatory ECHO_REQUEST |
---|
6854 | datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. |
---|
6855 | ECHO_REQUEST datagrams (âpingsâ) have an IP and ICMP header, |
---|
6856 | followed by a âstruct timevalâ and then an arbitrary number of |
---|
6857 | âpadâ bytes used to fill out the packet. The options are as |
---|
6858 | follows: |
---|
6859 | |
---|
6860 | *-A* |
---|
6861 | Audible. Output a bell (ASCII 0x07) character when no packet is |
---|
6862 | received before the next packet is transmitted. To cater for |
---|
6863 | round-trip times that are longer than the interval between |
---|
6864 | transmissions, further missing packets cause a bell only if the |
---|
6865 | maximum number of unreceived packets has increased. |
---|
6866 | |
---|
6867 | *-a* |
---|
6868 | Audible. Include a bell (ASCII 0x07) character in the output when any |
---|
6869 | packet is received. This option is ignored if other format options |
---|
6870 | are present. |
---|
6871 | |
---|
6872 | *-c count* |
---|
6873 | Stop after sending (and receiving) count ECHO_RESPONSE packets. If |
---|
6874 | this option is not specified, ping will operate until interrupted. If |
---|
6875 | this option is specified in conjunction with ping sweeps, each sweep |
---|
6876 | will consist of count packets. |
---|
6877 | |
---|
6878 | *-D* |
---|
6879 | Set the Donât Fragment bit. |
---|
6880 | |
---|
6881 | *-d* |
---|
6882 | Set the SO_DEBUG option on the socket being used. |
---|
6883 | |
---|
6884 | *-f* |
---|
6885 | Flood ping. Outputs packets as fast as they come back or one |
---|
6886 | hundred times per second, whichever is more. For every ECHO_REQUEST |
---|
6887 | sent a period â.â is printed, while for every ECHO_REPLY received a |
---|
6888 | backspace is printed. This provides a rapid display of how many |
---|
6889 | packets are being dropped. Only the super-user may use this option. |
---|
6890 | This can be very hard on a network and should be used with caution. |
---|
6891 | |
---|
6892 | *-G sweepmaxsize* |
---|
6893 | Specify the maximum size of ICMP payload when sending sweeping pings. |
---|
6894 | This option is required for ping sweeps. |
---|
6895 | |
---|
6896 | *-g sweepminsize* |
---|
6897 | Specify the size of ICMP payload to start with when sending sweeping |
---|
6898 | pings. The default value is 0. |
---|
6899 | |
---|
6900 | *-h sweepincrsize* |
---|
6901 | Specify the number of bytes to increment the size of ICMP payload |
---|
6902 | after each sweep when sending sweeping pings. The default value is 1. |
---|
6903 | |
---|
6904 | *-I iface* |
---|
6905 | Source multicast packets with the given interface address. This flag |
---|
6906 | only applies if the ping destination is a multicast address. |
---|
6907 | |
---|
6908 | *-i wait* |
---|
6909 | Wait wait seconds between sending each packet. The default is to wait |
---|
6910 | for one second between each packet. The wait time may be fractional, |
---|
6911 | but only the super-user may specify values less than 1 second. This |
---|
6912 | option is incompatible with the -f option. |
---|
6913 | |
---|
6914 | *-L* |
---|
6915 | Suppress loopback of multicast packets. This flag only applies if the |
---|
6916 | ping destination is a multicast address. |
---|
6917 | |
---|
6918 | *-l preload* |
---|
6919 | If preload is specified, ping sends that many packets as fast as |
---|
6920 | possible before falling into its normal mode of behavior. Only the |
---|
6921 | super-user may use this option. |
---|
6922 | |
---|
6923 | *-M mask | time* |
---|
6924 | Use ICMP_MASKREQ or ICMP_TSTAMP instead of ICMP_ECHO. For mask, print |
---|
6925 | the netmask of the remote machine. Set the net.inet.icmp.maskrepl MIB |
---|
6926 | variable to enable ICMP_MASKREPLY. For time, print the origination, |
---|
6927 | reception and transmission timestamps. |
---|
6928 | |
---|
6929 | *-m ttl* |
---|
6930 | Set the IP Time To Live for outgoing packets. If not specified, the |
---|
6931 | kernel uses the value of the net.inet.ip.ttl MIB variable. |
---|
6932 | |
---|
6933 | *-n* |
---|
6934 | Numeric output only. No attempt will be made to lookup symbolic names |
---|
6935 | for host addresses. |
---|
6936 | |
---|
6937 | *-o* |
---|
6938 | Exit successfully after receiving one reply packet. |
---|
6939 | |
---|
6940 | *-p pattern* |
---|
6941 | You may specify up to 16 âpadâ bytes to fill out the packet you |
---|
6942 | send. This is useful for diagnosing data-dependent problems in a |
---|
6943 | network. For example, â-p ffâ will cause the sent packet to be |
---|
6944 | filled with all ones. |
---|
6945 | |
---|
6946 | *-Q* |
---|
6947 | Somewhat quiet output. Donât display ICMP error messages that are in |
---|
6948 | response to our query messages. Originally, the -v flag was required |
---|
6949 | to display such errors, but -v displays all ICMP error messages. On a |
---|
6950 | busy machine, this output can be overbear- ing. Without the -Q flag, |
---|
6951 | ping prints out any ICMP error mes- sages caused by its own |
---|
6952 | ECHO_REQUEST messages. |
---|
6953 | |
---|
6954 | *-q* |
---|
6955 | Quiet output. Nothing is displayed except the summary lines at |
---|
6956 | startup time and when finished. |
---|
6957 | |
---|
6958 | *-R* |
---|
6959 | Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST |
---|
6960 | packet and displays the route buffer on returned packets. Note that |
---|
6961 | the IP header is only large enough for nine such routes; the |
---|
6962 | traceroute(8) command is usually better at determining the route |
---|
6963 | packets take to a particular destination. If more routes come back |
---|
6964 | than should, such as due to an illegal spoofed packet, ping will print |
---|
6965 | the route list and then truncate it at the correct spot. Many hosts |
---|
6966 | ignore or discard the RECORD_ROUTE option. |
---|
6967 | |
---|
6968 | *-r* |
---|
6969 | Bypass the normal routing tables and send directly to a host on an |
---|
6970 | attached network. If the host is not on a directly-attached network, |
---|
6971 | an error is returned. This option can be used to ping a local host |
---|
6972 | through an interface that has no route through it (e.g., after the |
---|
6973 | interface was dropped). |
---|
6974 | |
---|
6975 | *-S src_addr* |
---|
6976 | Use the following IP address as the source address in outgoing |
---|
6977 | packets. On hosts with more than one IP address, this option can be |
---|
6978 | used to force the source address to be something other than the IP |
---|
6979 | address of the interface the probe packet is sent on. If the IP |
---|
6980 | address is not one of this machineâs interface addresses, an error is |
---|
6981 | returned and nothing is sent. |
---|
6982 | |
---|
6983 | *-s packetsize* |
---|
6984 | Specify the number of data bytes to be sent. The default is 56, which |
---|
6985 | translates into 64 ICMP data bytes when combined with the 8 bytes of |
---|
6986 | ICMP header data. Only the super-user may specify val- ues more than |
---|
6987 | default. This option cannot be used with ping sweeps. |
---|
6988 | |
---|
6989 | *-T ttl* |
---|
6990 | Set the IP Time To Live for multicasted packets. This flag only |
---|
6991 | applies if the ping destination is a multicast address. |
---|
6992 | |
---|
6993 | *-t timeout* |
---|
6994 | Specify a timeout, in seconds, before ping exits regardless of how |
---|
6995 | many packets have been received. |
---|
6996 | |
---|
6997 | *-v* |
---|
6998 | Verbose output. ICMP packets other than ECHO_RESPONSE that are |
---|
6999 | received are listed. |
---|
7000 | |
---|
7001 | *-W waittime* |
---|
7002 | Time in milliseconds to wait for a reply for each packet sent. If a |
---|
7003 | reply arrives later, the packet is not printed as replied, but |
---|
7004 | considered as replied when calculating statistics. |
---|
7005 | |
---|
7006 | *-z tos* |
---|
7007 | Use the specified type of service. |
---|
7008 | |
---|
7009 | **EXIT STATUS:** |
---|
7010 | |
---|
7011 | The ping utility exits with one of the following values: |
---|
7012 | |
---|
7013 | 0 At least one response was heard from the specified host. |
---|
7014 | |
---|
7015 | 2 The transmission was successful but no responses were |
---|
7016 | received. |
---|
7017 | |
---|
7018 | any other value an error occurred. These values are defined in |
---|
7019 | <sysexits.h>. |
---|
7020 | |
---|
7021 | **NOTES:** |
---|
7022 | |
---|
7023 | When using ping for fault isolation, it should first be run on the |
---|
7024 | local host, to verify that the local network interface is up and |
---|
7025 | running. Then, hosts and gateways further and further away should be |
---|
7026 | âpingedâ. Round-trip times and packet loss statistics are computed. |
---|
7027 | If duplicate packets are received, they are not included in the packet |
---|
7028 | loss calculation, although the round trip time of these packets is |
---|
7029 | used in calculating the round-trip time statistics. When the |
---|
7030 | specified number of packets have been sent a brief summary is |
---|
7031 | displayed, showing the number of packets sent and received, and the |
---|
7032 | minimum, mean, maximum, and standard deviation of the round-trip |
---|
7033 | times. |
---|
7034 | |
---|
7035 | This program is intended for use in network testing, measurement and |
---|
7036 | management. Because of the load it can impose on the network, it is |
---|
7037 | unwise to use ping during normal operations or from automated scripts. |
---|
7038 | |
---|
7039 | **EXAMPLES:** |
---|
7040 | |
---|
7041 | The following is an example of how to use ``oing`` to ping: |
---|
7042 | .. code:: c |
---|
7043 | |
---|
7044 | [/] # ping 10.10.10.1 |
---|
7045 | PING 10.10.10.1 (10.10.10.1): 56 data bytes |
---|
7046 | 64 bytes from 10.10.10.1: icmp_seq=0 ttl=63 time=0.356 ms |
---|
7047 | 64 bytes from 10.10.10.1: icmp_seq=1 ttl=63 time=0.229 ms |
---|
7048 | 64 bytes from 10.10.10.1: icmp_seq=2 ttl=63 time=0.233 ms |
---|
7049 | 64 bytes from 10.10.10.1: icmp_seq=3 ttl=63 time=0.235 ms |
---|
7050 | 64 bytes from 10.10.10.1: icmp_seq=4 ttl=63 time=0.229 ms |
---|
7051 | --- 10.10.10.1 ping statistics --- |
---|
7052 | 5 packets transmitted, 5 packets received, 0.0% packet loss |
---|
7053 | round-trip min/avg/max/stddev = 0.229/0.256/0.356/0.050 ms |
---|
7054 | \[/] # ping -f -c 10000 10.10.10.1 |
---|
7055 | PING 10.10.10.1 (10.10.10.1): 56 data bytes |
---|
7056 | . |
---|
7057 | --- 10.10.10.1 ping statistics --- |
---|
7058 | 10000 packets transmitted, 10000 packets received, 0.0% packet loss |
---|
7059 | round-trip min/avg/max/stddev = 0.154/0.225/0.533/0.027 ms |
---|
7060 | |
---|
7061 | **CONFIGURATION:** |
---|
7062 | |
---|
7063 | .. index:: CONFIGURE_SHELL_NO_COMMAND_PING |
---|
7064 | .. index:: CONFIGURE_SHELL_COMMAND_PING |
---|
7065 | |
---|
7066 | This command is included in the default shell command set. |
---|
7067 | When building a custom command set, define``CONFIGURE_SHELL_COMMAND_PING`` to have this |
---|
7068 | command included. |
---|
7069 | |
---|
7070 | This command can be excluded from the shell command set by |
---|
7071 | defining ``CONFIGURE_SHELL_NO_COMMAND_PING`` when all |
---|
7072 | shell commands have been configured. |
---|
7073 | |
---|
7074 | **PROGRAMMING INFORMATION:** |
---|
7075 | |
---|
7076 | .. index:: rtems_shell_rtems_main_ping |
---|
7077 | |
---|
7078 | The ``ping`` is implemented by a C language function |
---|
7079 | which has the following prototype: |
---|
7080 | .. code:: c |
---|
7081 | |
---|
7082 | int rtems_shell_rtems_main_ping( |
---|
7083 | int argc, |
---|
7084 | char \**argv |
---|
7085 | ); |
---|
7086 | |
---|
7087 | The configuration structure for the ``ping`` has the |
---|
7088 | following prototype: |
---|
7089 | .. code:: c |
---|
7090 | |
---|
7091 | extern rtems_shell_cmd_t rtems_shell_PING_Command; |
---|
7092 | |
---|
7093 | Function and Variable Index |
---|
7094 | ########################### |
---|
7095 | |
---|
7096 | .. COMMENT: There are currently no Command and Variable Index entries. |
---|
7097 | |
---|
7098 | Concept Index |
---|
7099 | ############# |
---|
7100 | |
---|
7101 | Command Index |
---|
7102 | ############# |
---|
7103 | |
---|