OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [sgml/] [user-guide/] [configuration.sgml] - Diff between revs 28 and 174

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
Configuration and the Package Repository
Configuration and the Package Repository
The following chapters contain information on running
The following chapters contain information on running
        ecosconfig (the command line tool that
        ecosconfig (the command line tool that
        manipulates configurations and constructs build trees) and on
        manipulates configurations and constructs build trees) and on
        managing a source repository across multiple versions of
        managing a source repository across multiple versions of
        eCos. 
        eCos. 
Manual Configuration
Manual Configuration
    eCos developers will generally use the graphical
    eCos developers will generally use the graphical
      Configuration Tool for configuring an eCos system and building
      Configuration Tool for configuring an eCos system and building
      the target library. However, some user prefer to use command
      the target library. However, some user prefer to use command
      line tools. These command line tools can also be used for batch
      line tools. These command line tools can also be used for batch
      operations on all platforms, for example as part of a nightly
      operations on all platforms, for example as part of a nightly
      rebuild and testing procedure.
      rebuild and testing procedure.
    
    
In the current release of the system the command line tools
In the current release of the system the command line tools
      do not provide exactly the same functionality as the graphical
      do not provide exactly the same functionality as the graphical
      tool. Most importantly, there is no facility to resolve
      tool. Most importantly, there is no facility to resolve
      configuration conflicts interactively.
      configuration conflicts interactively.
The eCos configuration system, both graphical and command
The eCos configuration system, both graphical and command
      line tools, are under constant development and enhancement.
      line tools, are under constant development and enhancement.
      Developers should note that the procedures described may change
      Developers should note that the procedures described may change
      considerably in future releases. 
      considerably in future releases. 
Directory Tree Structure
Directory Tree Structure
When building eCos there are three main directory trees to
When building eCos there are three main directory trees to
        consider: the source tree, the build tree, and the install
        consider: the source tree, the build tree, and the install
        tree.
        tree.
The source tree, also known as the component repository,
The source tree, also known as the component repository,
          is read-only. It is possible to use a single component
          is read-only. It is possible to use a single component
          repository for any number of different configurations, and
          repository for any number of different configurations, and
          it is also possible to share a component repository between
          it is also possible to share a component repository between
          multiple users by putting it on a network drive.
          multiple users by putting it on a network drive.
The build tree contains everything that is specific to a
The build tree contains everything that is specific to a
          particular configuration, including header and other files
          particular configuration, including header and other files
          that contain configuration data, and the object files that
          that contain configuration data, and the object files that
          result from compiling the system sources for this
          result from compiling the system sources for this
          configuration. 
          configuration. 
The install tree is usually located in the install subdirectory
The install tree is usually located in the install subdirectory
of the build tree. Once an eCos system has been built, the install
of the build tree. Once an eCos system has been built, the install
tree contains all the files needed for application development including
tree contains all the files needed for application development including
the header files and the target library. By making copies of the
the header files and the target library. By making copies of the
install tree after a build it is possible to separate application
install tree after a build it is possible to separate application
development and system configuration, which may be desirable for
development and system configuration, which may be desirable for
some organizations. 
some organizations. 
Creating the Build Tree
Creating the Build Tree
Generating a build tree is a non-trivial operation and
Generating a build tree is a non-trivial operation and
          should not be attempted manually. Instead, eCos is shipped
          should not be attempted manually. Instead, eCos is shipped
          with a tool called ecosconfig that should
          with a tool called ecosconfig that should
          be used to create a build tree.
          be used to create a build tree.
Usually ecosconfig will be
Usually ecosconfig will be
run inside the build tree itself. If you are creating a new build
run inside the build tree itself. If you are creating a new build
tree then typically you will create a new empty directory using
tree then typically you will create a new empty directory using
the mkdir command, cd into
the mkdir command, cd into
that directory, and then invoke ecosconfig to
that directory, and then invoke ecosconfig to
create a configuration. By default, the configuration is stored
create a configuration. By default, the configuration is stored
in a file ecos.ecc in the current
in a file ecos.ecc in the current
directory. The configuration may be modified by editing this file directly. ecosconfig itself
directory. The configuration may be modified by editing this file directly. ecosconfig itself
deals with a number of coarse-grained configuration options such
deals with a number of coarse-grained configuration options such
as the target platform and the packages that should be used.
as the target platform and the packages that should be used.
The ecosconfig tool is also
The ecosconfig tool is also
used subsequently to generate a build tree for a configuration.
used subsequently to generate a build tree for a configuration.
Once a build tree exists, it is possible to run ecosconfig again
Once a build tree exists, it is possible to run ecosconfig again
inside the same build tree. This will be necessary if your wish
inside the same build tree. This will be necessary if your wish
to change some of the configuration options.
to change some of the configuration options.
ecosconfig does not generate
ecosconfig does not generate
the top-level directory of the build tree; you must do this
the top-level directory of the build tree; you must do this
        yourself. 
        yourself. 
$ mkdir ecos-work
$ mkdir ecos-work
$ cd ecos-work
$ cd ecos-work
The next step is to run ecosconfig: 
The next step is to run ecosconfig: 
$ ecosconfig <qualifiers> <command>
$ ecosconfig <qualifiers> <command>
ecosconfig qualifiers
ecosconfig qualifiers
The available command line qualifiers for
The available command line qualifiers for
            ecosconfig are as follows. Multiple
            ecosconfig are as follows. Multiple
            qualifiers may be used on the command line:
            qualifiers may be used on the command line:
          
          
Provides basic usage guidelines for the
Provides basic usage guidelines for the
              available commands and qualifiers.
              available commands and qualifiers.
Specifies an eCos configuration save file for
Specifies an eCos configuration save file for
                  use by the tool. By default, the file
                  use by the tool. By default, the file
                  ecos.ecc in the
                  ecos.ecc in the
                  current directory is used. Developers may prefer to
                  current directory is used. Developers may prefer to
                  use a common location for all their eCos
                  use a common location for all their eCos
                  configurations rather than keep the configuration
                  configurations rather than keep the configuration
                  information in the base of the build tree.
                  information in the base of the build tree.
Specifies an alternative location for the
Specifies an alternative location for the
                  install tree. By default, the install tree resides
                  install tree. By default, the install tree resides
                  inside the install
                  inside the install
                  directory in the build tree. Developers may prefer
                  directory in the build tree. Developers may prefer
                  to locate the build tree in a temporary file
                  to locate the build tree in a temporary file
                  hierarchy but keep the install tree in a more
                  hierarchy but keep the install tree in a more
                  permanent location.
                  permanent location.
Specifies the location of the component
Specifies the location of the component
                  repository. By default, the tool uses the location
                  repository. By default, the tool uses the location
                  specified in the
                  specified in the
                  ECOS_REPOSITORY
                  ECOS_REPOSITORY
                  environment variable. Developers may prefer to use
                  environment variable. Developers may prefer to use
                  of this qualifier if they are working with more than
                  of this qualifier if they are working with more than
                  one repository.
                  one repository.
Disables the implicit resolution of conflicts
Disables the implicit resolution of conflicts
                  while manipulating the configuration data.
                  while manipulating the configuration data.
                  developers may prefer to resolve conflicts by
                  developers may prefer to resolve conflicts by
                  editing the eCos configuration save file
                  editing the eCos configuration save file
                  manually.
                  manually.
By default, ecosconfig will exit with an error code if the current
By default, ecosconfig will exit with an error code if the current
configuration contains any conflicts, and it is not possible to
configuration contains any conflicts, and it is not possible to
generate or update a build tree for such configurations. This
generate or update a build tree for such configurations. This
qualifier causes ecosconfig to ignore such problems, and hence it is
qualifier causes ecosconfig to ignore such problems, and hence it is
possible to generate a build tree even if there are still
possible to generate a build tree even if there are still
conflicts. Of course, there are no guarantees that the resulting
conflicts. Of course, there are no guarantees that the resulting
system will actually do anything.
system will actually do anything.
Display more information.
Display more information.
Display less information.
Display less information.
The ,  and
The ,  and
 qualifiers can also be written with two arguments,
 qualifiers can also be written with two arguments,
for example:
for example:
ecosconfig --srcdir <dir> ...
ecosconfig --srcdir <dir> ...
This simplifies filename completion with some shells.
This simplifies filename completion with some shells.
ecosconfig commands
ecosconfig commands
The available commands for
The available commands for
            ecosconfig are as
            ecosconfig are as
            follows:
            follows:
list
list
Lists the available packages, targets and
Lists the available packages, targets and
                  templates as installed in the eCos repository.
                  templates as installed in the eCos repository.
                  Aliases and package versions are also
                  Aliases and package versions are also
                  reported.
                  reported.
new <target> [<template> [<version>]]
new <target> [<template> [<version>]]
Creates a new eCos configuration for
Creates a new eCos configuration for
                  the specified target hardware and saves it. A
                  the specified target hardware and saves it. A
                  software template may also be specified. By default,
                  software template may also be specified. By default,
                  the template named ‘default’ is used. If
                  the template named ‘default’ is used. If
                  the template version is not specified, the latest
                  the template version is not specified, the latest
                  version is used.
                  version is used.
target <target>
target <target>
Changes the target hardware selection
Changes the target hardware selection
                  for the eCos configuration. This has the effect of
                  for the eCos configuration. This has the effect of
                  unloading packages supporting the target selected
                  unloading packages supporting the target selected
                  previously and loading the packages which support
                  previously and loading the packages which support
                  the new hardware. This command will be used
                  the new hardware. This command will be used
                  typically when switching between a simulator and
                  typically when switching between a simulator and
                  real hardware.
                  real hardware.
template <template> [<version>]
template <template> [<version>]
Changes the template selection for the eCos
Changes the template selection for the eCos
                  configuration. This has the effect of unloading
                  configuration. This has the effect of unloading
                  packages specified by the template selected
                  packages specified by the template selected
                  previously and loading the packages specified by the
                  previously and loading the packages specified by the
                  new template. By default, the latest version of the
                  new template. By default, the latest version of the
                  specified template is used.
                  specified template is used.
remove <packages>
remove <packages>
Removes the specified packages from the eCos
Removes the specified packages from the eCos
                  configuration. This command will be used typically
                  configuration. This command will be used typically
                  when the template on which a configuration is based
                  when the template on which a configuration is based
                  contains packages which are not required.
                  contains packages which are not required.
add <packages>
add <packages>
Adds the specified packages to the eCos configuration. This
Adds the specified packages to the eCos configuration. This
command will be used typically when the template on which a
command will be used typically when the template on which a
configuration is based does not contain all the packages which are
configuration is based does not contain all the packages which are
required.For example, add-on packages provided by third parties will
required.For example, add-on packages provided by third parties will
not be known to the standard templates, so they will have to be added
not be known to the standard templates, so they will have to be added
explicitly. 
explicitly. 
version <version> <packages>
version <version> <packages>
Selects the specified version of a
Selects the specified version of a
                  number of packages in the eCos configuration. By
                  number of packages in the eCos configuration. By
                  default, the most recent version of each package is
                  default, the most recent version of each package is
                  used. This command will be used typically when an
                  used. This command will be used typically when an
                  older version of a package is required.
                  older version of a package is required.
check
check
Presents the following information
Presents the following information
                  concerning the current configuration:
                  concerning the current configuration:
the selected target hardware
the selected target hardware
the selected template
the selected template
additional packages
additional packages
removed packages
removed packages
the selected version of packages
the selected version of packages
                      where this is not the most recent
                      where this is not the most recent
                      version
                      version
conflicts in the current configuration
conflicts in the current configuration
resolve
resolve
Resolves conflicts identified in the
Resolves conflicts identified in the
                  current eCos configuration by invoking an inference
                  current eCos configuration by invoking an inference
                  capability. Resolved conflicts are reported, but not
                  capability. Resolved conflicts are reported, but not
                  all conflicts may be resolvable. This command will
                  all conflicts may be resolvable. This command will
                  be used typically following manual editing of the
                  be used typically following manual editing of the
                  configuration.
                  configuration.
export <file>
export <file>
Exports a minimal eCos configuration
Exports a minimal eCos configuration
                  save file with the specified name. This file
                  save file with the specified name. This file
                  contains only those options which do not have their
                  contains only those options which do not have their
                  default value. Such files are used typically to
                  default value. Such files are used typically to
                  transfer option values from one configuration to
                  transfer option values from one configuration to
                  another.
                  another.
import <file>
import <file>
Imports a minimal eCos configuration
Imports a minimal eCos configuration
                  save file with the specified name. The values of
                  save file with the specified name. The values of
                  those options specified in the file are applied to
                  those options specified in the file are applied to
                  the current configuration.
                  the current configuration.
tree
tree
Generates a build tree based on the current eCos
Generates a build tree based on the current eCos
                  configuration. This command will be used typically
                  configuration. This command will be used typically
                  just before building eCos.Normally a build tree can
                  just before building eCos.Normally a build tree can
only be generated if if the configuration has no unresolved
only be generated if if the configuration has no unresolved
conflicts, but  can be used to override
conflicts, but  can be used to override
this.
this.
Conflicts and constraints
Conflicts and constraints
Configuration options are not completely independent. For example
Configuration options are not completely independent. For example
the C library's strtod() and atof()
the C library's strtod() and atof()
functions rely on the math library package to provide certain functionality. If the math library package is removed then the C
functions rely on the math library package to provide certain functionality. If the math library package is removed then the C
library can no longer provide these functions. Each package describes constraints like these in CDL "requires" properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there can
library can no longer provide these functions. Each package describes constraints like these in CDL "requires" properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there can
be several resolution options. For example, it would be possible to add the math library package back to the
be several resolution options. For example, it would be possible to add the math library package back to the
configuration, or to disable the strtod() and atof() functions.
configuration, or to disable the strtod() and atof() functions.
The eCos configuration tools will report any conflicts in the current configuration. If there are any such conflicts
The eCos configuration tools will report any conflicts in the current configuration. If there are any such conflicts
then the configuration is usually unsafe and it makes no sense to build and run eCos in such circumstances. In fact,
then the configuration is usually unsafe and it makes no sense to build and run eCos in such circumstances. In fact,
any attempt at building eCos is likely to fail. In exceptional cases it is possible to override this by using e.g. the
any attempt at building eCos is likely to fail. In exceptional cases it is possible to override this by using e.g. the
 qualifier with ecosconfig.
 qualifier with ecosconfig.
Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which can
Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which can
resolve the associated conflicts automatically. For example, if the math library package is removed then the
resolve the associated conflicts automatically. For example, if the math library package is removed then the
inference engine can resolve the resulting conflict by disabling the configuration option for strtod() and atof(). All
inference engine can resolve the resulting conflict by disabling the configuration option for strtod() and atof(). All
such changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is not
such changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is not
allowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which does
allowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which does
not match the application's requirements.
not match the application's requirements.
A typical session involving conflicts would look something like this:
A typical session involving conflicts would look something like this:
$ ecosconfig new pid
$ ecosconfig new pid
This creates a new configuration with the default template. For most targets this will not result in any conflicts,
This creates a new configuration with the default template. For most targets this will not result in any conflicts,
because the default settings for the various options meet the requirements of the default template.
because the default settings for the various options meet the requirements of the default template.
 For some targets
 For some targets
there may be conflicts and the inference engine would come into play.
there may be conflicts and the inference engine would come into play.
$ ecosconfig remove libm
$ ecosconfig remove libm
U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0
U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0
U CYGFUN_LIBC_strtod, new inferred value 0
U CYGFUN_LIBC_strtod, new inferred value 0
U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0
U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0
ecosconfig reports that this change caused three conflicts, all in the C library. The inference engine was able to
ecosconfig reports that this change caused three conflicts, all in the C library. The inference engine was able to
resolve all the conflicts and update the relevant configuration options accordingly. 
resolve all the conflicts and update the relevant configuration options accordingly. 
To suppress the inference engine  can be used:
To suppress the inference engine  can be used:
$ ecosconfig new pid
$ ecosconfig new pid
$ ecosconfig --no-resolve remove libm
$ ecosconfig --no-resolve remove libm
C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
Three unresolved conflicts are reported.
Three unresolved conflicts are reported.
The check command can be used to get the current state of the
The check command can be used to get the current state of the
configuration, and the  qualifier will provide additional information: 
configuration, and the  qualifier will provide additional information: 
$ ecosconfig --srcdir /home/bartv/ecc/ecc --verbose check
$ ecosconfig --srcdir /home/bartv/ecc/ecc --verbose check
Target: pid
Target: pid
Template: default
Template: default
Removed:
Removed:
 CYGPKG_LIBM
 CYGPKG_LIBM
3 conflict(s):
3 conflict(s):
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
 Possible solution:
 Possible solution:
    CYGFUN_LIBC_strtod -> 0
    CYGFUN_LIBC_strtod -> 0
    CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0
    CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0
C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
 Possible solution:
 Possible solution:
    CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT -> 0
    CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT -> 0
C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied:      CYGPKG_LIBM
 Possible solution:
 Possible solution:
    CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0
    CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0
If the proposed solutions are acceptable, the resolve command can be used to apply them:
If the proposed solutions are acceptable, the resolve command can be used to apply them:
$ ecosconfig resolve
$ ecosconfig resolve
U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0
U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0
U CYGFUN_LIBC_strtod, new inferred value 0
U CYGFUN_LIBC_strtod, new inferred value 0
U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0
U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0
The current configuration is again conflict-free and it is possible to generate a build tree. The  qualifier can
The current configuration is again conflict-free and it is possible to generate a build tree. The  qualifier can
be used to suppress the change messages, if desired.
be used to suppress the change messages, if desired.
When changing individual configuration options by editing the ecos.ecc file (as described below), the resulting
When changing individual configuration options by editing the ecos.ecc file (as described below), the resulting
system should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod is
system should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod is
explicitly enabled in the savefile:
explicitly enabled in the savefile:
$ edit ecos.ecc
$ edit ecos.ecc
$ ecosconfig check
$ ecosconfig check
Target: pid
Target: pid
Template: default
Template: default
Removed:
Removed:
    CYGPKG_LIBM
    CYGPKG_LIBM
1 conflict(s):
1 conflict(s):
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
$ ecosconfig resolve
$ ecosconfig resolve
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
In this case the inference engine cannot resolve the conflict automatically because that would involve changing a
In this case the inference engine cannot resolve the conflict automatically because that would involve changing a
user setting. Any attempt to generate a build tree will fail:
user setting. Any attempt to generate a build tree will fail:
$ ecosconfig --srcdir /home/bartv/ecc/ecc tree
$ ecosconfig --srcdir /home/bartv/ecc/ecc tree
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
Unable to generate build tree, this configuration still contains conflicts.
Unable to generate build tree, this configuration still contains conflicts.
Either resolve the conflicts or use --ignore-errors
Either resolve the conflicts or use --ignore-errors
It is still possible to generate a build tree:
It is still possible to generate a build tree:
$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors tree
$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors tree
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM
$ make
$ make
In this case eCos will fail to build. In other cases of unresolved conflicts eCos may build, but may not run. In
In this case eCos will fail to build. In other cases of unresolved conflicts eCos may build, but may not run. In
general all conflicts should be resolved by editing the ecos.ecc file, by letting the inference engine make appropriate
general all conflicts should be resolved by editing the ecos.ecc file, by letting the inference engine make appropriate
changes, or by other means, before any attempt is made to build or run eCos.
changes, or by other means, before any attempt is made to build or run eCos.
Building the System
Building the System
Once a build tree has been generated with
Once a build tree has been generated with
          ecosconfig, building eCos is straightforward:
          -->building eCos is straightforward:
$ make
$ make
The build tree contains the subdirectories, makefiles,
The build tree contains the subdirectories, makefiles,
          and everything else that is needed to generate the default
          and everything else that is needed to generate the default
          configuration for the selected architecture and platform.
          configuration for the selected architecture and platform.
          The only requirement is that the tools needed for that
          The only requirement is that the tools needed for that
          architecture, for example
          architecture, for example
          powerpc-eabi-g++,
          powerpc-eabi-g++,
          are available using the standard search path. If this is not
          are available using the standard search path. If this is not
          the case then the make will
          the case then the make will
          fail with an error message. If you have a multiprocessor
          fail with an error message. If you have a multiprocessor
          system then it may be more efficient to use:
          system then it may be more efficient to use:
$ make -j n
$ make -j n
where n is equal to the
where n is equal to the
          number of processors on your system.
          number of processors on your system.
Once the make process
Once the make process
          has completed, the install tree will contain the header
          has completed, the install tree will contain the header
          files and the target library that are needed for application
          files and the target library that are needed for application
          development. 
          development. 
It is also possible to build the system’s test cases
It is also possible to build the system’s test cases
for the current configuration:
for the current configuration:
$ make tests
$ make tests
The resulting test executables will end up in a
The resulting test executables will end up in a
          tests subdirectory of the
          tests subdirectory of the
          install tree. 
          install tree. 
If disk space is scarce then it is possible to make the copy
If disk space is scarce then it is possible to make the copy
of the install tree for application development purposes, and then
of the install tree for application development purposes, and then
use: 
use: 
$ make clean
$ make clean
The build tree will now use up a minimum of disk space — the
The build tree will now use up a minimum of disk space — the
bulk of what is left consists of configuration header files that
bulk of what is left consists of configuration header files that
you may have edited and hence should not be deleted automatically.
you may have edited and hence should not be deleted automatically.
However, it is possible to rebuild the system at any time without
However, it is possible to rebuild the system at any time without
re-invoking ecosconfig, just by
re-invoking ecosconfig, just by
running make again. 
running make again. 
Under exceptional circumstances it may be necessary to run make
Under exceptional circumstances it may be necessary to run make
clean for other reasons, such as when a new release
clean for other reasons, such as when a new release
of the toolchain is installed. The toolchain includes a number of
of the toolchain is installed. The toolchain includes a number of
header files which are closely tied to the compiler, for example limits.h,
header files which are closely tied to the compiler, for example limits.h,
and these header files are not and should not be duplicated by eCos.
and these header files are not and should not be duplicated by eCos.
The makefiles perform header file dependency analysis, so that when
The makefiles perform header file dependency analysis, so that when
a header file is changed all affected sources will be rebuilt during
a header file is changed all affected sources will be rebuilt during
the next make. This is very useful
the next make. This is very useful
when the configuration header files are changed, but it also means
when the configuration header files are changed, but it also means
that a build tree containing information about the locations of
that a build tree containing information about the locations of
header files must be rebuilt. If a new version of the toolchain
header files must be rebuilt. If a new version of the toolchain
is installed and the old version is removed then this location information
is installed and the old version is removed then this location information
is no longer accurate, and make will
is no longer accurate, and make will
complain that certain dependencies cannot be satisfied. Under such circumstances
complain that certain dependencies cannot be satisfied. Under such circumstances
it is necessary to do a make clean first. 
it is necessary to do a make clean first. 
Packages
Packages
eCos is a component architecture. The system comes as a
eCos is a component architecture. The system comes as a
          number of packages which can be
          number of packages which can be
          enabled or disabled as required, and new packages can be
          enabled or disabled as required, and new packages can be
          added as they become available. Unfortunately, the packages
          added as they become available. Unfortunately, the packages
          are not completely independent: for example the µITRON
          are not completely independent: for example the µITRON
          compatibility package relies almost entirely on
          compatibility package relies almost entirely on
          functionality provided by the kernel package, and it would
          functionality provided by the kernel package, and it would
          not make sense to try to build µITRON if the kernel
          not make sense to try to build µITRON if the kernel
          was disabled. The C library has fewer dependencies: some
          was disabled. The C library has fewer dependencies: some
          parts of the C library rely on kernel functionality, but it
          parts of the C library rely on kernel functionality, but it
          is possible to disable these parts and thus build a system
          is possible to disable these parts and thus build a system
          that has the C library but no kernel. The
          that has the C library but no kernel. The
        ecosconfig tool has the capability of
        ecosconfig tool has the capability of
            checking that all the dependencies are satisfied, but it
            checking that all the dependencies are satisfied, but it
            may still be possible to produce configurations that will
            may still be possible to produce configurations that will
            not build or (conceivably) that will build but not run.
            not build or (conceivably) that will build but not run.
            Developers should be aware of this and take appropriate
            Developers should be aware of this and take appropriate
            care.
            care.
By default, ecosconfig will
By default, ecosconfig will
include all packages that are appropriate for the specified hardware
include all packages that are appropriate for the specified hardware
in the configuration. The common HAL package and
in the configuration. The common HAL package and
the eCos infrastructure must be present in every configuration. In
the eCos infrastructure must be present in every configuration. In
addition, it is always necessary to have one architectural HAL package
addition, it is always necessary to have one architectural HAL package
and one platform HAL package. Other packages are optional, and can
and one platform HAL package. Other packages are optional, and can
be added or removed from a configuration as required.
be added or removed from a configuration as required.
The application may not require all of the packages; for example,
The application may not require all of the packages; for example,
it might not need the µITRON compatibility
it might not need the µITRON compatibility
package, or the floating point support provided by the math library.
package, or the floating point support provided by the math library.
There is a slight overhead when eCos is built because the packages
There is a slight overhead when eCos is built because the packages
will get compiled, and there is also a small disk space penalty.
will get compiled, and there is also a small disk space penalty.
However, any unused facilities will get stripped out at link-time,
However, any unused facilities will get stripped out at link-time,
so having redundant packages will not affect the final executable. 
so having redundant packages will not affect the final executable. 
Coarse-grained Configuration
Coarse-grained Configuration
Coarse-grained configuration of
Coarse-grained configuration of
          an eCos system means making configuration changes using the
          an eCos system means making configuration changes using the
          ecosconfig tool. These changes
          ecosconfig tool. These changes
          include: 
          include: 
switching to different target hardware
switching to different target hardware
switching to a different template
switching to a different template
adding or removing a package
adding or removing a package
changing the version of a package
changing the version of a package
Whenever ecosconfig generates or
Whenever ecosconfig generates or
          updates an eCos configuration, it generates a configuration
          updates an eCos configuration, it generates a configuration
          save file.
          save file.
Suppose that the configuration was first created using
Suppose that the configuration was first created using
          the following command line: 
          the following command line: 
$ ecosconfig new stdeval1
$ ecosconfig new stdeval1
To change the target hardware to the Cogent CMA28x
To change the target hardware to the Cogent CMA28x
          PowerPC board, the following command would be needed:
          PowerPC board, the following command would be needed:
        
        
$ ecosconfig target cma28x
$ ecosconfig target cma28x
To switch to the PowerPC simulator instead: 
To switch to the PowerPC simulator instead: 
$ ecosconfig target psim
$ ecosconfig target psim
As the hardware changes, hardware-related packages such as
As the hardware changes, hardware-related packages such as
the HAL packages and device drivers will be added to and removed
the HAL packages and device drivers will be added to and removed
from the configuration as appropriate. 
from the configuration as appropriate. 
To remove any package from the current configuration, use
To remove any package from the current configuration, use
the remove command: 
the remove command: 
$ ecosconfig remove uitron
$ ecosconfig remove uitron
You can disable multiple packages using multiple arguments,
You can disable multiple packages using multiple arguments,
for example: 
for example: 
$ ecosconfig remove uitron libm
$ ecosconfig remove uitron libm
If this turns out to have been a mistake then you can
If this turns out to have been a mistake then you can
          re-enable one or more packages with the
          re-enable one or more packages with the
          add command: 
          add command: 
