source: rtems/doc/develenv/sample.t @ aa41429

4.104.114.84.95
Last change on this file since aa41429 was aa41429, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 18, 2003 at 4:16:12 PM

2003-02-18 Joel Sherrill <joel@…>

  • Makefile.am, develenv.texi: Relect generating .texi from .t's.
  • direct.t, sample.t, utils.t: New files.
  • direct.texi, sample.texi, utils.texi: Removed. Now generated from corresponding .t files which are in the process of being updated. This commit is a anspshot of the update effort.
  • Property mode set to 100644
File size: 8.1 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-2002.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Sample Applications
10
11@section Introduction
12
13RTEMS is shipped with the following sample applications:
14
15@itemize @bullet
16@item Hello World - C and Ada
17
18@item Clock Tick - C and Ada
19
20@item Base Single Processor - C and Ada
21
22@item Base Multiple Processor - C and Ada
23
24@item Constructor/Destructor C++ Test - C only if C++
25enabled
26
27@item Paranoia Floating Point Test - C only
28@end itemize
29
30These applications are intended to illustrate the
31basic format of RTEMS single and multiple processor
32applications.  In addition, these relatively simple applications
33can be used to test locally developed board support packages and
34device drivers.
35
36The reader should be familiar with the terms used and
37material presented in the RTEMS Applications User's Guide.
38
39@section Hello World
40
41This sample application is in the following directory:
42
43@example
44$RTEMS_SRC_BASE/tests/samples/hello
45@end example
46
47It provides a rudimentary test of the BSP start up
48code and the console output routine.  The C version of this
49sample application uses the printf function from the RTEMS
50Standard C Library to output messages.   The Ada version of this
51sample use the TEXT_IO package to output the hello messages.
52The following messages are printed:
53
54@example
55@group
56*** HELLO WORLD TEST ***
57Hello World
58*** END OF HELLO WORLD TEST ***
59@end group
60@end example
61
62These messages are printed from the application's
63single initialization task.  If the above messages are not
64printed correctly, then either the BSP start up code or the
65console output routine is not operating properly.
66
67@section Clock Tick
68
69This sample application is in the following directory:
70
71@example
72$RTEMS_SRC_BASE/tests/samples/ticker
73@end example
74
75This application is designed as a simple test of the
76clock tick device driver.  In addition, this application also
77tests the printf function from the RTEMS Standard C Library by
78using it to output the following messages:
79
80@example
81@group
82*** CLOCK TICK TEST ***
83TA1 - tm_get - 09:00:00   12/31/1988
84TA2 - tm_get - 09:00:00   12/31/1988
85TA3 - tm_get - 09:00:00   12/31/1988
86TA1 - tm_get - 09:00:05   12/31/1988
87TA1 - tm_get - 09:00:10   12/31/1988
88TA2 - tm_get - 09:00:10   12/31/1988
89TA1 - tm_get - 09:00:15   12/31/1988
90TA3 - tm_get - 09:00:15   12/31/1988
91TA1 - tm_get - 09:00:20   12/31/1988
92TA2 - tm_get - 09:00:20   12/31/1988
93TA1 - tm_get - 09:00:25   12/31/1988
94TA1 - tm_get - 09:00:30   12/31/1988
95TA2 - tm_get - 09:00:30   12/31/1988
96TA3 - tm_get - 09:00:30   12/31/1988
97*** END OF CLOCK TICK TEST ***
98@end group
99@end example
100
101The clock tick sample application utilizes a single
102initialization task and three copies of the single application
103task.  The initialization task prints the test herald, sets the
104time and date, and creates and starts the three application
105tasks before deleting itself.  The three application tasks
106generate the rest of the output.  Every five seconds, one or
107more of the tasks will print the current time obtained via the
108tm_get directive.  The first task, TA1, executes every five
109seconds, the second task, TA2, every ten seconds, and the third
110task, TA3, every fifteen seconds. If the time printed does not
111match the above output, then the clock device driver is not
112operating properly.
113
114@section Base Single Processor Application
115
116This sample application is in the following directory:
117
118@example
119$RTEMS_SRC_BASE/tests/samples/base_sp
120@end example
121
122It provides a framework from which a single processor
123RTEMS application can be developed. The use of the task argument
124is illustrated.  This sample application uses the printf
125function from the RTEMS Standard C Library or TEXT_IO functions
126when using the Ada version to output the following messages:
127
128@example
129@group
130*** SAMPLE SINGLE PROCESSOR APPLICATION ***
131Creating and starting an application task
132Application task was invoked with argument (0) and has id of 0x10002
133*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***
134@end group
135@end example
136
137The first two messages are printed from the
138application's single initialization task.  The final messages
139are printed from the single application task.
140
141@section Base Multiple Processor Application
142
143This sample application is in the following directory:
144
145@example
146$RTEMS_SRC_BASE/tests/samples/base_mp
147@end example
148
149It provides a framework from which a multiprocessor
150RTEMS application can be developed. This directory has a
151subdirectory for each node in the multiprocessor system.  The
152task argument is used to distinguish the node on which the
153application task is executed.  The first node will print the
154following messages:
155
156@example
157@group
158*** SAMPLE MULTIPROCESSOR APPLICATION ***
159Creating and starting an application task
160This task was invoked with the node argument (1)
161This task has the id of 0x10002
162*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***
163@end group
164@end example
165
166The second node will print the following messages:
167
168@example
169@group
170*** SAMPLE MULTIPROCESSOR APPLICATION ***
171Creating and starting an application task
172This task was invoked with the node argument (2)
173This task has the id of 0x20002
174*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***
175@end group
176@end example
177
178The herald is printed from the application's single
179initialization task on each node.  The final messages are
180printed from the single application task on each node.
181
182In this sample application, all source code is shared
183between the nodes except for the node dependent configuration
184files.  These files contains the definition of the node number
185used in the initialization of the  RTEMS Multiprocessor
186Configuration Table. This file is not shared because the node
187number field in the RTEMS Multiprocessor Configuration Table
188must be unique on each node.
189
190@section Constructor/Destructor C++ Application
191
192This sample application is in the following directory:
193
194@example
195$RTEMS_SRC_BASE/tests/samples/cdtest
196@end example
197
198This sample application demonstrates that RTEMS is
199compatible with C++ applications.  It uses constructors,
200destructor, and I/O stream output in testing these various
201capabilities.  The board support package responsible for this
202application must support a C++ environment.
203
204This sample application uses the printf function from
205the RTEMS Standard C Library to output the following messages:
206
207@example
208@group
209Hey I'M in base class constructor number 1 for 0x400010cc.
210Hey I'M in base class constructor number 2 for 0x400010d4.
211Hey I'M in derived class constructor number 3 for 0x400010d4.
212*** CONSTRUCTOR/DESTRUCTOR TEST ***
213Hey I'M in base class constructor number 4 for 0x4009ee08.
214Hey I'M in base class constructor number 5 for 0x4009ee10.
215Hey I'M in base class constructor number 6 for 0x4009ee18.
216Hey I'M in base class constructor number 7 for 0x4009ee20.
217Hey I'M in derived class constructor number 8 for 0x4009ee20.
218Testing a C++ I/O stream
219Hey I'M in derived class constructor number 8 for 0x4009ee20.
220Derived class - Instantiation order 8
221Hey I'M in base class constructor number 7 for 0x4009ee20.
222Instantiation order 8
223Hey I'M in base class constructor number 6 for 0x4009ee18.
224Instantiation order 6
225Hey I'M in base class constructor number 5 for 0x4009ee10.
226Instantiation order 5
227Hey I'M in base class constructor number 4 for 0x4009ee08.
228Instantiation order 5
229*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***
230Hey I'M in base class constructor number 3 for 0x400010d4.
231Hey I'M in base class constructor number 2 for 0x400010d4.
232Hey I'M in base class constructor number 1 for 0x400010cc.
233@end group
234@end example
235
236@section Paranoia Floating Point Application
237
238This sample application is in the following directory:
239
240@example
241$RTEMS_SRC_BASE/tests/samples/paranoia
242@end example
243
244This sample application uses a public domain floating
245point and math library test to verify these capabilities of the
246RTEMS executive.  Deviations between actual and expected results
247are reported to the screen.  This is a very extensive test which
248tests all mathematical and number conversion functions.
249Paranoia is also very large and requires a long period of time
250to run.   Problems which commonly prevent this test from
251executing to completion include stack overflow and FPU exception
252handlers not installed.
Note: See TracBrowser for help on using the repository browser.