source: rtems-docs/c-user/overview.rst @ 3bb3e57

5
Last change on this file since 3bb3e57 was 6c56401, checked in by Chris Johns <chrisj@…>, on 11/12/17 at 03:34:48

c-user: Fix index locations.

Update #3229.

  • Property mode set to 100644
File size: 16.6 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
7Overview
8********
9
10Introduction
11============
12
13RTEMS, Real-Time Executive for Multiprocessor Systems, is a real-time executive
14(kernel) which provides a high performance environment for embedded military
15applications including the following features:
16
17- multitasking capabilities
18
19- homogeneous and heterogeneous multiprocessor systems
20
21- event-driven, priority-based, preemptive scheduling
22
23- optional rate monotonic scheduling
24
25- intertask communication and synchronization
26
27- priority inheritance
28
29- responsive interrupt management
30
31- dynamic memory allocation
32
33- high level of user configurability
34
35This manual describes the usage of RTEMS for applications written in the C
36programming language.  Those implementation details that are processor
37dependent are provided in the Applications Supplement documents.  A supplement
38document which addresses specific architectural issues that affect RTEMS is
39provided for each processor type that is supported.
40
41.. index:: Real-time applications
42
43Real-time Application Systems
44=============================
45
46Real-time application systems are a special class of computer applications.
47They have a complex set of characteristics that distinguish them from other
48software problems.  Generally, they must adhere to more rigorous requirements.
49The correctness of the system depends not only on the results of computations,
50but also on the time at which the results are produced.  The most important and
51complex characteristic of real-time application systems is that they must
52receive and respond to a set of external stimuli within rigid and critical time
53constraints referred to as deadlines.  Systems can be buried by an avalanche of
54interdependent, asynchronous or cyclical event streams.
55
56Deadlines can be further characterized as either hard or soft based upon the
57value of the results when produced after the deadline has passed.  A deadline
58is hard if the results have no value or if their use will result in a
59catastrophic event.  In contrast, results which are produced after a soft
60deadline may have some value.
61
62Another distinguishing requirement of real-time application systems is the
63ability to coordinate or manage a large number of concurrent activities. Since
64software is a synchronous entity, this presents special problems.  One
65instruction follows another in a repeating synchronous cycle.  Even though
66mechanisms have been developed to allow for the processing of external
67asynchronous events, the software design efforts required to process and manage
68these events and tasks are growing more complicated.
69
70The design process is complicated further by spreading this activity over a set
71of processors instead of a single processor. The challenges associated with
72designing and building real-time application systems become very complex when
73multiple processors are involved.  New requirements such as interprocessor
74communication channels and global resources that must be shared between
75competing processors are introduced.  The ramifications of multiple processors
76complicate each and every characteristic of a real-time system.
77
78.. index:: Real-time executive
79
80Real-time Executive
81===================
82
83Fortunately, real-time operating systems or real-time executives serve as a
84cornerstone on which to build the application system.  A real-time multitasking
85executive allows an application to be cast into a set of logical, autonomous
86processes or tasks which become quite manageable.  Each task is internally
87synchronous, but different tasks execute independently, resulting in an
88asynchronous processing stream.  Tasks can be dynamically paused for many
89reasons resulting in a different task being allowed to execute for a period of
90time.  The executive also provides an interface to other system components such
91as interrupt handlers and device drivers.  System components may request the
92executive to allocate and coordinate resources, and to wait for and trigger
93synchronizing conditions.  The executive system calls effectively extend the
94CPU instruction set to support efficient multitasking.  By causing tasks to
95travel through well-defined state transitions, system calls permit an
96application to demand-switch between tasks in response to real-time events.
97
98By proper grouping of responses to stimuli into separate tasks, a system can
99now asynchronously switch between independent streams of execution, directly
100responding to external stimuli as they occur.  This allows the system design to
101meet critical performance specifications which are typically measured by
102guaranteed response time and transaction throughput.  The multiprocessor
103extensions of RTEMS provide the features necessary to manage the extra
104requirements introduced by a system distributed across several processors.  It
105removes the physical barriers of processor boundaries from the world of the
106system designer, enabling more critical aspects of the system to receive the
107required attention. Such a system, based on an efficient real-time,
108multiprocessor executive, is a more realistic model of the outside world or
109environment for which it is designed.  As a result, the system will always be
110more logical, efficient, and reliable.
111
112By using the directives provided by RTEMS, the real-time applications developer
113is freed from the problem of controlling and synchronizing multiple tasks and
114processors.  In addition, one need not develop, test, debug, and document
115routines to manage memory, pass messages, or provide mutual exclusion.  The
116developer is then able to concentrate solely on the application.  By using
117standard software components, the time and cost required to develop
118sophisticated real-time applications is significantly reduced.
119
120.. index:: Application architecture
121
122RTEMS Application Architecture
123==============================
124
125One important design goal of RTEMS was to provide a bridge between two critical
126layers of typical real-time systems.  As shown in the following figure, RTEMS
127serves as a buffer between the project dependent application code and the
128target hardware.  Most hardware dependencies for real-time applications can be
129localized to the low level device drivers.
130
131.. figure:: ../images/c_user/rtemsarc.png
132         :width: 488
133         :height: 100px
134         :align: center
135         :alt: RTEMS Application Architecture
136
137The RTEMS I/O interface manager provides an efficient tool for incorporating
138these hardware dependencies into the system while simultaneously providing a
139general mechanism to the application code that accesses them.  A well designed
140real-time system can benefit from this architecture by building a rich library
141of standard application components which can be used repeatedly in other
142real-time projects.
143
144.. index:: Internal Architecture
145
146RTEMS Internal Architecture
147===========================
148
149RTEMS can be viewed as a set of layered components that work in harmony to
150provide a set of services to a real-time application system.  The executive
151interface presented to the application is formed by grouping directives into
152logical sets called resource managers.  Functions utilized by multiple managers
153such as scheduling, dispatching, and object management are provided in the
154executive core.  The executive core depends on a small set of CPU dependent
155routines.  Together these components provide a powerful run time environment
156that promotes the development of efficient real-time application systems.  The
157following figure illustrates this organization:
158
159.. figure:: ../images/c_user/rtemspie.png
160         :width: 70%
161         :align: center
162         :alt: RTEMS Internal Architecture
163
164Subsequent chapters present a detailed description of the capabilities provided
165by each of the following RTEMS managers:
166
167- initialization
168
169- task
170
171- interrupt
172
173- clock
174
175- timer
176
177- semaphore
178
179- message
180
181- event
182
183- signal
184
185- partition
186
187- region
188
189- dual ported memory
190
191- I/O
192
193- fatal error
194
195- rate monotonic
196
197- user extensions
198
199- multiprocessing
200
201User Customization and Extensibility
202====================================
203
204As thirty-two bit microprocessors have decreased in cost, they have become
205increasingly common in a variety of embedded systems.  A wide range of custom
206and general-purpose processor boards are based on various thirty-two bit
207processors.  RTEMS was designed to make no assumptions concerning the
208characteristics of individual microprocessor families or of specific support
209hardware.  In addition, RTEMS allows the system developer a high degree of
210freedom in customizing and extending its features.
211
212RTEMS assumes the existence of a supported microprocessor and sufficient memory
213for both RTEMS and the real-time application.  Board dependent components such
214as clocks, interrupt controllers, or I/O devices can be easily integrated with
215RTEMS.  The customization and extensibility features allow RTEMS to efficiently
216support as many environments as possible.
217
218Portability
219===========
220
221The issue of portability was the major factor in the creation of RTEMS.  Since
222RTEMS is designed to isolate the hardware dependencies in the specific board
223support packages, the real-time application should be easily ported to any
224other processor.  The use of RTEMS allows the development of real-time
225applications which can be completely independent of a particular microprocessor
226architecture.
227
228Memory Requirements
229===================
230
231Since memory is a critical resource in many real-time embedded systems, RTEMS
232was specifically designed to automatically leave out all services that are not
233required from the run-time environment.  Features such as networking, various
234fileystems, and many other features are completely optional.  This allows the
235application designer the flexibility to tailor RTEMS to most efficiently meet
236system requirements while still satisfying even the most stringent memory
237constraints.  As a result, the size of the RTEMS executive is application
238dependent.
239
240RTEMS requires RAM to manage each instance of an RTEMS object that is created.
241Thus the more RTEMS objects an application needs, the more memory that must be
242reserved.  See :ref:`Configuring a System`.
243
244RTEMS utilizes memory for both code and data space.  Although RTEMS' data space
245must be in RAM, its code space can be located in either ROM or RAM.
246
247Audience
248========
249
250This manual was written for experienced real-time software developers.
251Although some background is provided, it is assumed that the reader is familiar
252with the concepts of task management as well as intertask communication and
253synchronization.  Since directives, user related data structures, and examples
254are presented in C, a basic understanding of the C programming language is
255required to fully understand the material presented.  However, because of the
256similarity of the Ada and C RTEMS implementations, users will find that the use
257and behavior of the two implementations is very similar.  A working knowledge
258of the target processor is helpful in understanding some of RTEMS' features.  A
259thorough understanding of the executive cannot be obtained without studying the
260entire manual because many of RTEMS' concepts and features are interrelated.
261Experienced RTEMS users will find that the manual organization facilitates its
262use as a reference document.
263
264Conventions
265===========
266
267The following conventions are used in this manual:
268
269- Significant words or phrases as well as all directive names are printed in
270  bold type.
271
272- Items in bold capital letters are constants defined by RTEMS.  Each language
273  interface provided by RTEMS includes a file containing the standard set of
274  constants, data types, and structure definitions which can be incorporated
275  into the user application.
276
277- A number of type definitions are provided by RTEMS and can be found in
278  rtems.h.
279
280- The characters "0x" preceding a number indicates that the number is in
281  hexadecimal format.  Any other numbers are assumed to be in decimal format.
282
283Manual Organization
284===================
285
286This first chapter has presented the introductory and background material for
287the RTEMS executive.  The remaining chapters of this manual present a detailed
288description of RTEMS and the environment, including run time behavior, it
289creates for the user.
290
291A chapter is dedicated to each manager and provides a detailed discussion of
292each RTEMS manager and the directives which it provides.  The presentation
293format for each directive includes the following sections:
294
295- Calling sequence
296
297- Directive status codes
298
299- Description
300
301- Notes
302
303The following provides an overview of the remainder of this manual:
304
305Chapter 2:
306    Key Concepts: presents an introduction to the ideas which are common across
307    multiple RTEMS managers.
308
309Chapter 3:
310    RTEMS Data Types: describes the fundamental data types shared by the
311    services in the RTEMS Classic API.
312
313Chapter 4:
314    Scheduling Concepts: details the various RTEMS scheduling algorithms and
315    task state transitions.
316
317Chapter 5:
318    Initialization Manager: describes the functionality and directives provided
319    by the Initialization Manager.
320
321Chapter 6:
322    Task Manager: describes the functionality and directives provided by the
323    Task Manager.
324
325Chapter 7:
326    Interrupt Manager: describes the functionality and directives provided by
327    the Interrupt Manager.
328
329Chapter 8:
330    Clock Manager: describes the functionality and directives provided by the
331    Clock Manager.
332
333Chapter 9:
334    Timer Manager: describes the functionality and directives provided by the
335    Timer Manager.
336
337Chapter 10:
338    Rate Monotonic Manager: describes the functionality and directives provided
339    by the Rate Monotonic Manager.
340
341Chapter 11:
342    Semaphore Manager: describes the functionality and directives provided by
343    the Semaphore Manager.
344
345Chapter 12:
346    Barrier Manager: describes the functionality and directives provided by the
347    Barrier Manager.
348
349Chapter 13:
350    Message Manager: describes the functionality and directives provided by the
351    Message Manager.
352
353Chapter 14:
354    Event Manager: describes the functionality and directives provided by the
355    Event Manager.
356
357Chapter 15:
358    Signal Manager: describes the functionality and directives provided by the
359    Signal Manager.
360
361Chapter 16:
362    Partition Manager: describes the functionality and directives provided by
363    the Partition Manager.
364
365Chapter 17:
366    Region Manager: describes the functionality and directives provided by the
367    Region Manager.
368
369Chapter 18:
370    Dual-Ported Memory Manager: describes the functionality and directives
371    provided by the Dual-Ported Memory Manager.
372
373Chapter 19:
374    I/O Manager: describes the functionality and directives provided by the I/O
375    Manager.
376
377Chapter 20:
378    Fatal Error Manager: describes the functionality and directives provided by
379    the Fatal Error Manager.
380
381Chapter 21:
382    Board Support Packages: defines the functionality required of user-supplied
383    board support packages.
384
385Chapter 22:
386    User Extensions: shows the user how to extend RTEMS to incorporate custom
387    features.
388
389Chapter 23:
390    Configuring a System: details the process by which one tailors RTEMS for a
391    particular single-processor or multiprocessor application.
392
393Chapter 24:
394    Multiprocessing Manager: presents a conceptual overview of the
395    multiprocessing capabilities provided by RTEMS as well as describing the
396    Multiprocessing Communications Interface Layer and Multiprocessing Manager
397    directives.
398
399Chapter 25:
400    Stack Bounds Checker: presents the capabilities of the RTEMS task stack
401    checker which can report stack usage as well as detect bounds violations.
402
403Chapter 26:
404    CPU Usage Statistics: presents the capabilities of the CPU Usage statistics
405    gathered on a per task basis along with the mechanisms for reporting and
406    resetting the statistics.
407
408Chapter 27:
409    Object Services: presents a collection of helper services useful when
410    manipulating RTEMS objects. These include methods to assist in obtaining an
411    object's name in printable form. Additional services are provided to
412    decompose an object Id and determine which API and object class it belongs
413    to.
414
415Chapter 28:
416    Chains: presents the methods provided to build, iterate and manipulate
417    doubly-linked chains. This manager makes the chain implementation used
418    internally by RTEMS to user space applications.
419
420Chapter 29:
421    Timespec Helpers: presents a set of helper services useful when
422    manipulating POSIX ``struct timespec`` instances.
423
424Chapter 30:
425    Constant Bandwidth Server Scheduler API.
426
427Chapter 31:
428    Directive Status Codes: provides a definition of each of the directive
429    status codes referenced in this manual.
430
431Chapter 32:
432    Example Application: provides a template for simple RTEMS applications.
433
434Chapter 33:
435    Glossary: defines terms used throughout this manual.
Note: See TracBrowser for help on using the repository browser.