$ ecosconfig add libm
$ ecosconfig add libm
Changing the desired version for a package is also
Changing the desired version for a package is also
          straightforward:
          straightforward:
$ ecosconfig version v2_1 kernel
$ ecosconfig version v2_1 kernel
It is necessary to regenerate the build tree and header
It is necessary to regenerate the build tree and header
          files following any changes to the configuration before
          files following any changes to the configuration before
          rebuilding eCos:
          rebuilding eCos:
$ ecosconfig tree
$ ecosconfig tree
Fine-grained Configuration
Fine-grained Configuration
ecosconfig only provides
ecosconfig only provides
          coarse-grained control over the configuration: the hardware,
          coarse-grained control over the configuration: the hardware,
          the template and the packages that should be built. Unlike
          the template and the packages that should be built. Unlike
          the Configuration Tool,
          the Configuration Tool,
          ecosconfig does not provide
          ecosconfig does not provide
          any facilities for manipulating finer-grained configuration options such as how many
           -->configuration options such as how many
          priority levels the scheduler should support. There are
          priority levels the scheduler should support. There are
          hundreds of these options, and manipulating them by means of
          hundreds of these options, and manipulating them by means of
          command line arguments would not be sensible. 
          command line arguments would not be sensible. 
In the current system fine-grained configuration options may
In the current system fine-grained configuration options may
be manipulated by manual editing of the configuration file. When
be manipulated by manual editing of the configuration file. When
a file has been edited in this way, the ecosconfig tool
a file has been edited in this way, the ecosconfig tool
should be used to check the configuration for any conflicts which
should be used to check the configuration for any conflicts which
may have been introduced:
may have been introduced:
$ ecosconfig check
$ ecosconfig check
The check command will list
The check command will list
all conflicts and will also rewrite the configuration file, propagating
all conflicts and will also rewrite the configuration file, propagating
any changes which affect other options. The user may choose to resolve
any changes which affect other options. The user may choose to resolve
the conflicts either by re-editing the configuration file manually
the conflicts either by re-editing the configuration file manually
or by invoking the inference engine using the resolve command:
or by invoking the inference engine using the resolve command:
$ ecosconfig resolve
$ ecosconfig resolve
The  resolve command will
The  resolve command will
list all conflicts which can be resolved and save the resulting changes
list all conflicts which can be resolved and save the resulting changes
to the configuration.
to the configuration.
It is necessary to regenerate the build tree and header files
It is necessary to regenerate the build tree and header files
following any changes to the configuration before rebuilding eCos:
following any changes to the configuration before rebuilding eCos:
$ ecosconfig tree
$ ecosconfig tree
All the configuration options and their descriptions are listed
All the configuration options and their descriptions are listed
in the eCos Reference Manual. 
in the eCos Reference Manual. 
Editing an <productname>eCos</productname> Savefile
Editing an <productname>eCos</productname> Savefile
The eCos configuration information is held in a single
The eCos configuration information is held in a single
          savefile, typically ecos.ecc, which can
          savefile, typically ecos.ecc, which can
          be generated by either the GUI configuration tool or by the
          be generated by either the GUI configuration tool or by the
          command line ecosconfig tool. The file
          command line ecosconfig tool. The file
          normally exists at the top level of the build tree. It is a
          normally exists at the top level of the build tree. It is a
          text file, allowing the various configurations options to be
          text file, allowing the various configurations options to be
          edited inside a suitable text editor or by other programs or
          edited inside a suitable text editor or by other programs or
          scripts, as well as in the GUI config tool.
          scripts, as well as in the GUI config tool.
An eCos savefile is actually a script in the Tcl programming
An eCos savefile is actually a script in the Tcl programming
language, so any modifications to the file need to preserve Tcl
language, so any modifications to the file need to preserve Tcl
syntax. For most configuration options, any modifications will be
syntax. For most configuration options, any modifications will be
trivial and there is no need to worry about Tcl syntax. For example,
trivial and there is no need to worry about Tcl syntax. For example,
changing a 1 to a 0 to disable an option.  For more complicated
changing a 1 to a 0 to disable an option.  For more complicated
options, for example CYGDAT_UITRON_TASK_EXTERNS,
options, for example CYGDAT_UITRON_TASK_EXTERNS,
which involves some lines of C code, more care has
which involves some lines of C code, more care has
to be taken. If an edited savefile is no longer a valid Tcl script
to be taken. If an edited savefile is no longer a valid Tcl script
then the configuration tools will be unable to read back the data
then the configuration tools will be unable to read back the data
for further processing, for example to generate a build tree. An
for further processing, for example to generate a build tree. An
outline of Tcl syntax is given below. One point worth noting here
outline of Tcl syntax is given below. One point worth noting here
is that a line that begins with a “#” is
is that a line that begins with a “#” is
usually a comment, and the bulk of an eCos savefile actually consists
usually a comment, and the bulk of an eCos savefile actually consists
of such comments, to make it easier to edit.
of such comments, to make it easier to edit.
Header
Header
An eCos savefile begins with a header, which typically
An eCos savefile begins with a header, which typically
            looks something like this:
            looks something like this:
# eCos saved configuration
# eCos saved configuration
# ---- commands --------------------------------------------------------
# ---- commands --------------------------------------------------------
# This section contains information about the savefile format.
# This section contains information about the savefile format.
# It should not be edited. Any modifications made to this section
# It should not be edited. Any modifications made to this section
# may make it impossible for the configuration tools to read
# may make it impossible for the configuration tools to read
# the savefile.
# the savefile.
cdl_savefile_version 1;
cdl_savefile_version 1;
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command
cdl_savefile_command
cdl_configuration { description hardware template package };
cdl_configuration { description hardware template package };
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
      
      
This section of the savefile is intended for use by the
This section of the savefile is intended for use by the
        configuration system, and should not be edited. If this
        configuration system, and should not be edited. If this
        section is edited then the various configuration tools may no
        section is edited then the various configuration tools may no
        longer be able to read in the modified savefile.
        longer be able to read in the modified savefile.
Toplevel Section
Toplevel Section
The header is followed by a section that defines the
The header is followed by a section that defines the
            configuration as a whole. A typical example would
            configuration as a whole. A typical example would
            be:
            be:
# ---- toplevel --------------------------------------------------------
# ---- toplevel --------------------------------------------------------
# This section defines the toplevel configuration object. The only
# This section defines the toplevel configuration object. The only
# values that can be changed are the name of the configuration and
# values that can be changed are the name of the configuration and
# the description field. It is not possible to modify the target,
# the description field. It is not possible to modify the target,
# the template or the set of packages simply by editing the lines
# the template or the set of packages simply by editing the lines
# below because these changes have wide-ranging effects. Instead
# below because these changes have wide-ranging effects. Instead
# the appropriate tools should be used to make such modifications.
# the appropriate tools should be used to make such modifications.
cdl_configuration eCos {
cdl_configuration eCos {
description ““ ;
description ““ ;
# These fields should not be modified.
# These fields should not be modified.
hardware    pid ;
hardware    pid ;
template    uitron ;
template    uitron ;
package -hardware CYGPKG_HAL_ARM current ;
package -hardware CYGPKG_HAL_ARM current ;
package -hardware CYGPKG_HAL_ARM_PID current ;
package -hardware CYGPKG_HAL_ARM_PID current ;
package -hardware CYGPKG_IO_SERIAL current ;
package -hardware CYGPKG_IO_SERIAL current ;
package -template CYGPKG_HAL current ;
package -template CYGPKG_HAL current ;
package -template CYGPKG_IO current ;
package -template CYGPKG_IO current ;
package -template CYGPKG_INFRA current ;
package -template CYGPKG_INFRA current ;
package -template CYGPKG_KERNEL current ;
package -template CYGPKG_KERNEL current ;
package -template CYGPKG_UITRON current ;
package -template CYGPKG_UITRON current ;
package -template CYGPKG_LIBC current ;
package -template CYGPKG_LIBC current ;
package -template CYGPKG_LIBM current ;
package -template CYGPKG_LIBM current ;
package -template CYGPKG_DEVICES_WALLCLOCK current ;
package -template CYGPKG_DEVICES_WALLCLOCK current ;
package -template CYGPKG_ERROR current ;
package -template CYGPKG_ERROR current ;
};
};
      
      
This section allows the configuration tools to reload the
This section allows the configuration tools to reload the
various packages that make up the configuration. Most of the information
various packages that make up the configuration. Most of the information
should not be edited. If it is necessary to add a new package or
should not be edited. If it is necessary to add a new package or
to remove an existing one then the appropriate tools should be used
to remove an existing one then the appropriate tools should be used
for this, for example:
for this, for example:
$ ecosconfig remove CYGPKG_LIBM
$ ecosconfig remove CYGPKG_LIBM
There are two fields which can be edited. Configurations have
There are two fields which can be edited. Configurations have
a name; in this case eCos. They can also have a description, which
a name; in this case eCos. They can also have a description, which
is some arbitrary text. The configuration tools do not make use
is some arbitrary text. The configuration tools do not make use
of these fields, they exist so that users can store additional information
of these fields, they exist so that users can store additional information
about a configuration.
about a configuration.
Conflicts Section
Conflicts Section
The toplevel section is followed by details of all the
The toplevel section is followed by details of all the
            conflicts (if any) in the configuration, for
            conflicts (if any) in the configuration, for
            example:
            example:
# ---- conflicts -------------------------------------------------------
# ---- conflicts -------------------------------------------------------
# There are 2 conflicts.
# There are 2 conflicts.
#
#
# option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET
# option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET
#   Property LegalValues
#   Property LegalValues
#   Illegal current value 100000
#   Illegal current value 100000
#   Legal values are: -90000 to 90000
#   Legal values are: -90000 to 90000
#
#
# option CYGSEM_LIBC_TIME_CLOCK_WORKING
# option CYGSEM_LIBC_TIME_CLOCK_WORKING
#   Property Requires
#   Property Requires
#   Requires constraint not satisfied: CYGFUN_KERNEL_THREADS_TIMER
#   Requires constraint not satisfied: CYGFUN_KERNEL_THREADS_TIMER
          
          
When editing a configuration you may end up with something
When editing a configuration you may end up with something
that is invalid. Any problems in the configuration will be reported
that is invalid. Any problems in the configuration will be reported
in the conflicts section. In this case there are two conflicts.
in the conflicts section. In this case there are two conflicts.
The option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET has
The option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET has
been given an illegal value: typically this would be fixed by searching
been given an illegal value: typically this would be fixed by searching
for the definition of that option later on in the savefile and modifying
for the definition of that option later on in the savefile and modifying
the value. The second conflict is more interesting, an unsatisfied requires constraint.
the value. The second conflict is more interesting, an unsatisfied requires constraint.
Configuration options are not independent: disabling some functionality
Configuration options are not independent: disabling some functionality
in, say, the kernel, can have an impact elsewhere; in this case
in, say, the kernel, can have an impact elsewhere; in this case
the C library. The various dependencies between the options are
the C library. The various dependencies between the options are
specified by the component developers and checked by the configuration
specified by the component developers and checked by the configuration
system. In this case there are two obvious ways in which the conflict could
system. In this case there are two obvious ways in which the conflict could
be resolved: re-enabling CYGFUN_KERNEL_THREADS_TIMER,
be resolved: re-enabling CYGFUN_KERNEL_THREADS_TIMER,
or disabling CYGSEM_LIBC_TIME_CLOCK_WORKING.
or disabling CYGSEM_LIBC_TIME_CLOCK_WORKING.
Both of these options will be listed later on in the file.
Both of these options will be listed later on in the file.
Some care has to be taken when modifying configuration options,
Some care has to be taken when modifying configuration options,
to avoid introducing new conflict. For instance it is possible that
to avoid introducing new conflict. For instance it is possible that
there might be other options in the system which have a dependency
there might be other options in the system which have a dependency
on CYGSEM_LIBC_TIME_CLOCK_WORKING,
on CYGSEM_LIBC_TIME_CLOCK_WORKING,
so disabling that option may not be the best way to resolve the
so disabling that option may not be the best way to resolve the
conflict. Details of all such dependencies are provided in the appropriate
conflict. Details of all such dependencies are provided in the appropriate
places in the savefile.
places in the savefile.
It is not absolutely required that a configuration be conflict-free
It is not absolutely required that a configuration be conflict-free
before generating a build tree and building eCos. It is up to the
before generating a build tree and building eCos. It is up to the
developers of each component to decide what would happen if an attempt
developers of each component to decide what would happen if an attempt
is made to build eCos while there are still conflicts. In serious
is made to build eCos while there are still conflicts. In serious
cases there is likely to be a compile-time failure, or possibly
cases there is likely to be a compile-time failure, or possibly
a link-time failure. In less serious cases the system may build
a link-time failure. In less serious cases the system may build
happily and the application can be linked with the resulting library,
happily and the application can be linked with the resulting library,
but the component may not quite function as intended - although
but the component may not quite function as intended - although
it may still be good enough for the specific needs of the application.
it may still be good enough for the specific needs of the application.
It is also possible that everything builds and links, but once in
It is also possible that everything builds and links, but once in
a while the system will unaccountably crash. Using a configuration
a while the system will unaccountably crash. Using a configuration
that still has conflicts is done entirely at the user’s
that still has conflicts is done entirely at the user’s
risk.
risk.
Data Section
Data Section
The bulk of the savefile lists the various packages,
The bulk of the savefile lists the various packages,
            components, and options, including their values and the
            components, and options, including their values and the
            various dependencies. A number of global options come
            various dependencies. A number of global options come
            first, especially those related to the build process such
            first, especially those related to the build process such
            as compiler flags. These are followed by the various
            as compiler flags. These are followed by the various
            packages, and the components and options within those
            packages, and the components and options within those
            packages, in order.
            packages, in order.
