📄 editing-an-ecos-savefile.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. -->
<!-- This material may be distributed only subject to the terms -->
<!-- and conditions set forth in the Open Publication License, v1.0 -->
<!-- or later (the latest version is presently available at -->
<!-- http://www.opencontent.org/openpub/). -->
<!-- Distribution of the work or derivative of the work in any -->
<!-- standard (paper) book form is prohibited unless prior -->
<!-- permission is obtained from the copyright holder. -->
<HTML
><HEAD
><TITLE
>Editing an eCos Savefile</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="eCos User Guide"
HREF="ecos-user-guide.html"><LINK
REL="UP"
TITLE="Manual Configuration"
HREF="manual-configuration.html"><LINK
REL="PREVIOUS"
TITLE="Fine-grained Configuration"
HREF="fine-grained-configuration.html"><LINK
REL="NEXT"
TITLE="Editing the Sources"
HREF="editing-the-sources.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>eCos User Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="fine-grained-configuration.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 28. Manual Configuration</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="editing-the-sources.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="EDITING-AN-ECOS-SAVEFILE">Editing an <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> Savefile</H1
><P
>The <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> configuration information is held in a single
savefile, typically <TT
CLASS="FILENAME"
>ecos.ecc</TT
>, which can
be generated by either the GUI configuration tool or by the
command line <B
CLASS="COMMAND"
>ecosconfig</B
> tool. The file
normally exists at the top level of the build tree. It is a
text file, allowing the various configurations options to be
edited inside a suitable text editor or by other programs or
scripts, as well as in the GUI config tool.</P
><P
>An <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> savefile is actually a script in the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Tcl</I
></SPAN
> programming
language, so any modifications to the file need to preserve Tcl
syntax. For most configuration options, any modifications will be
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
options, for example<TT
CLASS="LITERAL"
> CYGDAT_UITRON_TASK_EXTERNS</TT
>,
which involves some lines of C code, more care has
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
for further processing, for example to generate a build tree. An
outline of Tcl syntax is given below. One point worth noting here
is that a line that begins with a “#” is
usually a comment, and the bulk of an <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> savefile actually consists
of such comments, to make it easier to edit.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN2719">Header</H2
><P
>An <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> savefile begins with a header, which typically
looks something like this:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
># eCos saved configuration
# ---- commands --------------------------------------------------------
# This section contains information about the savefile format.
# It should not be edited. Any modifications made to this section
# may make it impossible for the configuration tools to read
# the savefile.
cdl_savefile_version 1;
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command
cdl_configuration { description hardware template package };
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_option { value_source user_value wizard_value inferred_value };
cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
</PRE
></TD
></TR
></TABLE
><P
>This section of the savefile is intended for use by the
configuration system, and should not be edited. If this
section is edited then the various configuration tools may no
longer be able to read in the modified savefile.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN2725">Toplevel Section</H2
><P
>The header is followed by a section that defines the
configuration as a whole. A typical example would
be:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
># ---- toplevel --------------------------------------------------------
# This section defines the toplevel configuration object. The only
# values that can be changed are the name of the configuration and
# the description field. It is not possible to modify the target,
# the template or the set of packages simply by editing the lines
# below because these changes have wide-ranging effects. Instead
# the appropriate tools should be used to make such modifications.
cdl_configuration eCos {
description ““ ;
# These fields should not be modified.
hardware pid ;
template uitron ;
package -hardware CYGPKG_HAL_ARM current ;
package -hardware CYGPKG_HAL_ARM_PID current ;
package -hardware CYGPKG_IO_SERIAL current ;
package -template CYGPKG_HAL current ;
package -template CYGPKG_IO current ;
package -template CYGPKG_INFRA current ;
package -template CYGPKG_KERNEL current ;
package -template CYGPKG_UITRON current ;
package -template CYGPKG_LIBC current ;
package -template CYGPKG_LIBM current ;
package -template CYGPKG_DEVICES_WALLCLOCK current ;
package -template CYGPKG_ERROR current ;
};
</PRE
></TD
></TR
></TABLE
><P
>This section allows the configuration tools to reload the
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
to remove an existing one then the appropriate tools should be used
for this, for example:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>$ ecosconfig remove CYGPKG_LIBM</PRE
></TD
></TR
></TABLE
><P
>There are two fields which can be edited. Configurations have
a name; in this case <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
>. They can also have a description, which
is some arbitrary text. The configuration tools do not make use
of these fields, they exist so that users can store additional information
about a configuration.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN2733">Conflicts Section</H2
><P
>The toplevel section is followed by details of all the
conflicts (if any) in the configuration, for
example:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
># ---- conflicts -------------------------------------------------------
# There are 2 conflicts.
#
# option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET
# Property LegalValues
# Illegal current value 100000
# Legal values are: -90000 to 90000
#
# option CYGSEM_LIBC_TIME_CLOCK_WORKING
# Property Requires
# Requires constraint not satisfied: CYGFUN_KERNEL_THREADS_TIMER
</PRE
></TD
></TR
></TABLE
><P
>When editing a configuration you may end up with something
that is invalid. Any problems in the configuration will be reported
in the conflicts section. In this case there are two conflicts.
The option <TT
CLASS="LITERAL"
>CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET</TT
> has
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
the value. The second conflict is more interesting, an unsatisfied <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>requires</I
></SPAN
> constraint.
Configuration options are not independent: disabling some functionality
in, say, the kernel, can have an impact elsewhere; in this case
the C library. The various dependencies between the options are
specified by the component developers and checked by the configuration
system. In this case there are two obvious ways in which the conflict could
be resolved: re-enabling <TT
CLASS="LITERAL"
>CYGFUN_KERNEL_THREADS_TIMER</TT
>,
or disabling <TT
CLASS="LITERAL"
>CYGSEM_LIBC_TIME_CLOCK_WORKING</TT
>.
Both of these options will be listed later on in the file.</P
><P
>Some care has to be taken when modifying configuration options,
to avoid introducing new conflict. For instance it is possible that
there might be other options in the system which have a dependency
on <TT
CLASS="LITERAL"
>CYGSEM_LIBC_TIME_CLOCK_WORKING</TT
>,
so disabling that option may not be the best way to resolve the
conflict. Details of all such dependencies are provided in the appropriate
places in the savefile.</P
><P
>It is not absolutely required that a configuration be conflict-free
before generating a build tree and building <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
>. It is up to the
developers of each component to decide what would happen if an attempt
is made to build <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> while there are still conflicts. In serious
cases there is likely to be a compile-time failure, or possibly
a link-time failure. In less serious cases the system may build
happily and the application can be linked with the resulting library,
but the component may not quite function as intended - although
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
a while the system will unaccountably crash. Using a configuration
that still has conflicts is done entirely at the user’s
risk.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN2747">Data Section</H2
><P
>The bulk of the savefile lists the various packages,
components, and options, including their values and the
various dependencies. A number of global options come
first, especially those related to the build process such
as compiler flags. These are followed by the various
packages, and the components and options within those
packages, in order.</P
><P
>Packages, components and options are organized in a
hierarchy. If a particular component is disabled then all
options and sub-components below it will be inactive: any
changes made to these will have no effect. The savefile
contains information about the hierarchy in the form of
comments, for example:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>cdl_package CYGPKG_KERNEL ...
# >
cdl_component CYGPKG_KERNEL_EXCEPTIONS ...
# >
cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE ...
cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL ...
# <
cdl_component CYGPKG_KERNEL_SCHED ...
# >
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE ...
cdl_option CYGSEM_KERNEL_SCHED_BITMAP ...
# <
# <
</PRE
></TD
></TR
></TABLE
><P
>This corresponds to the following hierarchy:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
> CYGPKG_KERNEL
CYGPKG_KERNEL_EXCEPTIONS
CYGSEM_KERNEL_EXCEPTIONS_DECODE
CYGSEM_KERNEL_EXCEPTIONS_GLOBAL
CYGPKG_KERNEL_SCHED
CYGSEM_KERNEL_SCHED_MLQUEUE
CYGSEM_KERNEL_SCHED_BITMAP
</PRE
></TD
></TR
></TABLE
><P
>Providing the hierarchy information in this way allows
programs or scripts to analyze the savefile and readily
determine the hierarchy. It could also be used by a
sufficiently powerful editor to support structured editing
of <SPAN
CLASS="PRODUCTNAME"
>eCos</SPAN
> savefiles. The information is not used by the
configuration tools themselves since they obtain the
hierarchy from the original CDL scripts.</P
><P
>Each configurable entity is preceded by a comment, of
the following form:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
># Kernel schedulers
# doc: ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER
# The eCos kernel provides a choice of schedulers. In addition
# there are a number of configuration options to control the
# detailed behaviour of these schedulers.
cdl_component CYGPKG_KERNEL_SCHED {
...
};
</PRE
></TD
></TR
></TABLE
><P
>This provides a short textual alias
<TT
CLASS="LITERAL"
>Kernel schedulers</TT
> for the
component. If online documentation is available for the
configurable entity then this will come next. Finally
there is a short description of the entity as a whole. All
this information is provided by the component
developers.</P
><P
>Each configurable entity takes the form:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
><type> <name> {
<data>
};</PRE
></TD
></TR
></TABLE
><P
>Configurable entities may not be active. This can be either
because the parent is disabled or inactive, or because there are
one or more <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>active_if</I
></SPAN
> properties. Modifying
the value of an inactive entity has no effect on the configuration,
so this information is provided first:</P
><P
></P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -