source: rtems-docs/shell/preface.rst @ 9aafb39

4.115
Last change on this file since 9aafb39 was 489740f, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 02:47:09

Set SPDX License Identifier in each source file.

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