Packages, components and options are organized in a
Packages, components and options are organized in a
            hierarchy. If a particular component is disabled then all
            hierarchy. If a particular component is disabled then all
            options and sub-components below it will be inactive: any
            options and sub-components below it will be inactive: any
            changes made to these will have no effect. The savefile
            changes made to these will have no effect. The savefile
            contains information about the hierarchy in the form of
            contains information about the hierarchy in the form of
            comments, for example:
            comments, for example:
cdl_package CYGPKG_KERNEL ...
cdl_package CYGPKG_KERNEL ...
# >
# >
cdl_component CYGPKG_KERNEL_EXCEPTIONS ...
cdl_component CYGPKG_KERNEL_EXCEPTIONS ...
# >
# >
cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE ...
cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE ...
cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL ...
cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL ...
# <
# <
cdl_component CYGPKG_KERNEL_SCHED ...
cdl_component CYGPKG_KERNEL_SCHED ...
# >
# >
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE ...
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE ...
cdl_option CYGSEM_KERNEL_SCHED_BITMAP ...
cdl_option CYGSEM_KERNEL_SCHED_BITMAP ...
# <
# <
# <
# <
          
          
This corresponds to the following hierarchy:
This corresponds to the following hierarchy:
 CYGPKG_KERNEL
 CYGPKG_KERNEL
   CYGPKG_KERNEL_EXCEPTIONS
   CYGPKG_KERNEL_EXCEPTIONS
     CYGSEM_KERNEL_EXCEPTIONS_DECODE
     CYGSEM_KERNEL_EXCEPTIONS_DECODE
     CYGSEM_KERNEL_EXCEPTIONS_GLOBAL
     CYGSEM_KERNEL_EXCEPTIONS_GLOBAL
   CYGPKG_KERNEL_SCHED
   CYGPKG_KERNEL_SCHED
     CYGSEM_KERNEL_SCHED_MLQUEUE
     CYGSEM_KERNEL_SCHED_MLQUEUE
     CYGSEM_KERNEL_SCHED_BITMAP
     CYGSEM_KERNEL_SCHED_BITMAP
          
          
Providing the hierarchy information in this way allows
Providing the hierarchy information in this way allows
            programs or scripts to analyze the savefile and readily
            programs or scripts to analyze the savefile and readily
            determine the hierarchy. It could also be used by a
            determine the hierarchy. It could also be used by a
            sufficiently powerful editor to support structured editing
            sufficiently powerful editor to support structured editing
            of eCos savefiles. The information is not used by the
            of eCos savefiles. The information is not used by the
            configuration tools themselves since they obtain the
            configuration tools themselves since they obtain the
            hierarchy from the original CDL scripts.
            hierarchy from the original CDL scripts.
Each configurable entity is preceded by a comment, of
Each configurable entity is preceded by a comment, of
            the following form:
            the following form:
# Kernel schedulers
# Kernel schedulers
# doc: ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER
# doc: ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER
# The eCos kernel provides a choice of schedulers. In addition
# The eCos kernel provides a choice of schedulers. In addition
# there are a number of configuration options to control the
# there are a number of configuration options to control the
# detailed behaviour of these schedulers.
# detailed behaviour of these schedulers.
cdl_component CYGPKG_KERNEL_SCHED {
cdl_component CYGPKG_KERNEL_SCHED {
...
...
};
};
          
          
This provides a short textual alias
This provides a short textual alias
            Kernel schedulers for the
            Kernel schedulers for the
            component. If online documentation is available for the
            component. If online documentation is available for the
            configurable entity then this will come next. Finally
            configurable entity then this will come next. Finally
            there is a short description of the entity as a whole. All
            there is a short description of the entity as a whole. All
            this information is provided by the component
            this information is provided by the component
            developers.
            developers.
