⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editing-an-ecos-savefile.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<!-- 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"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos User Guide"HREF="ecos-user-guide.html"><LINKREL="UP"TITLE="Manual Configuration"HREF="manual-configuration.html"><LINKREL="PREVIOUS"TITLE="Fine-grained Configuration"HREF="fine-grained-configuration.html"><LINKREL="NEXT"TITLE="Editing the Sources"HREF="editing-the-sources.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos User Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="fine-grained-configuration.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 28. Manual Configuration</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="editing-the-sources.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="EDITING-AN-ECOS-SAVEFILE">Editing an <SPANCLASS="PRODUCTNAME">eCos</SPAN> Savefile</H1><P>The <SPANCLASS="PRODUCTNAME">eCos</SPAN> configuration information is held in a single	  savefile, typically <TTCLASS="FILENAME">ecos.ecc</TT>, which can	  be generated by either the GUI configuration tool or by the	  command line <BCLASS="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 <SPANCLASS="PRODUCTNAME">eCos</SPAN> savefile is actually a script in the <SPANCLASS="emphasis"><ICLASS="EMPHASIS">Tcl</I></SPAN> programminglanguage, so any modifications to the file need to preserve Tclsyntax. For most configuration options, any modifications will betrivial and there is no need to worry about Tcl syntax. For example,changing a 1 to a 0 to disable an option.  For more complicatedoptions, for example<TTCLASS="LITERAL"> CYGDAT_UITRON_TASK_EXTERNS</TT>,which involves some lines of C code, more care hasto be taken. If an edited savefile is no longer a valid Tcl scriptthen the configuration tools will be unable to read back the datafor further processing, for example to generate a build tree. Anoutline of Tcl syntax is given below. One point worth noting hereis that a line that begins with a &#8220;#&#8221; isusually a comment, and the bulk of an <SPANCLASS="PRODUCTNAME">eCos</SPAN> savefile actually consistsof such comments, to make it easier to edit.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN2721">Header</H2><P>An <SPANCLASS="PRODUCTNAME">eCos</SPAN> savefile begins with a header, which typically	    looks something like this:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="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><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN2727">Toplevel Section</H2><P>The header is followed by a section that defines the	    configuration as a whole. A typical example would	    be:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="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 &#8220;&#8220; ;         # 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 thevarious packages that make up the configuration. Most of the informationshould not be edited. If it is necessary to add a new package orto remove an existing one then the appropriate tools should be usedfor this, for example:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">$ ecosconfig remove CYGPKG_LIBM</PRE></TD></TR></TABLE><P>There are two fields which can be edited. Configurations havea name; in this case <SPANCLASS="PRODUCTNAME">eCos</SPAN>. They can also have a description, whichis some arbitrary text. The configuration tools do not make useof these fields, they exist so that users can store additional informationabout a configuration.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN2735">Conflicts Section</H2><P>The toplevel section is followed by details of all the	    conflicts (if any) in the configuration, for	    example:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="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 somethingthat is invalid. Any problems in the configuration will be reportedin the conflicts section. In this case there are two conflicts.The option <TTCLASS="LITERAL">CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET</TT> hasbeen given an illegal value: typically this would be fixed by searchingfor the definition of that option later on in the savefile and modifyingthe value. The second conflict is more interesting, an unsatisfied <SPANCLASS="emphasis"><ICLASS="EMPHASIS">requires</I></SPAN> constraint.Configuration options are not independent: disabling some functionalityin, say, the kernel, can have an impact elsewhere; in this casethe C library. The various dependencies between the options arespecified by the component developers and checked by the configurationsystem. In this case there are two obvious ways in which the conflict couldbe resolved: re-enabling <TTCLASS="LITERAL">CYGFUN_KERNEL_THREADS_TIMER</TT>,or disabling <TTCLASS="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 thatthere might be other options in the system which have a dependencyon <TTCLASS="LITERAL">CYGSEM_LIBC_TIME_CLOCK_WORKING</TT>,so disabling that option may not be the best way to resolve theconflict. Details of all such dependencies are provided in the appropriateplaces in the savefile.</P><P>It is not absolutely required that a configuration be conflict-freebefore generating a build tree and building <SPANCLASS="PRODUCTNAME">eCos</SPAN>. It is up to thedevelopers of each component to decide what would happen if an attemptis made to build <SPANCLASS="PRODUCTNAME">eCos</SPAN> while there are still conflicts. In seriouscases there is likely to be a compile-time failure, or possiblya link-time failure. In less serious cases the system may buildhappily and the application can be linked with the resulting library,but the component may not quite function as intended - althoughit may still be good enough for the specific needs of the application.It is also possible that everything builds and links, but once ina while the system will unaccountably crash. Using a configurationthat still has conflicts is done entirely at the user&#8217;srisk.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN2749">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><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">cdl_package CYGPKG_KERNEL ... # &gt; cdl_component CYGPKG_KERNEL_EXCEPTIONS ... # &gt; cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE ... cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL ... # &lt; cdl_component CYGPKG_KERNEL_SCHED ... # &gt; cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE ... cdl_option CYGSEM_KERNEL_SCHED_BITMAP ... # &lt; # &lt; 	  </PRE></TD></TR></TABLE><P>This corresponds to the following hierarchy:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="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 <SPANCLASS="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><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="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	    <TTCLASS="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><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">&lt;type&gt; &lt;name&gt; {     &lt;data&gt;};</PRE></TD></TR></TABLE><P>Configurable entities may not be active. This can be eitherbecause the parent is disabled or inactive, or because there areone or more <SPANCLASS="emphasis"><ICLASS="EMPHASIS">active_if</I></SPAN> properties. Modifyingthe value of an inactive entity has no effect on the configuration,so this information is provided first:</P><P></P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -