source: rtems-docs/shell/preface.rst @ 8ca13ed

Last change on this file since 8ca13ed was 8ca13ed, checked in by Amar Takhar <verm@…>, on 01/16/16 at 20:32:09

Split document.

  • Property mode set to 100644
File size: 5.8 KB
4Real-time embedded systems vary widely based upon their operational and
5maintenance requirements. Some of these systems provide ways for the user or
6developer to interact with them.  This interaction could be used for
7operational, diagnostic, or configuration purposes.  The capabilities described
8in this manual are those provided with RTEMS to provide a command line
9interface for user access.  Some of these commands will be familiar as standard
10POSIX utilities while others are RTEMS specific or helpful in debugging and
11analyzing an embedded system. As a simple example of the powerful and very
12familiar capabilities that the RTEMS Shell provides to an application, consider
13the following example which hints at some of the capabilities available:
15.. code-block:: shell
17    Welcome to rtems-
18    COPYRIGHT (c) 1989-2011.
19    On-Line Applications Research Corporation (OAR).
20    Login into RTEMS
21    login: rtems
22    Password:
23    RTEMS SHELL (Ver.1.0-FRC):/dev/console. Feb 28 2008. 'help' to list commands.
24    SHLL [/] $ cat /etc/passwd
25    root:*:0:0:root::/:/bin/sh
26    rtems:*:1:1:RTEMS Application::/:/bin/sh
27    tty:!:2:2:tty owner::/:/bin/false
28    SHLL [/] $ ls /dev
29    -rwxr-xr-x   1  rtems   root           0 Jan 01 00:00 console
30    -rwxr-xr-x   1   root   root           0 Jan 01 00:00 console_b
31    2 files 0 bytes occupied
32    SHLL [/] $ stackuse
33    Stack usage by thread
34    ID      NAME    LOW          HIGH     CURRENT     AVAILABLE     USED
35    0x09010001  IDLE 0x023d89a0 - 0x023d99af 0x023d9760      4096        608
36    0x0a010001  UI1  0x023d9f30 - 0x023daf3f 0x023dad18      4096       1804
37    0x0a010002  SHLL 0x023db4c0 - 0x023df4cf 0x023de9d0     16384       6204
38    0xffffffff  INTR 0x023d2760 - 0x023d375f 0x00000000      4080        316
39    SHLL [/] $ mount -L
40    File systems: msdos
41    SHLL [/] $
43In the above example, the user *rtems* logs into a SPARC based RTEMS system.
44The first command is ``cat /etc/passwd``.  This simple command lets us know
45that this application is running the In Memory File System (IMFS) and that the
46infrastructure has provided dummy entries for */etc/passwd* and a few other
47files.  The contents of */etc/passwd* let us know that the user could have
48logged in as ``root``.  In fact, the ``root`` user has more permissions than
49``rtems`` who is not allowed to write into the filesystem.
51The second command is ``ls /dev`` which lets us know that RTEMS has POSIX-style
52device nodes which can be accesses through standard I/O function calls.
54The third command executed is the RTEMS specific ``stackuse`` which gives a
55report on the stack usage of each thread in the system.  Since stack overflows
56are a common error in deeply embedded systems, this is a surprising simple, yet
57powerful debugging aid.
59Finally, the last command, ``mount -L`` hints that RTEMS supports a variety of
60mountable filesystems. With support for MS-DOS FAT on IDE/ATA and Flash devices
61as well as network-based filesystens such as NFS and TFTP, the standard free
62RTEMS provides a robuse infrastructure for embedded applications.
64This manual describes the RTEMS Shell and its command set.  In our terminology,
65the Shell is just a loop reading user input and turning that input into
66commands with argument.  The Shell provided with RTEMS is a simple command
67reading loop with limited scripting capabilities.  It can be connected to via a
68standard serial port or connected to the RTEMS ``telnetd`` server for use across
69a network.
71Each command in the command set is implemented as a single subroutine which has
72a *main-style* prototype.  The commands interpret their arguments and operate
73upon stdin, stdout, and stderr by default.  This allows each command to be
74invoked independent of the shell.
76The described separation of shell from commands from communications mechanism
77was an important design goal.  At one level, the RTEMS Shell is a complete
78shell environment providing access to multiple POSIX compliant filesystems and
79TCP/IP stack.  The subset of capabilities available is easy to configure and
80the standard Shell can be logged into from either a serial port or via telnet.
81But at another level, the Shell is a large set of components which can be
82integrated into the user’s developed command interpreter.  In either case, it
83is trivial to add custom commands to the command set available.
88.. COMMENT: The RTEMS Project has been granted permission from The Open Group
89.. COMMENT: IEEE to excerpt and use portions of the POSIX standards documents
90.. COMMENT: in the RTEMS POSIX API User's Guide and RTEMS Shell User's Guide.
91.. COMMENT: We have to include a specific acknowledgement paragraph in these
92.. COMMENT: documents (e.g. preface or copyright page) and another slightly
93.. COMMENT: different paragraph for each manual page that excerpts and uses
94.. COMMENT: text from the standards.
95.. COMMENT: This file should help ensure that the paragraphs are consistent
96.. COMMENT: and not duplicated
98The Institute of Electrical and Electronics Engineers, Inc and The Open Group,
99have given us permission to reprint portions of their documentation.
101.. pull-quote::
103    Portions of this text are reprinted and reproduced in electronic form from
104    IEEE Std 1003.1, 2004 Edition, Standard for Information Technology â
105    Operating System Interface (POSIX), The Open Group Base Specifications
106    Issue 6, Copyright © 2001-2004 by the Institute of Electrical and
107    Electronics Engineers, Inc and The Open Group. In the event of any
108    discrepancy between this version and the original IEEE and The Open Group
109    Standard, the original IEEE and The Open Group Standard is the referee
110    document. The original Standard can be obtained online at
111  This notice shall appear on any
112    product containing this material.
Note: See TracBrowser for help on using the repository browser.