source: rtems-docs/shell/preface.rst @ 969e60e

5
Last change on this file since 969e60e was f15d607, checked in by Chris Johns <chrisj@…>, on 11/09/16 at 00:50:31

shell: Fix header levels.

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