source: rtems/doc/develenv/sample.texi @ 6449498

4.104.114.84.95
Last change on this file since 6449498 was 6449498, checked in by Joel Sherrill <joel.sherrill@…>, on 01/17/02 at 21:47:47

2001-01-17 Joel Sherrill <joel@…>

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