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