Each configurable entity takes the form:
Each configurable entity takes the form:
<type> <name> {
<type> <name> {
     <data>
     <data>
};
};
Configurable entities may not be active. This can be either
Configurable entities may not be active. This can be either
because the parent is disabled or inactive, or because there are
because the parent is disabled or inactive, or because there are
one or more active_if properties. Modifying
one or more active_if properties. Modifying
the value of an inactive entity has no effect on the configuration,
the value of an inactive entity has no effect on the configuration,
so this information is provided first:
so this information is provided first:
cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE {
cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE {
# This option is not active
# This option is not active
# The parent CYGPKG_KERNEL_EXCEPTIONS is disabled
# The parent CYGPKG_KERNEL_EXCEPTIONS is disabled
...
...
};
};
...
...
cdl_option CYGIMP_IDLE_THREAD_YIELD {
cdl_option CYGIMP_IDLE_THREAD_YIELD {
# This option is not active
# This option is not active
# ActiveIf constraint: (CYGNUM_KERNEL_SCHED_PRIORITIES == 1)
# ActiveIf constraint: (CYGNUM_KERNEL_SCHED_PRIORITIES == 1)
#     CYGNUM_KERNEL_SCHED_PRIORITIES == 32
#     CYGNUM_KERNEL_SCHED_PRIORITIES == 32
#   --> 0
#   --> 0
...
...
};
};
For CYGIMP_IDLE_THREAD_YIELD the
For CYGIMP_IDLE_THREAD_YIELD the
savefile lists the expression that must be satisfied if the option
savefile lists the expression that must be satisfied if the option
is to be active, followed by the current value of all entities that
is to be active, followed by the current value of all entities that
are referenced in the expression, and finally the result of evaluating
are referenced in the expression, and finally the result of evaluating
that expression.
that expression.
Not all options are directly modifiable in the savefile. First,
Not all options are directly modifiable in the savefile. First,
the value of packages (which is the version of that package loaded
the value of packages (which is the version of that package loaded
into the configuration) cannot be modified here.
into the configuration) cannot be modified here.
cdl_package CYGPKG_KERNEL {
cdl_package CYGPKG_KERNEL {
# Packages cannot be added or removed, nor can their version be changed,
# Packages cannot be added or removed, nor can their version be changed,
# simply by editing their value. Instead the appropriate configuration
# simply by editing their value. Instead the appropriate configuration
# should be used to perform these actions.
# should be used to perform these actions.
...
...
};
};
The version of a package can be changed using e.g.:    
The version of a package can be changed using e.g.:    
$ ecosconfig version 1.3 CYGPKG_KERNEL
$ ecosconfig version 1.3 CYGPKG_KERNEL
Even though a package’s value cannot be modified
Even though a package’s value cannot be modified
here, it is still important for the savefile to contain the details.
here, it is still important for the savefile to contain the details.
In particular packages may impose constraints on other configurable
In particular packages may impose constraints on other configurable
entities and may be referenced by other configurable entities. Also
entities and may be referenced by other configurable entities. Also
it would be difficult to understand or extract the configuration’s
it would be difficult to understand or extract the configuration’s
hierarchy if the packages were not listed in the appropriate places
hierarchy if the packages were not listed in the appropriate places
in the savefile.
in the savefile.
Some components (or, conceivably, options) do not have any
Some components (or, conceivably, options) do not have any
associated data. Typically they serve only to introduce another
associated data. Typically they serve only to introduce another
level in the hierarchy, which can be useful in the context of the
level in the hierarchy, which can be useful in the context of the
GUI configuration tool.
GUI configuration tool.
cdl_component CYGPKG_HAL_COMMON_INTERRUPTS {
cdl_component CYGPKG_HAL_COMMON_INTERRUPTS {
# There is no associated value.
# There is no associated value.
};
};
Other components or options have a calculated value. These
Other components or options have a calculated value. These
are not user-modifiable, but typically the value will depend on
are not user-modifiable, but typically the value will depend on
other options which can be modified. Such calculated options can
other options which can be modified. Such calculated options can
be useful when controlling what gets built or what ends up in the
be useful when controlling what gets built or what ends up in the
generated configuration header files. A calculated value may also
generated configuration header files. A calculated value may also
effect other parts of the configuration, for instance, via a requires constraint.
effect other parts of the configuration, for instance, via a requires constraint.
cdl_option BUFSIZ {
cdl_option BUFSIZ {
# Calculated value: CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO ? CYGNUM_LIBC_STDIO_BUFSIZE : 0
# Calculated value: CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO ? CYGNUM_LIBC_STDIO_BUFSIZE : 0
#     CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO == 1
#     CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO == 1
#     CYGNUM_LIBC_STDIO_BUFSIZE == 256
#     CYGNUM_LIBC_STDIO_BUFSIZE == 256
# Current_value: 256
# Current_value: 256
};
};
A special type of calculated value is the interface.
A special type of calculated value is the interface.
The value of an interface is the number of active and enabled options
The value of an interface is the number of active and enabled options
which implement that interface. Again the value
which implement that interface. Again the value
of an interface cannot be modified directly; only by modifying the
of an interface cannot be modified directly; only by modifying the
options which implement the interface. However, an interface can
options which implement the interface. However, an interface can
be referenced by other parts of the configuration. 
be referenced by other parts of the configuration. 
cdl_interface CYGINT_KERNEL_SCHEDULER {
cdl_interface CYGINT_KERNEL_SCHEDULER {
# Implemented by CYGSEM_KERNEL_SCHED_MLQUEUE, active, enabled
# Implemented by CYGSEM_KERNEL_SCHED_MLQUEUE, active, enabled
# Implemented by CYGSEM_KERNEL_SCHED_BITMAP, active, disabled
# Implemented by CYGSEM_KERNEL_SCHED_BITMAP, active, disabled
# This value cannot be modified here.
# This value cannot be modified here.
# Current_value: 1
# Current_value: 1
# Requires: 1 == CYGINT_KERNEL_SCHEDULER
# Requires: 1 == CYGINT_KERNEL_SCHEDULER
#     CYGINT_KERNEL_SCHEDULER == 1
#     CYGINT_KERNEL_SCHEDULER == 1
#   --> 1
#   --> 1
# The following properties are affected by this value
# The following properties are affected by this value
# interface CYGINT_KERNEL_SCHEDULER
# interface CYGINT_KERNEL_SCHEDULER
#     Requires: 1 == CYGINT_KERNEL_SCHEDULER
#     Requires: 1 == CYGINT_KERNEL_SCHEDULER
}; 
}; 
If the configurable entity is modifiable then there will be
If the configurable entity is modifiable then there will be
lines like the following:
lines like the following:
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {
...
...
# Flavor: bool
# Flavor: bool
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value 1
# user_value 1
# value_source default
# value_source default
# Default value: 1
# Default value: 1
...
...
};
};
Configurable entities can have one of four different flavors:
Configurable entities can have one of four different flavors:
none, bool, data and booldata. Flavor none indicates that there
none, bool, data and booldata. Flavor none indicates that there
is no data associated with the entity, typically it just acts as
is no data associated with the entity, typically it just acts as
a placeholder in the overall hierarchy. Flavor bool is the most
a placeholder in the overall hierarchy. Flavor bool is the most
common, it is a simple yes-or-no choice. Flavor data is for more
common, it is a simple yes-or-no choice. Flavor data is for more
complicated configuration choices, for instance the size of an array
complicated configuration choices, for instance the size of an array
or the name of a device. Flavor booldata is a combination of bool
or the name of a device. Flavor booldata is a combination of bool
and data: the option can be enabled or disabled, and there is some
and data: the option can be enabled or disabled, and there is some
additional data associated with the option as well.
additional data associated with the option as well.
In the above example the user has not modified this particular
In the above example the user has not modified this particular
option, as indicated by the comment and by the commented-out user_value line.
option, as indicated by the comment and by the commented-out user_value line.
To disable this option the file should be edited to:
To disable this option the file should be edited to:
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {
...
...
# Flavor: bool
# Flavor: bool
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
user_value 0
user_value 0
# value_source default
# value_source default
# Default value: 1
# Default value: 1
...
...
}
}
The comment preceding the user_value
The comment preceding the user_value
0 line can be removed if desired, otherwise it
0 line can be removed if desired, otherwise it
will be removed automatically the next time the file is read and
will be removed automatically the next time the file is read and
updated by the configuration tools.
updated by the configuration tools.
Much the same process should be used for options with the
Much the same process should be used for options with the
data flavor, for example:
data flavor, for example:
cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {
cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {
# Flavor: data
# Flavor: data
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value 3600
# user_value 3600
# value_source default
# value_source default
# Default value: 3600
# Default value: 3600
# Legal values: -90000 to 90000
# Legal values: -90000 to 90000
};
};
can be changed to:
can be changed to:
cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {
cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {
# Flavor: data
# Flavor: data
user_value 7200
user_value 7200
# value_source default
# value_source default
# Default value: 3600
# Default value: 3600
# Legal values: -90000 to 90000 };
# Legal values: -90000 to 90000 };
Note that the original text provides the default value in
Note that the original text provides the default value in
the user_value comment,
the user_value comment,
on the assumption that the desired new value is likely to be similar
on the assumption that the desired new value is likely to be similar
to the default value. The value_source comment
to the default value. The value_source comment
does not need to be updated, it will be fixed up if the savefile
does not need to be updated, it will be fixed up if the savefile
is fed back into the configuration system and regenerated.
is fed back into the configuration system and regenerated.
For options with the booldata flavor, the user_value line
For options with the booldata flavor, the user_value line
needs take two arguments. The first argument is for the boolean
needs take two arguments. The first argument is for the boolean
part, the second for the data part. For example:
part, the second for the data part. For example:
cdl_component CYGNUM_LIBM_COMPATIBILITY {
cdl_component CYGNUM_LIBM_COMPATIBILITY {
# Flavor: booldata
# Flavor: booldata
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value 1 POSIX
# user_value 1 POSIX
# value_source default
# value_source default
# Default value: 1 POSIX
# Default value: 1 POSIX
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
...
...
};
};
could be changed to:
could be changed to:
cdl_component CYGNUM_LIBM_COMPATIBILITY {
cdl_component CYGNUM_LIBM_COMPATIBILITY {
# Flavor: booldata
# Flavor: booldata
user_value 1 IEEE
user_value 1 IEEE
# value_source default
# value_source default
# Default value: 1 POSIX
# Default value: 1 POSIX
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
...
...
};
};
or alternatively, if the whole component should be disabled,
or alternatively, if the whole component should be disabled,
to:
to:
cdl_component CYGNUM_LIBM_COMPATIBILITY {
cdl_component CYGNUM_LIBM_COMPATIBILITY {
# Flavor: booldata
# Flavor: booldata
user_value 0 POSIX
user_value 0 POSIX
# value_source default
# value_source default
# Default value: 1 POSIX
# Default value: 1 POSIX
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
...
...
};
};
Some options take values that span multiple lines. An example
Some options take values that span multiple lines. An example
would be:
would be:
cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {
cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {
# Flavor: data
# Flavor: data
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value \
# user_value \
# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\
# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\
#  CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\
#  CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\
#  CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”
#  CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”
# value_source default
# value_source default
# Default value: \
# Default value: \
#     “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\
#     “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\
#      CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\
#      CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\
#      CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”
#      CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”
};
};
Setting a user value for this option involves uncommenting
Setting a user value for this option involves uncommenting
and modifying all relevant lines, for example:
and modifying all relevant lines, for example:
cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {
cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {
# Flavor: data
# Flavor: data
user_value \
user_value \
“CYG_UIT_MEMPOOLVAR( vpool1, 4000 ), \\
“CYG_UIT_MEMPOOLVAR( vpool1, 4000 ), \\
CYG_UIT_MEMPOOLVAR( vpool2, 4000 ),”
CYG_UIT_MEMPOOLVAR( vpool2, 4000 ),”
# value_source default
# value_source default
# Default value: \
# Default value: \
#     “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\
#     “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\
#      CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\
#      CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\
#      CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”
#      CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”
};
};
In such cases appropriate care has to be taken to preserve
In such cases appropriate care has to be taken to preserve
Tcl syntax, as discussed below.
Tcl syntax, as discussed below.
The configuration system has the ability to keep track of
The configuration system has the ability to keep track of
          several different values for any given option. All options
          several different values for any given option. All options
          start off with a default value, in other words their value
          start off with a default value, in other words their value
          source is set to default. If a
          source is set to default. If a
          configuration involves conflicts and the configuration
          configuration involves conflicts and the configuration
          system’s inference engine is allowed to resolve these
          system’s inference engine is allowed to resolve these
          automatically then it may provide an
          automatically then it may provide an
          inferred value instead, for
          inferred value instead, for
          example:
          example:
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
# Flavor: bool
# Flavor: bool
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value 1
# user_value 1
# The inferred value should not be edited directly.
# The inferred value should not be edited directly.
inferred_value 0
inferred_value 0
# value_source inferred
# value_source inferred
# Default value: 1
# Default value: 1
...
...
};
};
Inferred values are calculated by the configuration system
Inferred values are calculated by the configuration system
and should not be edited by the user. If the inferred value is not
and should not be edited by the user. If the inferred value is not
correct then a user value should be substituted instead:
correct then a user value should be substituted instead:
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
# Flavor: bool
# Flavor: bool
user_value 1
user_value 1
# The inferred value should not be edited directly.
# The inferred value should not be edited directly.
inferred_value 0
inferred_value 0
# value_source inferred
# value_source inferred
# Default value: 1
# Default value: 1
...
...
}; 
}; 
The inference engine will not override a user value with an
The inference engine will not override a user value with an
inferred one. Making a change like this may well re-introduce a
inferred one. Making a change like this may well re-introduce a
conflict, since the inferred value was only calculated to resolve
conflict, since the inferred value was only calculated to resolve
a conflict. Another run of the inference engine may find a different
a conflict. Another run of the inference engine may find a different
and more acceptable way of resolving the conflict, but this is not guaranteed
and more acceptable way of resolving the conflict, but this is not guaranteed
and it may be up to the user to examine the various dependencies
and it may be up to the user to examine the various dependencies
and work out an acceptable solution.
and work out an acceptable solution.
Inferred values are listed in the savefile because the exact
Inferred values are listed in the savefile because the exact
inferred value may depend on the order in which changes were made
inferred value may depend on the order in which changes were made
and conflicts were resolved. If the inferred values were absent
and conflicts were resolved. If the inferred values were absent
then it is possible that reloading a savefile would not exactly
then it is possible that reloading a savefile would not exactly
restore the configuration. Default values on the other hand are
restore the configuration. Default values on the other hand are
entirely deterministic so there is no actual need for the values
entirely deterministic so there is no actual need for the values
to be listed in the savefile. However, the default value can be
to be listed in the savefile. However, the default value can be
very useful information so it is provided in a comment.
very useful information so it is provided in a comment.
Occasionally the user will want to do some experimentation,
Occasionally the user will want to do some experimentation,
and temporarily switch an option from a user value back to a default
and temporarily switch an option from a user value back to a default
or inferred one to see what the effect would be. This could be achieved
or inferred one to see what the effect would be. This could be achieved
by simply commenting out the user value. For instance, if the current
by simply commenting out the user value. For instance, if the current
savefile contains:
savefile contains:
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
# Flavor: bool
# Flavor: bool
user_value 1
user_value 1
# The inferred value should not be edited directly.
# The inferred value should not be edited directly.
inferred_value 0
inferred_value 0
# value_source user
# value_source user
# Default value: 1
# Default value: 1
...
...
};
};
then the inferred value could be restored by commenting out
then the inferred value could be restored by commenting out
or removing the user_value line:
or removing the user_value line:
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
# Flavor: bool
# Flavor: bool
# user_value 1
# user_value 1
# The inferred value should not be edited directly.
# The inferred value should not be edited directly.
inferred_value 0
inferred_value 0
# value_source user
# value_source user
# Default value: 1
# Default value: 1
...
...
};
};
This is fine for simple values. However if the value is complicated
This is fine for simple values. However if the value is complicated
then there is a problem: commenting out the user_value line
then there is a problem: commenting out the user_value line
or lines means that the user value becomes invisible to the configuration system,
or lines means that the user value becomes invisible to the configuration system,
so if the savefile is loaded and then regenerated the information
so if the savefile is loaded and then regenerated the information
will be lost. An alternative approach is to keep the user_value but
will be lost. An alternative approach is to keep the user_value but
explicitly set the value_source line,
explicitly set the value_source line,
for example:
for example:
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {
# Flavor: bool
# Flavor: bool
user_value 1
user_value 1
# The inferred value should not be edited directly.
# The inferred value should not be edited directly.
inferred_value 0
inferred_value 0
value_source inferred
value_source inferred
# Default value: 1
# Default value: 1
...
...
};
};
In this case the configuration system will use the inferred
In this case the configuration system will use the inferred
value for the purposes of dependency analysis etc., even though
value for the purposes of dependency analysis etc., even though
a user value is present. To restore the user value the value_source line
a user value is present. To restore the user value the value_source line
can be commented out again. If there is no explicit value_source then
can be commented out again. If there is no explicit value_source then
the configuration system will just use the highest priority one:
the configuration system will just use the highest priority one:
the user value if it exists; otherwise the inferred value if it
the user value if it exists; otherwise the inferred value if it
exists; otherwise the default value which always exists.
exists; otherwise the default value which always exists.
The default value for an option can be a simple constant,
The default value for an option can be a simple constant,
or it can be an expression involving other options. In the latter
or it can be an expression involving other options. In the latter
case the expression will be listed, together with the values for
case the expression will be listed, together with the values for
all options referenced in the expression and the current result
all options referenced in the expression and the current result
of evaluating that expression. This is for informational purposes
of evaluating that expression. This is for informational purposes
only, the default value is always recalculated deterministically
only, the default value is always recalculated deterministically
when loading in a savefile.
when loading in a savefile.
cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
# Flavor: data
# Flavor: data
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value arm-elf
# user_value arm-elf
# value_source default
# value_source default
# Default value:  CYGHWR_THUMB ? “thumb-elf” : “arm-elf”
# Default value:  CYGHWR_THUMB ? “thumb-elf” : “arm-elf”
#     CYGHWR_THUMB == 0
#     CYGHWR_THUMB == 0
#   --> arm-elf
#   --> arm-elf
};
};
For options with the data or booldata flavor, there are likely
For options with the data or booldata flavor, there are likely
to be constraints on the possible values. If the value is supposed
to be constraints on the possible values. If the value is supposed
to be a number in a given range and a user value of “hello
to be a number in a given range and a user value of “hello
world” is provided instead then there
world” is provided instead then there
are likely to be compile-time failures. Component developers can
are likely to be compile-time failures. Component developers can
specify constraints on the legal values, and these will be listed
specify constraints on the legal values, and these will be listed
in the savefile.
in the savefile.
cdl_option X_TLOSS {
cdl_option X_TLOSS {
# Flavor: data
# Flavor: data
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value 1.41484755040569E+16
# user_value 1.41484755040569E+16
# value_source default
# value_source default
# Default value: 1.41484755040569E+16
# Default value: 1.41484755040569E+16
# Legal values: 1 to 1e308
# Legal values: 1 to 1e308
};
};
cdl_component CYGNUM_LIBM_COMPATIBILITY {
cdl_component CYGNUM_LIBM_COMPATIBILITY {
# Flavor: booldata
# Flavor: booldata
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value 1 POSIX
# user_value 1 POSIX
# value_source default
# value_source default
# Default value: 1 POSIX
# Default value: 1 POSIX
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
# Legal values:  “POSIX” “IEEE” “XOPEN” “SVID”
...
...
};
};
In some cases the legal values list may be an expression involving
In some cases the legal values list may be an expression involving
other options. If so then the current values of the referenced options
other options. If so then the current values of the referenced options
will be listed, together with the result of evaluating the list
will be listed, together with the result of evaluating the list
expression, just as for default value expressions.
expression, just as for default value expressions.
If an illegal value is provided then this will result in a
If an illegal value is provided then this will result in a
conflict, listed in the conflicts section of the savefile. For more
conflict, listed in the conflicts section of the savefile. For more
complicated options a simple legal values list is not sufficient
complicated options a simple legal values list is not sufficient
to allow the current value to be validated, and the configuration
to allow the current value to be validated, and the configuration
system will be unable to flag conflicts. This issue will be addressed in
system will be unable to flag conflicts. This issue will be addressed in
future releases of the configuration system.
future releases of the configuration system.
Following the value-related fields for a given option, any requires constraints belonging
Following the value-related fields for a given option, any requires constraints belonging
to this option will be listed. These constraints are only effective
to this option will be listed. These constraints are only effective
if the option is active and, for bool and booldata flavors, enabled.
if the option is active and, for bool and booldata flavors, enabled.
If some aspect of eCos functionality is inactive or disabled then
If some aspect of eCos functionality is inactive or disabled then
it cannot impose any constraints on the rest of the system. As usual,
it cannot impose any constraints on the rest of the system. As usual,
the full expression will be listed followed by the current values
the full expression will be listed followed by the current values
of all options that are referenced and the result of evaluating
of all options that are referenced and the result of evaluating
the expression:
the expression:
cdl_option CYGSEM_LIBC_TIME_TIME_WORKING {
cdl_option CYGSEM_LIBC_TIME_TIME_WORKING {
...
...
# Requires: CYGPKG_DEVICES_WALLCLOCK
# Requires: CYGPKG_DEVICES_WALLCLOCK
#     CYGPKG_DEVICES_WALLCLOCK == current
#     CYGPKG_DEVICES_WALLCLOCK == current
#   --> 1
#   --> 1
};
};
When modifying the value of an option it is useful to know
When modifying the value of an option it is useful to know
not only what constraints the option imposes on the rest of the
not only what constraints the option imposes on the rest of the
system but also what other options in the system depend in some
system but also what other options in the system depend in some
way on this one. The savefile provides this information:
way on this one. The savefile provides this information:
cdl_option CYGFUN_KERNEL_THREADS_TIMER {
cdl_option CYGFUN_KERNEL_THREADS_TIMER {
...
...
# The following properties are affected by this value
# The following properties are affected by this value
# option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT
# option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT
#     Requires: CYGFUN_KERNEL_THREADS_TIMER
#     Requires: CYGFUN_KERNEL_THREADS_TIMER
# option CYGIMP_UITRON_STRICT_CONFORMANCE
# option CYGIMP_UITRON_STRICT_CONFORMANCE
#     Requires: CYGFUN_KERNEL_THREADS_TIMER
#     Requires: CYGFUN_KERNEL_THREADS_TIMER
# option CYGSEM_LIBC_TIME_CLOCK_WORKING
# option CYGSEM_LIBC_TIME_CLOCK_WORKING
#     Requires: CYGFUN_KERNEL_THREADS_TIMER
#     Requires: CYGFUN_KERNEL_THREADS_TIMER
};
};
Tcl Syntax
Tcl Syntax
eCos savefiles are implemented as Tcl scripts, and are read
eCos savefiles are implemented as Tcl scripts, and are read
in by running the data through a standard Tcl interpreter that has
in by running the data through a standard Tcl interpreter that has
been extended with a small number of additional commands such as cdl_option and cdl_configuration.
been extended with a small number of additional commands such as cdl_option and cdl_configuration.
In many cases this is an implementation detail that can be safely
In many cases this is an implementation detail that can be safely
ignored while editing a savefile: simply replacing a 1 with
ignored while editing a savefile: simply replacing a 1 with
a 0 to disable some functionality
a 0 to disable some functionality
is not going to affect whether or not the savefile is still a valid
is not going to affect whether or not the savefile is still a valid
Tcl script and can be processed by a Tcl interpreter. However, there
Tcl script and can be processed by a Tcl interpreter. However, there
are more complicated cases where an understanding of Tcl syntax
are more complicated cases where an understanding of Tcl syntax
is at least desirable, for example:
is at least desirable, for example:
cdl_option CYGDAT_UITRON_MEMPOOLVAR_EXTERNS {
cdl_option CYGDAT_UITRON_MEMPOOLVAR_EXTERNS {
     # Flavor: data
     # Flavor: data
     user_value \
     user_value \
      “static char vpool1\[ 2000 \], \\
      “static char vpool1\[ 2000 \], \\
      vpool2\[ 2000 \], \\
      vpool2\[ 2000 \], \\
       vpool3\[ 2000 \];”
       vpool3\[ 2000 \];”
# value_source default
# value_source default
# Default value: \
# Default value: \
     #     “static char vpool1\[ 2000 \], \\
     #     “static char vpool1\[ 2000 \], \\
     #      vpool2\[ 2000 \], \\
     #      vpool2\[ 2000 \], \\
    #      vpool3\[ 2000 \];”
    #      vpool3\[ 2000 \];”
};
};
The backslash at the end of the user_value line
The backslash at the end of the user_value line
is processed by the Tcl interpreter as a line continuation character.
is processed by the Tcl interpreter as a line continuation character.
The quote marks around the user data are also interpreted by the
The quote marks around the user data are also interpreted by the
Tcl interpreter and serve to turn the entire data field into a single
Tcl interpreter and serve to turn the entire data field into a single
argument. The backslashes preceding the opening and closing square
argument. The backslashes preceding the opening and closing square
brackets prevent the Tcl interpreter from treating these characters
brackets prevent the Tcl interpreter from treating these characters
specially, otherwise there would be an attempt at command
specially, otherwise there would be an attempt at command
substitution as described below. The double backslashes
substitution as described below. The double backslashes
at the end of each line of the data will be turned into a single
at the end of each line of the data will be turned into a single
backslash by the Tcl interpreter, rather than escaping the newline
backslash by the Tcl interpreter, rather than escaping the newline
character, so that the actual data seen by the configuration system
character, so that the actual data seen by the configuration system
is:
is:
static char vpool1[ 2000 ], \
static char vpool1[ 2000 ], \
      vpool2[ 2000 ], \
      vpool2[ 2000 ], \
      vpool3[ 2000 ];
      vpool3[ 2000 ];
This is of course the data that should end up in the µITRON
This is of course the data that should end up in the µITRON
configuration header file. The opening and closing braces surrounding
configuration header file. The opening and closing braces surrounding
the entire body of the option data are also significant and cause
the entire body of the option data are also significant and cause
this body to be passed as a single argument to the cdl_option command.
this body to be passed as a single argument to the cdl_option command.
The closing semicolon is optional in this example, but provides
The closing semicolon is optional in this example, but provides
a small amount of additional robustness if the savefile is edited
a small amount of additional robustness if the savefile is edited
such that it is no longer a valid Tcl script. If the data contained
such that it is no longer a valid Tcl script. If the data contained
any $ characters then
any $ characters then
these would have to be treated specially as well, via a backslash escape.
these would have to be treated specially as well, via a backslash escape.
In spite of what all the above might seem to suggest, Tcl
In spite of what all the above might seem to suggest, Tcl
is actually a very simple yet powerful scripting language: the syntax
is actually a very simple yet powerful scripting language: the syntax
is defined by just eleven rules. On occasion this simplicity means
is defined by just eleven rules. On occasion this simplicity means
that Tcl’s behaviour is subtly different from other languages,
that Tcl’s behaviour is subtly different from other languages,
which can confuse newcomers.
which can confuse newcomers.
When the Tcl interpreter is passed some data such as puts
When the Tcl interpreter is passed some data such as puts
Hello, it splits this data into a command and its
Hello, it splits this data into a command and its
arguments. The command will be terminated by a newline or by a semicolon,
arguments. The command will be terminated by a newline or by a semicolon,
unless one of the quoting mechanisms is used. The command and each
unless one of the quoting mechanisms is used. The command and each
of its arguments are separated by white space. So in the following
of its arguments are separated by white space. So in the following
example:
example:
puts Hello
puts Hello
set x 42 
set x 42 
will result in two separate commands being executed. The first
will result in two separate commands being executed. The first
command is puts and is passed a
command is puts and is passed a
single argument, Hello. The second
single argument, Hello. The second
command is set and is passed two
command is set and is passed two
arguments, x and 42.
arguments, x and 42.
The intervening newline character serves to terminate the first
The intervening newline character serves to terminate the first
command, and a semi-colon separator could be used instead: 
command, and a semi-colon separator could be used instead: 
puts Hello;set x 42
puts Hello;set x 42
Any white space surrounding the semicolon is just ignored
Any white space surrounding the semicolon is just ignored
because it does not serve to separate arguments.
because it does not serve to separate arguments.
Now consider the following:
Now consider the following:
set x Hello world
set x Hello world
This is not valid Tcl. It is an attempt to invoke the set command
This is not valid Tcl. It is an attempt to invoke the set command
with three arguments: x, Hello,
with three arguments: x, Hello,
and world. The set only
and world. The set only
takes two arguments, a variable name and a value, so it is necessary
takes two arguments, a variable name and a value, so it is necessary
to combine the data into a single argument by quoting:
to combine the data into a single argument by quoting:
set x “Hello world”
set x “Hello world”
When the Tcl interpreter encounters the first quote character
When the Tcl interpreter encounters the first quote character
it treats all subsequent data up to but not including the closing
it treats all subsequent data up to but not including the closing
quote as part of the current argument. The quote marks are removed
quote as part of the current argument. The quote marks are removed
by the interpreter, so the second argument passed to the set command
by the interpreter, so the second argument passed to the set command
is just Hello world without the
is just Hello world without the
quote characters. This can be significant in the context of eCos savefiles.
quote characters. This can be significant in the context of eCos savefiles.
For instance, consider the following configuration option:
For instance, consider the following configuration option:
cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {
cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {
# Flavor: data
# Flavor: data
# No user value, uncomment the following line to provide one.
# No user value, uncomment the following line to provide one.
# user_value “\”/dev/ttydiag\””
# user_value “\”/dev/ttydiag\””
# value_source default
# value_source default
# Default value: “\”/dev/ttydiag\””
# Default value: “\”/dev/ttydiag\””
};
};
The desired value of the configuration option should be a
The desired value of the configuration option should be a
valid C string, complete with quote characters. If the savefile
valid C string, complete with quote characters. If the savefile
was edited to: 
was edited to: 
cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {
cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {
# Flavor: data
# Flavor: data
user_value “/dev/ttydiag”
user_value “/dev/ttydiag”
# value_source default
# value_source default
# Default value: “\”/dev/ttydiag\””
# Default value: “\”/dev/ttydiag\””
};
};
then the Tcl interpreter would remove the quote marks when
then the Tcl interpreter would remove the quote marks when
the savefile is read back in, so the option’s value would
the savefile is read back in, so the option’s value would
not have any quote marks and would not be a valid C string. The
not have any quote marks and would not be a valid C string. The
configuration system is not yet able to perform the required validation
configuration system is not yet able to perform the required validation
so the following #define would
so the following #define would
be generated in the configuration header file:
be generated in the configuration header file:
#define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE /dev/ttydiag 
#define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE /dev/ttydiag 
This is likely to cause a compile-time failure when building
This is likely to cause a compile-time failure when building
eCos.
eCos.
A quoted argument continues until the closing quote character
A quoted argument continues until the closing quote character
is encountered, which means that it can span multiple lines. This
is encountered, which means that it can span multiple lines. This
can also be encountered in eCos savefiles, for instance, in the CYGDAT_UITRON_MEMPOOLVAR_EXTERNS example
can also be encountered in eCos savefiles, for instance, in the CYGDAT_UITRON_MEMPOOLVAR_EXTERNS example
mentioned earlier. Newline or semicolon characters do not terminate
mentioned earlier. Newline or semicolon characters do not terminate
the current command in such cases.
the current command in such cases.
The Tcl interpreter supports much the same forms of backslash
The Tcl interpreter supports much the same forms of backslash
substitution as other common programming languages. Some backslash
substitution as other common programming languages. Some backslash
sequences such as \n will
sequences such as \n will
be replaced by the appropriate character. The sequence \\ will
be replaced by the appropriate character. The sequence \\ will
be replaced by a single backslash. A backslash at the very end of
be replaced by a single backslash. A backslash at the very end of
a line will cause that backslash, the newline character, and any
a line will cause that backslash, the newline character, and any
white space at the start of the next line to be replaced by a single
white space at the start of the next line to be replaced by a single
space. Hence the following two Tcl commands are equivalent:
space. Hence the following two Tcl commands are equivalent:
puts  “Hello\nworld\n”
puts  “Hello\nworld\n”
puts \
puts \
“Hello
“Hello
world
world
In addition to quote and backslash characters, the Tcl interpreter
In addition to quote and backslash characters, the Tcl interpreter
treats square brackets, the $ character,
treats square brackets, the $ character,
and braces specially. Square brackets are used for command substitution,
and braces specially. Square brackets are used for command substitution,
for example:
for example:
puts “The answer is [expr 6 * 9]”
puts “The answer is [expr 6 * 9]”
When the Tcl interpreter encounters the square brackets it
When the Tcl interpreter encounters the square brackets it
will treat the contents as another command that should be executed
will treat the contents as another command that should be executed
first, and the result of executing that is used when continuing
first, and the result of executing that is used when continuing
to process the script. In this case the Tcl interpreter will execute
to process the script. In this case the Tcl interpreter will execute
the command expr 6 * 9,
the command expr 6 * 9,
yielding a result of 54, and then the Tcl interpreter will execute
yielding a result of 54, and then the Tcl interpreter will execute
puts “The answer is 54”. It should be noted that
puts “The answer is 54”. It should be noted that
the interpreter contains only one level of substitution: if the
the interpreter contains only one level of substitution: if the
result of performing command substitution performs further special
result of performing command substitution performs further special
characters such as square brackets then these will not be treated
characters such as square brackets then these will not be treated
specially.
specially.
Command line substitution is very unlikely to prove useful
Command line substitution is very unlikely to prove useful
in the context of an eCos savefile, but it is part of the Tcl language
in the context of an eCos savefile, but it is part of the Tcl language
and hence cannot be easily suppressed while reading in a savefile.
and hence cannot be easily suppressed while reading in a savefile.
As a result care has to be taken when savefile data involves square
As a result care has to be taken when savefile data involves square
brackets. Consider the following:
brackets. Consider the following:
cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
     ...
     ...
     user_value \
     user_value \
“static char fpool1[ 2000 ],
“static char fpool1[ 2000 ],
fpool2[ 2000 ];”
fpool2[ 2000 ];”
     ...
     ...
};
};
The Tcl interpreter will interpret the square brackets as
The Tcl interpreter will interpret the square brackets as
an attempt at command substitution and hence it will attempt to
an attempt at command substitution and hence it will attempt to
execute the command 2000 with no
execute the command 2000 with no
arguments. No such command is defined by the Tcl language or by
arguments. No such command is defined by the Tcl language or by
the savefile-related extensions provided by the configuration system,
the savefile-related extensions provided by the configuration system,
so this will result in an error when an attempt is made to read
so this will result in an error when an attempt is made to read
back the savefile. Instead it is necessary to backslash-escape the
back the savefile. Instead it is necessary to backslash-escape the
square brackets and thus suppress command substitution:
square brackets and thus suppress command substitution:
cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
     ...
     ...
     user_value \
     user_value \
