1 | @c |
---|
2 | @c COPYRIGHT (c) 1989-2011. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @node Preface, Configuration and Initialization, Top, Top |
---|
10 | @unnumbered Preface |
---|
11 | |
---|
12 | Real-time embedded systems vary widely based upon their |
---|
13 | operational and maintenance requirements. Some of these |
---|
14 | systems provide ways for the user or developer to interact |
---|
15 | with them. This interaction could be used for operational, |
---|
16 | diagnostic, or configuration purposes. The capabilities |
---|
17 | described in this manual are those provided with RTEMS to |
---|
18 | provide a command line interface for user access. Some |
---|
19 | of these commands will be familiar as standard POSIX utilities |
---|
20 | while others are RTEMS specific or helpful in debugging |
---|
21 | and analyzing an embedded system. As a simple example of |
---|
22 | the powerful and very familiar capabilities that the RTEMS |
---|
23 | Shell provides to an application, consider the following |
---|
24 | example which hints at some of the capabilities available: |
---|
25 | |
---|
26 | @smallexample |
---|
27 | Welcome to rtems-4.10.99.0(SPARC/w/FPU/sis) |
---|
28 | COPYRIGHT (c) 1989-2011. |
---|
29 | On-Line Applications Research Corporation (OAR). |
---|
30 | |
---|
31 | Login into RTEMS |
---|
32 | |
---|
33 | login: rtems |
---|
34 | Password: |
---|
35 | |
---|
36 | RTEMS SHELL (Ver.1.0-FRC):/dev/console. Feb 28 2008. 'help' to list commands. |
---|
37 | SHLL [/] $ cat /etc/passwd |
---|
38 | root:*:0:0:root::/:/bin/sh |
---|
39 | rtems:*:1:1:RTEMS Application::/:/bin/sh |
---|
40 | tty:!:2:2:tty owner::/:/bin/false |
---|
41 | SHLL [/] $ ls /dev |
---|
42 | -rwxr-xr-x 1 rtems root 0 Jan 01 00:00 console |
---|
43 | -rwxr-xr-x 1 root root 0 Jan 01 00:00 console_b |
---|
44 | 2 files 0 bytes occupied |
---|
45 | SHLL [/] $ stackuse |
---|
46 | Stack usage by thread |
---|
47 | ID NAME LOW HIGH CURRENT AVAILABLE USED |
---|
48 | 0x09010001 IDLE 0x023d89a0 - 0x023d99af 0x023d9760 4096 608 |
---|
49 | 0x0a010001 UI1 0x023d9f30 - 0x023daf3f 0x023dad18 4096 1804 |
---|
50 | 0x0a010002 SHLL 0x023db4c0 - 0x023df4cf 0x023de9d0 16384 6204 |
---|
51 | 0xffffffff INTR 0x023d2760 - 0x023d375f 0x00000000 4080 316 |
---|
52 | SHLL [/] $ mount -L |
---|
53 | File systems: msdos |
---|
54 | SHLL [/] $ |
---|
55 | @end smallexample |
---|
56 | |
---|
57 | In the above example, the user @i{rtems} logs into a |
---|
58 | SPARC based RTEMS system. The first command is |
---|
59 | @code{cat /etc/passwd}. This simple command lets us |
---|
60 | know that this application is running the In Memory |
---|
61 | File System (IMFS) and that the infrastructure has |
---|
62 | provided dummy entries for @i{/etc/passwd} and a few |
---|
63 | other files. The contents of @i{/etc/passwd} let |
---|
64 | us know that the user could have logged in as @code{root}. |
---|
65 | In fact, the @code{root} user has more permissions |
---|
66 | than @code{rtems} who is not allowed to write into the |
---|
67 | filesystem. |
---|
68 | |
---|
69 | The second command is @code{ls /dev} which lets us |
---|
70 | know that RTEMS has POSIX-style device nodes which |
---|
71 | can be accesses through standard I/O function calls. |
---|
72 | |
---|
73 | The third command executed is the RTEMS specific |
---|
74 | @code{stackuse} which gives a report on the stack |
---|
75 | usage of each thread in the system. Since stack |
---|
76 | overflows are a common error in deeply embedded systems, |
---|
77 | this is a surprising simple, yet powerful debugging aid. |
---|
78 | |
---|
79 | Finally, the last command, @code{mount -L} hints that |
---|
80 | RTEMS supports a variety of mountable filesystems. With |
---|
81 | support for MS-DOS FAT on IDE/ATA and Flash devices as |
---|
82 | well as network-based filesystens such as NFS and TFTP, |
---|
83 | the standard free RTEMS provides a robuse infrastructure |
---|
84 | for embedded applications. |
---|
85 | |
---|
86 | This manual describes the RTEMS Shell and its command set. |
---|
87 | In our terminology, the Shell is just a loop reading user |
---|
88 | input and turning that input into commands with argument. |
---|
89 | The Shell provided with RTEMS is a simple command reading |
---|
90 | loop with limited scripting capabilities. It can be connected |
---|
91 | to via a standard serial port or connected to the RTEMS |
---|
92 | @code{telnetd} server for use across a network. |
---|
93 | |
---|
94 | Each command in the command set is implemented as a single |
---|
95 | subroutine which has a @i{main-style} prototype. The commands |
---|
96 | interpret their arguments and operate upon stdin, stdout, and |
---|
97 | stderr by default. This allows each command to be invoked |
---|
98 | independent of the shell. |
---|
99 | |
---|
100 | The described separation of shell from commands from communications |
---|
101 | mechanism was an important design goal. At one level, the RTEMS |
---|
102 | Shell is a complete shell environment providing access to multiple |
---|
103 | POSIX compliant filesystems and TCP/IP stack. The subset of |
---|
104 | capabilities available is easy to configure and the standard |
---|
105 | Shell can be logged into from either a serial port or via telnet. |
---|
106 | But at another level, the Shell is a large set of components which |
---|
107 | can be integrated into the user's developed command interpreter. |
---|
108 | In either case, it is trivial to add custom commands to the command |
---|
109 | set available. |
---|
110 | |
---|
111 | @unnumberedsec Acknowledgements |
---|
112 | |
---|
113 | @include common/opengroup_preface_acknowledgement.texi |
---|
114 | |
---|