RTEMS provides the confdefs.h
C language header file that
based on the setting of a variety of macros can automatically
produce nearly all of the configuration tables required
by an RTEMS application. Rather than building the individual
tables by hand, the application simply specifies the values
for the configuration parameters it wishes to set. In the following
example, the configuration information for a simple system with
a message queue and a time slice of 50 milliseconds is configured:
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_MICROSECONDS_PER_TICK 1000 /* 1 millisecond */ #define CONFIGURE_TICKS_PER_TIMESLICE 50 /* 50 milliseconds */ #define CONFIGURE_MAXIMUM_TASKS 4 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
This system will begin execution with the single initialization task
named Init
. It will be configured to have both a console
device driver (for standard I/O) and a clock tick device driver.
For each configuration parameter in the configuration tables, the
macro corresponding to that field is discussed. Most systems
can be easily configured using the confdefs.h
mechanism.
The CONFIGURE_INIT
constant must be defined in order to
make confdefs.h
instantiate the configuration data
structures. This can only be defined in one source file per
application that includes confdefs.h
or the symbol
table will be instantiated multiple times and linking errors
produced.
The user should be aware that the defaults are intentionally
set as low as possible. By default, no application resources
are configured. The confdefs.h
file ensures that
at least one application tasks or thread is configured
and that at least one of the initialization task/thread
tables is configured.
The confdefs.h
file estimates the amount of
memory required for the RTEMS Executive Workspace. This
estimate is only as accurate as the information given
to confdefs.h
and may be either too high or too
low for a variety of reasons. Some of the reasons that
confdefs.h
may reserve too much memory for RTEMS
are:
Conversely, there are many more reasons, the resource estimate could be too low:
In general, confdefs.h
is very accurate when given
enough information. However, it is quite easy to use
a library and not account for its resources.
The following subsection list all of the constants which can be set by the user.
Copyright © 1988-2003 OAR Corporation