“static char fpool1\[ 2000 \],
“static char fpool1\[ 2000 \],
fpool2\[ 2000 \];”
fpool2\[ 2000 \];”
     ...
     ...
}; 
}; 
Similarly the $ character
Similarly the $ character
is used in Tcl scripts to perform variable substitution:
is used in Tcl scripts to perform variable substitution:
set x [expr 6 * 9]
set x [expr 6 * 9]
puts “The answer is $x” 
puts “The answer is $x” 
Variable substitution, like command substitution, is very
Variable substitution, like command substitution, is very
unlikely to prove useful in the context of an eCos savefile. Should
unlikely to prove useful in the context of an eCos savefile. Should
it be necessary to have a $ character
it be necessary to have a $ character
in configuration data then again a backslash escape needs to be
in configuration data then again a backslash escape needs to be
used.
used.
cdl_option FOODAT_MONITOR_PROMPT {
cdl_option FOODAT_MONITOR_PROMPT {
     ...
     ...
     user_value “\$ “
     user_value “\$ “
     ...
     ...
};
};
Braces are used to collect a sequence of characters into a
Braces are used to collect a sequence of characters into a
single argument, just like quotes. The difference is that variable,
single argument, just like quotes. The difference is that variable,
command and backslash substitution do not occur inside braces (with
command and backslash substitution do not occur inside braces (with
the sole exception of backslash substitution at the end of a line).
the sole exception of backslash substitution at the end of a line).
So, for example, the CYGDAT_UITRON_MEMPOOL_EXTERNFIXED_EXTERNS value
So, for example, the CYGDAT_UITRON_MEMPOOL_EXTERNFIXED_EXTERNS value
could be written as:
could be written as:
cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {
     ...
     ...
     user_value \
     user_value \
{static char fpool1[ 2000 ],
{static char fpool1[ 2000 ],
fpool2[ 2000 ];}
fpool2[ 2000 ];}
     ...
     ...
};
};
The configuration system does not use this when generating
The configuration system does not use this when generating
savefiles because for simple edits of a savefile by inexperienced
savefiles because for simple edits of a savefile by inexperienced
users the use of brace characters is likely to be a little bit more
users the use of brace characters is likely to be a little bit more
confusing than the use of quotes.
confusing than the use of quotes.
At this stage it is worth noting that the basic format of
At this stage it is worth noting that the basic format of
each configuration option in the savefile makes use of braces:
each configuration option in the savefile makes use of braces:
cdl_option <name> {
cdl_option <name> {
     ...
     ...
};
};
The configuration system extends the Tcl language with a small
The configuration system extends the Tcl language with a small
number of additional commands such as cdl_option.
number of additional commands such as cdl_option.
These commands take two arguments, a name and a body, where the
These commands take two arguments, a name and a body, where the
body consists of all the text between the braces. First a check
body consists of all the text between the braces. First a check
is made that the specified option is actually present in the configuration.
is made that the specified option is actually present in the configuration.
Then the body is executed in a recursive invocation of the Tcl interpreter,
Then the body is executed in a recursive invocation of the Tcl interpreter,
this time with additional commands such as user_value and value_source.
this time with additional commands such as user_value and value_source.
If, after editing, the braces are not correctly matched up then
If, after editing, the braces are not correctly matched up then
the savefile will no longer be a valid Tcl script and errors will
the savefile will no longer be a valid Tcl script and errors will
be reported when the savefile is loaded again.
be reported when the savefile is loaded again.
Comments in Tcl scripts are introduced by a hash character #.
Comments in Tcl scripts are introduced by a hash character #.
However, a hash character only introduces a comment if it occurs
However, a hash character only introduces a comment if it occurs
where a command is expected. Consider the following:
where a command is expected. Consider the following:
# This is a comment
# This is a comment
puts “Hello” # world 
puts “Hello” # world 
The first line is a valid comment, since the hash character
The first line is a valid comment, since the hash character
occurs right at the start where a command name is expected. The
occurs right at the start where a command name is expected. The
second line does not contain a comment. Instead it is an attempt
second line does not contain a comment. Instead it is an attempt
to invoke the puts command with
to invoke the puts command with
three arguments: Hello, # and world.
three arguments: Hello, # and world.
These are not valid arguments for the puts command
These are not valid arguments for the puts command
so an error will be raised.
so an error will be raised.
If the second line was rewritten as:
If the second line was rewritten as:
puts “Hello”; # world
puts “Hello”; # world
then this is a valid Tcl script. The semicolon identifies
then this is a valid Tcl script. The semicolon identifies
the end of the current command, so the hash character occurs at
the end of the current command, so the hash character occurs at
a point where the next command would start and hence it is interpreted
a point where the next command would start and hence it is interpreted
as the start of a comment.
as the start of a comment.
This handling of comments can lead to subtle behaviour. Consider
This handling of comments can lead to subtle behaviour. Consider
the following:
the following:
cdl_option WHATEVER {
cdl_option WHATEVER {
     # This is a comment }
     # This is a comment }
     user_value 42
     user_value 42
     ...
     ...
}
}
Consider the way the Tcl interpreter processes this. The command
Consider the way the Tcl interpreter processes this. The command
name and the first argument do not pose any special difficulties.
name and the first argument do not pose any special difficulties.
The opening brace is interpreted as the start of the next argument,
The opening brace is interpreted as the start of the next argument,
which continues until a closing brace is encountered. In this case
which continues until a closing brace is encountered. In this case
the closing brace occurs on the second line, so the second argument
the closing brace occurs on the second line, so the second argument
passed to cdl_option is \n # This is a comment . This second argument
passed to cdl_option is \n # This is a comment . This second argument
is processed in a recursive invocation of the Tcl interpreter and
is processed in a recursive invocation of the Tcl interpreter and
does not contain any commands, just a comment. Toplevel savefile
does not contain any commands, just a comment. Toplevel savefile
processing then resumes, and the next command that is encountered
processing then resumes, and the next command that is encountered
is user_value. Since the
is user_value. Since the
relevant savefile code is not currently processing a configuration
relevant savefile code is not currently processing a configuration
option this is an error. Later on the Tcl interpreter would encounter
option this is an error. Later on the Tcl interpreter would encounter
a closing brace by itself, which is also an error. Fortunately this
a closing brace by itself, which is also an error. Fortunately this
sequence of events is very unlikely to occur when editing generated
sequence of events is very unlikely to occur when editing generated
savefiles.
savefiles.
This should be sufficient information about Tcl to allow for
This should be sufficient information about Tcl to allow for
safe editing of eCos savefiles. Further information is available
safe editing of eCos savefiles. Further information is available
from a wide variety of sources, for example the book Tcl
from a wide variety of sources, for example the book Tcl
and the Tk Toolkit by John K Ousterhout.
and the Tk Toolkit by John K Ousterhout.
Editing the Sources
Editing the Sources
For many users, controlling the packages and
For many users, controlling the packages and
          manipulating the available configuration options will be
          manipulating the available configuration options will be
          sufficient to create an embedded operating system that meets
          sufficient to create an embedded operating system that meets
          the application's requirements. However, since eCos is
          the application's requirements. However, since eCos is
          shipped entirely in source form, it is possible to go
          shipped entirely in source form, it is possible to go
          further when necessary: you can edit the eCos sources themselves. This requires some
           -->sources themselves. This requires some
          understanding of the way the eCos build system works.
          understanding of the way the eCos build system works.
        
        
The most obvious place to edit the source code is directly
The most obvious place to edit the source code is directly
in the component repository. For example, you could
in the component repository. For example, you could
edit the file kernel/&Version;/src/sync/mutex.cxx
edit the file kernel/&Version;/src/sync/mutex.cxx
to change the way kernel mutexes work, or possibly just to add some
to change the way kernel mutexes work, or possibly just to add some
extra diagnostics or assertions. Once the file has been edited,
extra diagnostics or assertions. Once the file has been edited,
it is possible to invoke make at
it is possible to invoke make at
the top level of the build tree and the target library will be rebuilt
the top level of the build tree and the target library will be rebuilt
as required. A small optimization is possible: the build tree is
as required. A small optimization is possible: the build tree is
largely a mirror of the component repository, so it too will contain
largely a mirror of the component repository, so it too will contain
a subdirectory kernel/&Version;;
a subdirectory kernel/&Version;;
if make is invoked in this directory
if make is invoked in this directory
then it will only check for changes to the kernel sources, which
then it will only check for changes to the kernel sources, which
is a bit more efficient than checking for changes throughout the component
is a bit more efficient than checking for changes throughout the component
repository. 
repository. 
Editing a file in the component repository is fine if this
Editing a file in the component repository is fine if this
tree is used for only one eCos configuration. If the repository
tree is used for only one eCos configuration. If the repository
is used for several different configurations, however, and especially
is used for several different configurations, however, and especially
if it is shared by multiple users, then making what may be experimental
if it is shared by multiple users, then making what may be experimental
changes to the master sources would be a bad idea. The build system provides
changes to the master sources would be a bad idea. The build system provides
an alternative. It is possible to make a copy of the file in the
an alternative. It is possible to make a copy of the file in the
build tree, in other words copy mutex.cxx from
build tree, in other words copy mutex.cxx from
the kernel/&Version;/src/sync directory
the kernel/&Version;/src/sync directory
in the component repository to kernel/&Version;/src/sync in
in the component repository to kernel/&Version;/src/sync in
the build tree, and edit the file in the build tree. When make is
the build tree, and edit the file in the build tree. When make is
invoked it will pick up local copies of any of the sources in preference
invoked it will pick up local copies of any of the sources in preference
to the master versions in the component repository. Once you have
to the master versions in the component repository. Once you have
finished modifying the eCos sources you can install the final version
finished modifying the eCos sources you can install the final version
back in the component repository. If the changes were temporary
back in the component repository. If the changes were temporary
in nature and only served to aid the debugging process, then you
in nature and only served to aid the debugging process, then you
can discard the modified version of the sources. 
can discard the modified version of the sources. 
The situation is slightly more complicated for the header
The situation is slightly more complicated for the header
files that a package may export, such as the C library’s stdio.h header
files that a package may export, such as the C library’s stdio.h header
file, which can be found in the directory language/c/libc/&Version;/include.
file, which can be found in the directory language/c/libc/&Version;/include.
If such a header file is changed, either directly in the component
If such a header file is changed, either directly in the component
repository or after copying it to the build tree, then make must
repository or after copying it to the build tree, then make must
be invoked at the top level of the build tree. In cases like this
be invoked at the top level of the build tree. In cases like this
it is not safe to rebuild just the C library because other packages
it is not safe to rebuild just the C library because other packages
may depend on the contents of stdio.h. 
may depend on the contents of stdio.h. 
Modifying the Memory Layout
Modifying the Memory Layout
Each eCos platform package is supplied with linker script
Each eCos platform package is supplied with linker script
fragments which describe the location of memory regions on the evaluation
fragments which describe the location of memory regions on the evaluation
board and the location of memory sections within these regions.
board and the location of memory sections within these regions.
The correct linker script fragment is selected and included in the
The correct linker script fragment is selected and included in the
eCos linker script target.ld when
eCos linker script target.ld when
eCos is built.
eCos is built.
It is not necessary to modify the default memory
It is not necessary to modify the default memory
layouts in order to start development with eCos. However, it will
layouts in order to start development with eCos. However, it will
be necessary to edit a linker script fragment when the memory map
be necessary to edit a linker script fragment when the memory map
of the evaluation board is changed. For example, if additional memory
of the evaluation board is changed. For example, if additional memory
is added, the linker must be notified that the new memory is available
is added, the linker must be notified that the new memory is available
for use. As a minimum, this would involve modifying the length of
for use. As a minimum, this would involve modifying the length of
the corresponding memory region. Where the available memory is non-contiguous,
the corresponding memory region. Where the available memory is non-contiguous,
it may be necessary to declare a new memory region and reassign
it may be necessary to declare a new memory region and reassign
certain linker output sections to the new region.
certain linker output sections to the new region.
Linker script fragments and memory layout header files should
Linker script fragments and memory layout header files should
be edited within the eCos install tree. They are
be edited within the eCos install tree. They are
located at include/pkgconf/mlt_*.*.
located at include/pkgconf/mlt_*.*.
Where multiple start-up types are in use, it will be necessary to
Where multiple start-up types are in use, it will be necessary to
edit multiple linker script fragments and header files. The information
edit multiple linker script fragments and header files. The information
provided in the header file and the corresponding linker script
provided in the header file and the corresponding linker script
fragment must always match. A typical linker script fragment is
fragment must always match. A typical linker script fragment is
shown below:
shown below:
<productname>eCos</productname> linker script fragment
<productname>eCos</productname> linker script fragment
MEMORY
MEMORY
{
{
 rom : ORIGIN = 0x40000000, LENGTH = 0x80000
 rom : ORIGIN = 0x40000000, LENGTH = 0x80000
 ram : ORIGIN = 0x48000000, LENGTH = 0x200000
 ram : ORIGIN = 0x48000000, LENGTH = 0x200000
}
}
SECTIONS
SECTIONS
{
{
 SECTIONS_BEGIN
 SECTIONS_BEGIN
 SECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA)
 SECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA)
 SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
 SECTION_data (ram, 0x48000000, FOLLOWING (.gcc_except_table))
 SECTION_data (ram, 0x48000000, FOLLOWING (.gcc_except_table))
 SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
 SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
 SECTIONS_END
 SECTIONS_END
}
}
The file consists of two blocks, the MEMORY block
The file consists of two blocks, the MEMORY block
contains lines describing the address (ORIGIN)
contains lines describing the address (ORIGIN)
and the size (LENGTH) of each memory
and the size (LENGTH) of each memory
region. The MEMORY block is followed
region. The MEMORY block is followed
by the SECTIONS block which contains
by the SECTIONS block which contains
lines describing each of the linker output sections. Each section
lines describing each of the linker output sections. Each section
is represented by a macro call. The arguments of these macros are
is represented by a macro call. The arguments of these macros are
ordered as follows: 
ordered as follows: 
The memory region in which the section will finally
The memory region in which the section will finally
              reside.
              reside.
The final address (
The final address (
VMA
VMA
) of the section. This is expressed using one of the following forms:
) of the section. This is expressed using one of the following forms:
n
n
at the absolute address specified by the
at the absolute address specified by the
                    unsigned integer n
                    unsigned integer n
ALIGN (n)
ALIGN (n)
following the final location of the previous section
following the final location of the previous section
                    with alignment to the next n-byte
                    with alignment to the next n-byte
                    boundary
                    boundary
The initial address (LMA)
The initial address (LMA)
              of the section. This is expressed using one of the
              of the section. This is expressed using one of the
              following forms:
              following forms:
LMA_EQ_VMA
LMA_EQ_VMA
the LMA
the LMA
                    equals the VMA (no relocation)
                    equals the VMA (no relocation)
AT (n)
AT (n)
at the absolute address specified by the
at the absolute address specified by the
                    unsigned integer n
                    unsigned integer n
FOLLOWING (.name)
FOLLOWING (.name)
following the initial location of section
following the initial location of section
                    name
                    name
In order to maintain compatibility with linker script
In order to maintain compatibility with linker script
          fragments and header files exported by the
          fragments and header files exported by the
          eCos Configuration Tool, the use
          eCos Configuration Tool, the use
          of other expressions within these files is not
          of other expressions within these files is not
          recommended.
          recommended.
Note that the names of the linker output sections will vary
Note that the names of the linker output sections will vary
between target architectures. A description of these sections can
between target architectures. A description of these sections can
be found in the specific GCC documentation for
be found in the specific GCC documentation for
your architecture.
your architecture.
Managing the <!-- <index></index> -->Package Repository
Managing the <!-- <index></index> -->Package Repository
A source distribution of eCos consists of a number of
A source distribution of eCos consists of a number of
        packages, such as the kernel, the C library, and the
        packages, such as the kernel, the C library, and the
        µITRON subsystems. These are
        µITRON subsystems. These are
        individually versioned in the tree structure of the source
        individually versioned in the tree structure of the source
        code, to support distribution on a per-package basis and to
        code, to support distribution on a per-package basis and to
        support third party packages whose versioning systems might be
        support third party packages whose versioning systems might be
        different. The eCos Package
        different. The eCos Package
          Administration Tool is used to manage the
          Administration Tool is used to manage the
        installation and removal of packages from a variety of sources
        installation and removal of packages from a variety of sources
        with potentially multiple versions.
        with potentially multiple versions.
The presence of the version information in the source tree
The presence of the version information in the source tree
        structure might be a hindrance to the use of a separate source
        structure might be a hindrance to the use of a separate source
        control system such as CVS or
        control system such as CVS or
        SourceSafe. To work
        SourceSafe. To work
        in this way, you can rename all the version components to some
        in this way, you can rename all the version components to some
        common name (such as “current”) thus unifying the
        common name (such as “current”) thus unifying the
        structure of source trees from distinct eCos releases.
        structure of source trees from distinct eCos releases.
The eCos build system will treat any such name as just another
The eCos build system will treat any such name as just another
version of the package(s), and support building in exactly the same
version of the package(s), and support building in exactly the same
way. However, performing this rename invalidates any existing build
way. However, performing this rename invalidates any existing build
trees that referred to the versioned source tree, so do the rename
trees that referred to the versioned source tree, so do the rename
first, before any other work, and do a complete rebuild afterwards.
first, before any other work, and do a complete rebuild afterwards.
Package Installation
Package Installation
Package installation and removal is performed using the
Package installation and removal is performed using the
          eCos Package Administration Tool. This
          eCos Package Administration Tool. This
          tool is a Tcl script named
          tool is a Tcl script named
        ecosadmin.tcl which allows
        ecosadmin.tcl which allows
          the user to add new eCos packages and new versions of
          the user to add new eCos packages and new versions of
          existing packages to an eCos repository. Such packages must
          existing packages to an eCos repository. Such packages must
          be distributed as a single file in the eCos package
          be distributed as a single file in the eCos package
          distribution format. Unwanted packages may also be removed
          distribution format. Unwanted packages may also be removed
          from the repository using this tool. A graphical version of
          from the repository using this tool. A graphical version of
          the tool is provided as part of the
          the tool is provided as part of the
          eCos Configuration Tool.
          eCos Configuration Tool.
Using the Administration Tool The graphical
Using the Administration Tool The graphical
version of the eCos Package
version of the eCos Package
Administration Tool, provided as part of the
Administration Tool, provided as part of the
eCos Configuration
eCos Configuration
Tool, provides functions equivalent to the command-line
Tool, provides functions equivalent to the command-line
version for those who prefer a Windows-based interface.
version for those who prefer a Windows-based interface.
It may be invoked in one of two ways:
It may be invoked in one of two ways:
from the start menu (by default
from the start menu (by default
                Start->Programs->
                Start->Programs->
                  eCos->Package Administration
                  eCos->Package Administration
                  Tool)
                  Tool)
-->
from the eCos Configuration
from the eCos Configuration
                  Tool via the
                  Tool via the
                Tools->Administration
                Tools->Administration
                menu item
                menu item
The main window of the tool displays the packages which are
The main window of the tool displays the packages which are
currently installed in the form of a tree. The installed versions
currently installed in the form of a tree. The installed versions
of each package may be examined by expanding the tree.
of each package may be examined by expanding the tree.
Packages may be added to the eCos repository by clicking on
Packages may be added to the eCos repository by clicking on
the Add button. The eCos package distribution
the Add button. The eCos package distribution
file to be added is then selected via a File Open dialog
file to be added is then selected via a File Open dialog
box.
box.
Packages may be removed by selecting a package in the tree
Packages may be removed by selecting a package in the tree
and then clicking on the Remove button. If
and then clicking on the Remove button. If
a package node is selected, all versions of the selected package
a package node is selected, all versions of the selected package
will be removed. If a package version node is selected, only the
will be removed. If a package version node is selected, only the
selected version of the package will be removed.
selected version of the package will be removed.
Using the command line
Using the command line
The ecosadmin.tcl
The ecosadmin.tcl
            script is located in the base of the eCos repository. Use
            script is located in the base of the eCos repository. Use
            a command of the following form under versions of
            a command of the following form under versions of
            UNIX:
            UNIX:
$ tclsh ecosadmin.tcl <command>
$ tclsh ecosadmin.tcl <command>
Under Windows, a command of the following form may be used
Under Windows, a command of the following form may be used
at the Cygwin command line prompt:
at the Cygwin command line prompt:
$ cygtclsh80 ecosadmin.tcl <command>
$ cygtclsh80 ecosadmin.tcl <command>
The following commands are available:
The following commands are available:
add <file>
add <file>
Adds the packages contained with the specified package distribution
Adds the packages contained with the specified package distribution
file to the eCos repository and updates the package database accordingly.
file to the eCos repository and updates the package database accordingly.
By convention, eCos package distribution files are given the .epk suffix.
By convention, eCos package distribution files are given the .epk suffix.
remove <package> [ --version=<version> ]
remove <package> [ --version=<version> ]
Removes the specified package from the eCos
Removes the specified package from the eCos
                  repository and updates the package database
                  repository and updates the package database
                  accordingly. Where the optional version qualifier is
                  accordingly. Where the optional version qualifier is
                  used, only the specified version of the package is
                  used, only the specified version of the package is
                  removed.
                  removed.
list
list
Produces a list of the packages which
Produces a list of the packages which
                  are currently installed and their versions. The
                  are currently installed and their versions. The
                  available templates and hardware targets are also
                  available templates and hardware targets are also
                  listed.
                  listed.
Note that is is possible to remove critical packages
Note that is is possible to remove critical packages
            such as the common HAL package using this tool. Users
            such as the common HAL package using this tool. Users
            should take care to avoid such errors since core eCos
            should take care to avoid such errors since core eCos
            packages may only be re-installed in the context of a
            packages may only be re-installed in the context of a
            complete re-installation of eCos.
            complete re-installation of eCos.
Package Structure
Package Structure
The files in an installed eCos source tree are organized in
The files in an installed eCos source tree are organized in
a natural tree structure, grouping together files which work together
a natural tree structure, grouping together files which work together
into Packages. For example, the kernel files
into Packages. For example, the kernel files
are all together in: 
are all together in: 
BASE_DIR/kernel/&Version;/include/
BASE_DIR/kernel/&Version;/include/
            BASE_DIR/kernel/&Version;/src/
            BASE_DIR/kernel/&Version;/src/
        BASE_DIR/kernel/&Version;/tests/
        BASE_DIR/kernel/&Version;/tests/
and µITRON compatibility layer files are in:
and µITRON compatibility layer files are in:
        
        
            BASE_DIR/compat/uitron/&Version;/include/
            BASE_DIR/compat/uitron/&Version;/include/
        BASE_DIR/compat/uitron/&Version;/src/
        BASE_DIR/compat/uitron/&Version;/src/
        BASE_DIR/compat/uitron/&Version;/tests/
        BASE_DIR/compat/uitron/&Version;/tests/
The feature of these names which is of interest here is
The feature of these names which is of interest here is
          the &Version; near the end. It may seem odd to place a version number deep in the
          the &Version; near the end. It may seem odd to place a version number deep in the
          path, rather than having something like
          path, rather than having something like
          BASE_DIR/&Version;/...everything...
          BASE_DIR/&Version;/...everything...
          or leaving it up to you to choose a different
          or leaving it up to you to choose a different
          install-place when a new release of the system arrives.
          install-place when a new release of the system arrives.
        
        
There is a rationale for this organization: as
There is a rationale for this organization: as
          indicated, the kernel and the
          indicated, the kernel and the
          µITRON compatibility subsystem
          µITRON compatibility subsystem
          are examples of software packages. For the first few
          are examples of software packages. For the first few
          releases of eCos, all the packages will move along
          releases of eCos, all the packages will move along
          in step, i.e. Release 1.3.x will feature Version
          in step, i.e. Release 1.3.x will feature Version
          1.3.x of every package, and so forth. But in future,
          1.3.x of every package, and so forth. But in future,
          especially when third party packages become available, it is
          especially when third party packages become available, it is
          intended that the package be the unit of software
          intended that the package be the unit of software
          distribution, so it will be possible to build a system from
          distribution, so it will be possible to build a system from
          a selection of packages with different version numbers, and
          a selection of packages with different version numbers, and
          even differing versioning schemes. A
          even differing versioning schemes. A
          Tcl script ecosadmin.tcl is
          Tcl script ecosadmin.tcl is
          provided in the eCos repository to manage the installation
          provided in the eCos repository to manage the installation
          and removal of packages in this way.
          and removal of packages in this way.
Many users will have their own source code control system,
Many users will have their own source code control system,
version control system or equivalent, and will want to use it with
version control system or equivalent, and will want to use it with
eCos sources. In that case, since a new release of eCos comes with
eCos sources. In that case, since a new release of eCos comes with
different pathnames for all the source files, a bit of work is necessary
different pathnames for all the source files, a bit of work is necessary
to import a new release into your source repository. 
to import a new release into your source repository. 
One way of handling the import is to rename all the version
One way of handling the import is to rename all the version
parts to some common name, for example “current”,
parts to some common name, for example “current”,
and continue to work. “current” is suggested because ecosconfig recognizes
and continue to work. “current” is suggested because ecosconfig recognizes
it and places it first in any list of versions. In the future, we
it and places it first in any list of versions. In the future, we
may provide a tool to help with this, or an option in the install
may provide a tool to help with this, or an option in the install
wizard. Alternatively, in a POSIX shell environment (Linux or Cygwin
wizard. Alternatively, in a POSIX shell environment (Linux or Cygwin
on Windows) use the following command: 
on Windows) use the following command: 
find . -name &Version; -type d -printf 'mv %p %h/current\n' | sh
find . -name &Version; -type d -printf 'mv %p %h/current\n' | sh
Having carried out such a renaming operation, your
Having carried out such a renaming operation, your
          source tree will now look like this: 
          source tree will now look like this: 
BASE_DIR/kernel/current/include/
BASE_DIR/kernel/current/include/
BASE_DIR/kernel/current/src/
BASE_DIR/kernel/current/src/
BASE_DIR/kernel/current/tests/
BASE_DIR/kernel/current/tests/
        ...
        ...
BASE_DIR/compat/uitron/current/include/
BASE_DIR/compat/uitron/current/include/
BASE_DIR/compat/uitron/current/src/
BASE_DIR/compat/uitron/current/src/
BASE_DIR/compat/uitron/current/tests/
BASE_DIR/compat/uitron/current/tests/
        
        
which is a suitable format for import into your own
which is a suitable format for import into your own
          source code control system. When you get a subsequent
          source code control system. When you get a subsequent
          release of eCos, do the same thing and use your own source
          release of eCos, do the same thing and use your own source
          code control system to manage the new source base, by
          code control system to manage the new source base, by
          importing the new version from 
          importing the new version from 
NEW_BASE_DIR/kernel/current/include/
NEW_BASE_DIR/kernel/current/include/
and so on. 
and so on. 
The eCos build tool will now offer only the
The eCos build tool will now offer only the
          “current” version of each package; select this
          “current” version of each package; select this
          for the packages you wish to use. 
          for the packages you wish to use. 
Making such a change has implications for any build
Making such a change has implications for any build
          trees you already have in use. A configured build tree
          trees you already have in use. A configured build tree
          contains information about the selected packages and their
          contains information about the selected packages and their
          selected versions. Changing the name of the
          selected versions. Changing the name of the
          “versioning” folder in the source tree
          “versioning” folder in the source tree
          invalidates this information, and in consequence it also
          invalidates this information, and in consequence it also
          invalidates any local configuration options you have set up
          invalidates any local configuration options you have set up
          in this build tree. So if you want to change the version
          in this build tree. So if you want to change the version
          information in the source tree, do it first, before
          information in the source tree, do it first, before
          investing any serious time in configuring and building your
          investing any serious time in configuring and building your
          system. When you create a new build tree to deal with the
          system. When you create a new build tree to deal with the
          new source layout, it will contain default settings for all
          new source layout, it will contain default settings for all
          the configuration options, just like the old build tree did
          the configuration options, just like the old build tree did
          before you configured it. You will need to redo that
          before you configured it. You will need to redo that
          configuration work in the new tree. 
          configuration work in the new tree. 
Moving source code around also invalidates debugging information
Moving source code around also invalidates debugging information
in any programs or libraries built from the old tree; these will
in any programs or libraries built from the old tree; these will
need to be rebuilt. 
need to be rebuilt. 
-->
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.