URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [sgml/] [user-guide/] [configuration.sgml] - Rev 373
Go to most recent revision | Compare with Previous | Blame | View Log
<!-- {{{ Banner --><!-- =============================================================== --><!-- --><!-- configuration.sgml --><!-- --><!-- eCos User Guide --><!-- --><!-- =============================================================== --><!-- ####COPYRIGHTBEGIN#### --><!-- --><!-- =============================================================== --><!-- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 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 obtained from the copyright holder --><!-- =============================================================== --><!-- --><!-- ####COPYRIGHTEND#### --><!-- =============================================================== --><!-- #####DESCRIPTIONBEGIN#### --><!-- --><!-- ####DESCRIPTIONEND#### --><!-- =============================================================== --><!-- }}} --><PART id="configuration-and-the-package-repository"><TITLE>Configuration and the Package Repository</TITLE><PARTINTRO><PARA>The following chapters contain information on running<COMMAND>ecosconfig</COMMAND> (the command line tool thatmanipulates configurations and constructs build trees) and onmanaging a source repository across multiple versions of<productname>eCos</productname>. </PARA></PARTINTRO><CHAPTER id="manual-configuration"><TITLE>Manual Configuration</TITLE><PARA><productname>eCos</productname> developers will generally use the graphicalConfiguration Tool for configuring an <productname>eCos</productname> system and buildingthe target library. However, some user prefer to use commandline tools. These command line tools can also be used for batchoperations on all platforms, for example as part of a nightlyrebuild and testing procedure.</PARA><PARA>In the current release of the system the command line toolsdo not provide exactly the same functionality as the graphicaltool. Most importantly, there is no facility to resolveconfiguration conflicts interactively.</PARA><PARA>The <productname>eCos</productname> configuration system, both graphical and commandline tools, are under constant development and enhancement.Developers should note that the procedures described may changeconsiderably in future releases. </PARA><SECT1 id="directory-tree-structure"><TITLE>Directory Tree Structure</TITLE><PARA>When building <productname>eCos</productname> there are three main directory trees toconsider: the source tree, the build tree, and the installtree.</PARA><PARA>The source tree, also known as the component repository,is read-only. It is possible to use a single componentrepository for any number of different configurations, andit is also possible to share a component repository betweenmultiple users by putting it on a network drive.</PARA><PARA>The build tree contains everything that is specific to aparticular configuration, including header and other filesthat contain configuration data, and the object files thatresult from compiling the system sources for thisconfiguration. </PARA><PARA>The install tree is usually located in the <filename>install</filename> subdirectoryof the build tree. Once an <productname>eCos</productname> system has been built, the installtree contains all the files needed for application development includingthe header files and the target library. By making copies of theinstall tree after a build it is possible to separate applicationdevelopment and system configuration, which may be desirable forsome organizations. </PARA></SECT1><SECT1 id="creating-build-tree"><TITLE>Creating the Build Tree</TITLE><PARA>Generating a build tree is a non-trivial operation andshould not be attempted manually. Instead, <productname>eCos</productname> is shippedwith a tool called <COMMAND>ecosconfig</COMMAND> that shouldbe used to create a build tree.</PARA><PARA>Usually <command>ecosconfig</command> will berun inside the build tree itself. If you are creating a new buildtree then typically you will create a new empty directory usingthe <command>mkdir</command> command, <command>cd</command> intothat directory, and then invoke <command>ecosconfig</command> tocreate a configuration. By default, the configuration is storedin a file <filename>ecos.ecc</filename> in the currentdirectory. The configuration may be modified by editing this file directly. <command>ecosconfig</command> itselfdeals with a number of coarse-grained configuration options suchas the target platform and the packages that should be used.</PARA><PARA>The <command>ecosconfig</command> tool is alsoused subsequently to generate a build tree for a configuration.Once a build tree exists, it is possible to run <command>ecosconfig</command> againinside the same build tree. This will be necessary if your wishto change some of the configuration options.</PARA><PARA><COMMAND>ecosconfig</COMMAND> does not generatethe top-level directory of the build tree; you must do thisyourself. </PARA><SCREEN>$ mkdir ecos-work$ cd ecos-work</SCREEN><PARA>The next step is to run <COMMAND>ecosconfig</COMMAND>: </PARA><SCREEN>$ ecosconfig <qualifiers> <command></SCREEN><SECT2><TITLE>ecosconfig qualifiers</TITLE><PARA>The available command line qualifiers for<COMMAND>ecosconfig</COMMAND> are as follows. Multiplequalifiers may be used on the command line:</PARA><VARIABLELIST><VARLISTENTRY><TERM><OPTION>--help</OPTION></TERM><LISTITEM><PARA>Provides basic usage guidelines for theavailable commands and qualifiers.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--config=<file></OPTION></TERM><LISTITEM><PARA>Specifies an <productname>eCos</productname> configuration save file foruse by the tool. By default, the file<filename>ecos.ecc</filename> in thecurrent directory is used. Developers may prefer touse a common location for all their <productname>eCos</productname>configurations rather than keep the configurationinformation in the base of the build tree.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--prefix=<dir></OPTION></TERM><LISTITEM><PARA>Specifies an alternative location for theinstall tree. By default, the install tree residesinside the <filename>install</filename>directory in the build tree. Developers may preferto locate the build tree in a temporary filehierarchy but keep the install tree in a morepermanent location.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--srcdir=<dir></OPTION></TERM><LISTITEM><PARA>Specifies the location of the componentrepository. By default, the tool uses the locationspecified in the<REPLACEABLE>ECOS_REPOSITORY</REPLACEABLE>environment variable. Developers may prefer to useof this qualifier if they are working with more thanone repository.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--no-resolve</OPTION></TERM><LISTITEM><PARA>Disables the implicit resolution of conflictswhile manipulating the configuration data.developers may prefer to resolve conflicts byediting the <productname>eCos</productname> configuration save filemanually.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--ignore-errors</OPTION></TERM><TERM><OPTION>-i</OPTION></TERM><LISTITEM><PARA>By default, ecosconfig will exit with an error code if the currentconfiguration contains any conflicts, and it is not possible togenerate or update a build tree for such configurations. Thisqualifier causes ecosconfig to ignore such problems, and hence it ispossible to generate a build tree even if there are stillconflicts. Of course, there are no guarantees that the resultingsystem will actually do anything.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--verbose</OPTION></TERM><TERM><OPTION>-v</OPTION></TERM><LISTITEM><PARA>Display more information.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><OPTION>--quiet</OPTION></TERM><TERM><OPTION>-q</OPTION></TERM><LISTITEM><PARA>Display less information.</PARA></LISTITEM></VARLISTENTRY></VARIABLELIST><PARA>The <OPTION>--config</OPTION>, <OPTION>--prefix</OPTION> and<OPTION>--srcdir</OPTION> qualifiers can also be written with two arguments,for example:</para><SCREEN>ecosconfig --srcdir <REPLACEABLE><dir></REPLACEABLE> ...</SCREEN><para>This simplifies filename completion with some shells.</PARA></SECT2><SECT2><TITLE>ecosconfig commands</TITLE><PARA>The available commands for<COMMAND>ecosconfig</COMMAND> are asfollows:</PARA><VARIABLELIST><VARLISTENTRY><TERM><COMMAND>list</COMMAND></TERM><LISTITEM><PARA>Lists the available packages, targets andtemplates as installed in the <productname>eCos</productname> repository.Aliases and package versions are alsoreported.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>new <target> [<template> [<version>]]</COMMAND></TERM><LISTITEM><PARA>Creates a new <productname>eCos</productname> configuration forthe specified target hardware and saves it. Asoftware template may also be specified. By default,the template named ‘default’ is used. Ifthe template version is not specified, the latestversion is used.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>target <target></COMMAND></TERM><LISTITEM><PARA>Changes the target hardware selectionfor the <productname>eCos</productname> configuration. This has the effect ofunloading packages supporting the target selectedpreviously and loading the packages which supportthe new hardware. This command will be usedtypically when switching between a simulator andreal hardware.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>template <template> [<version>]</COMMAND></TERM><LISTITEM><PARA>Changes the template selection for the <productname>eCos</productname>configuration. This has the effect of unloadingpackages specified by the template selectedpreviously and loading the packages specified by thenew template. By default, the latest version of thespecified template is used.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>remove <packages></COMMAND></TERM><LISTITEM><PARA>Removes the specified packages from the <productname>eCos</productname>configuration. This command will be used typicallywhen the template on which a configuration is basedcontains packages which are not required.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>add <packages></COMMAND></TERM><LISTITEM><PARA>Adds the specified packages to the <productname>eCos</productname> configuration. Thiscommand will be used typically when the template on which aconfiguration is based does not contain all the packages which arerequired.For example, add-on packages provided by third parties willnot be known to the standard templates, so they will have to be addedexplicitly. </PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>version <version> <packages></COMMAND></TERM><LISTITEM><PARA>Selects the specified version of anumber of packages in the <productname>eCos</productname> configuration. Bydefault, the most recent version of each package isused. This command will be used typically when anolder version of a package is required.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>check</COMMAND></TERM><LISTITEM><PARA>Presents the following informationconcerning the current configuration:</PARA><ORDEREDLIST><LISTITEM><PARA>the selected target hardware</PARA></LISTITEM><LISTITEM><PARA>the selected template</PARA></LISTITEM><LISTITEM><PARA>additional packages</PARA></LISTITEM><LISTITEM><PARA>removed packages</PARA></LISTITEM><LISTITEM><PARA>the selected version of packageswhere this is not the most recentversion</PARA></LISTITEM><LISTITEM><PARA>conflicts in the current configuration</PARA></LISTITEM></ORDEREDLIST></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>resolve</COMMAND></TERM><LISTITEM><PARA>Resolves conflicts identified in thecurrent <productname>eCos</productname> configuration by invoking an inferencecapability. Resolved conflicts are reported, but notall conflicts may be resolvable. This command willbe used typically following manual editing of theconfiguration.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>export <file></COMMAND></TERM><LISTITEM><PARA>Exports a minimal <productname>eCos</productname> configurationsave file with the specified name. This filecontains only those options which do not have theirdefault value. Such files are used typically totransfer option values from one configuration toanother.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>import <file></COMMAND></TERM><LISTITEM><PARA>Imports a minimal <productname>eCos</productname> configurationsave file with the specified name. The values ofthose options specified in the file are applied tothe current configuration.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>tree</COMMAND></TERM><LISTITEM><PARA>Generates a build tree based on the current <productname>eCos</productname>configuration. This command will be used typicallyjust before building <productname>eCos</productname>.Normally a build tree canonly be generated if if the configuration has no unresolvedconflicts, but <OPTION>--ignore-errors</OPTION> can be used to overridethis.</PARA></LISTITEM></VARLISTENTRY></VARIABLELIST></SECT2></SECT1><SECT1 id="conflicts-and-constraints"><TITLE>Conflicts and constraints</TITLE><PARA>Configuration options are not completely independent. For examplethe C library's <FUNCTION>strtod()</FUNCTION> and <FUNCTION>atof()</FUNCTION>functions rely on the math library package to provide certain functionality. If the math library package is removed then the Clibrary can no longer provide these functions. Each package describes constraints like these in CDL <EMPHASIS>"requires"</EMPHASIS> properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there canbe several resolution options. For example, it would be possible to add the math library package back to theconfiguration, or to disable the <FUNCTION>strtod()</FUNCTION> and <FUNCTION>atof()</FUNCTION> functions.</PARA><PARA>The <productname>eCos</productname> configuration tools will report any conflicts in the current configuration. If there are any such conflictsthen the configuration is usually unsafe and it makes no sense to build and run <productname>eCos</productname> in such circumstances. In fact,any attempt at building <productname>eCos</productname> is likely to fail. In exceptional cases it is possible to override this by using e.g. the<OPTION>--ignore-errors</OPTION> qualifier with ecosconfig.</PARA><PARA>Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which canresolve the associated conflicts automatically. For example, if the math library package is removed then theinference engine can resolve the resulting conflict by disabling the configuration option for <FUNCTION>strtod()</FUNCTION> and <FUNCTION>atof()</FUNCTION>. Allsuch changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is notallowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which doesnot match the application's requirements.</PARA><PARA>A typical session involving conflicts would look something like this:<SCREEN>$ ecosconfig new pid</SCREEN>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.</PARA><PARA> For some targetsthere may be conflicts and the inference engine would come into play.<SCREEN>$ ecosconfig remove libmU CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0U CYGFUN_LIBC_strtod, new inferred value 0U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0</SCREEN>ecosconfig reports that this change caused three conflicts, all in the C library. The inference engine was able toresolve all the conflicts and update the relevant configuration options accordingly. </PARA><PARA>To suppress the inference engine <OPTION>--no-resolve</OPTION> can be used:<SCREEN>$ ecosconfig new pid$ ecosconfig --no-resolve remove libmC CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBMC CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBMC CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM</SCREEN>Three unresolved conflicts are reported.</PARA><PARA>The <COMMAND>check</COMMAND> command can be used to get the current state of theconfiguration, and the <OPTION>--verbose</OPTION> qualifier will provide additional information: </PARA><SCREEN>$ ecosconfig --srcdir /home/bartv/ecc/ecc --verbose checkTarget: pidTemplate: defaultRemoved:CYGPKG_LIBM3 conflict(s):C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBMPossible solution:CYGFUN_LIBC_strtod -> 0CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBMPossible solution:CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT -> 0C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBMPossible solution:CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0</SCREEN><PARA>If the proposed solutions are acceptable, the resolve command can be used to apply them:<SCREEN>$ ecosconfig resolveU CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0U CYGFUN_LIBC_strtod, new inferred value 0U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0</SCREEN></PARA><PARA>The current configuration is again conflict-free and it is possible to generate a build tree. The <OPTION>--quiet</OPTION> qualifier canbe used to suppress the change messages, if desired.</PARA><PARA>When changing individual configuration options by editing the ecos.ecc file (as described below), the resultingsystem should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod isexplicitly enabled in the savefile:<SCREEN>$ edit ecos.ecc$ ecosconfig checkTarget: pidTemplate: defaultRemoved:CYGPKG_LIBM1 conflict(s):C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM$ ecosconfig resolveC CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM</SCREEN>In this case the inference engine cannot resolve the conflict automatically because that would involve changing auser setting. Any attempt to generate a build tree will fail:<SCREEN>$ ecosconfig --srcdir /home/bartv/ecc/ecc treeC CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBMUnable to generate build tree, this configuration still contains conflicts.Either resolve the conflicts or use --ignore-errors</SCREEN></PARA><PARA>It is still possible to generate a build tree:<SCREEN>$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors treeC CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM$ make</SCREEN>In this case <productname>eCos</productname> will fail to build. In other cases of unresolved conflicts <productname>eCos</productname> may build, but may not run. Ingeneral all conflicts should be resolved by editing the <FILENAME>ecos.ecc</FILENAME> file, by letting the inference engine make appropriatechanges, or by other means, before any attempt is made to build or run <productname>eCos</productname>.</PARA></SECT1><SECT1 id="building-the-system"><TITLE>Building the System</TITLE><PARA>Once a build tree has been generated with<COMMAND>ecosconfig</COMMAND>, <!-- <index></index>-->building <productname>eCos</productname> is straightforward:</PARA><SCREEN>$ make</SCREEN><PARA>The build tree contains the subdirectories, makefiles,and everything else that is needed to generate the defaultconfiguration for the selected architecture and platform.The only requirement is that the tools needed for thatarchitecture, for example<COMMAND>powerpc-eabi-g++</COMMAND>,are available using the standard search path. If this is notthe case then the <COMMAND>make</COMMAND> willfail with an error message. If you have a multiprocessorsystem then it may be more efficient to use:</PARA><SCREEN>$ make -j <REPLACEABLE>n</REPLACEABLE></SCREEN><PARA>where <REPLACEABLE>n</REPLACEABLE> is equal to thenumber of processors on your system.</PARA><PARA>Once the <COMMAND>make</COMMAND> processhas completed, the install tree will contain the headerfiles and the target library that are needed for applicationdevelopment. </PARA><PARA>It is also possible to build the system’s test casesfor the current configuration:</PARA><SCREEN>$ make tests</SCREEN><PARA>The resulting test executables will end up in a<FILENAME>tests</FILENAME> subdirectory of the<!-- <index></index> -->install tree. </PARA><PARA>If disk space is scarce then it is possible to make the copyof the install tree for application development purposes, and thenuse: </PARA><SCREEN>$ make clean</SCREEN><PARA>The build tree will now use up a minimum of disk space — thebulk of what is left consists of configuration header files thatyou may have edited and hence should not be deleted automatically.However, it is possible to rebuild the system at any time withoutre-invoking <COMMAND>ecosconfig</COMMAND>, just byrunning <COMMAND>make</COMMAND> again. </PARA><PARA>Under exceptional circumstances it may be necessary to run <COMMAND>makeclean</COMMAND> for other reasons, such as when a new releaseof the toolchain is installed. The toolchain includes a number ofheader files which are closely tied to the compiler, for example <filename>limits.h</filename>,and these header files are not and should not be duplicated by <productname>eCos</productname>.The makefiles perform header file dependency analysis, so that whena header file is changed all affected sources will be rebuilt duringthe next <COMMAND>make</COMMAND>. This is very usefulwhen the configuration header files are changed, but it also meansthat a build tree containing information about the locations ofheader files must be rebuilt. If a new version of the toolchainis installed and the old version is removed then this location informationis no longer accurate, and <COMMAND>make</COMMAND> willcomplain that certain dependencies cannot be satisfied. Under such circumstancesit is necessary to do a <COMMAND>make clean</COMMAND> first. </PARA></SECT1><SECT1 id="ecos-packages"><TITLE>Packages</TITLE><PARA><productname>eCos</productname> is a component architecture. The system comes as anumber of <!-- <index></index> -->packages which can beenabled or disabled as required, and new packages can beadded as they become available. Unfortunately, the packagesare not completely independent: for example the µITRONcompatibility package relies almost entirely onfunctionality provided by the kernel package, and it wouldnot make sense to try to build µITRON if the kernelwas disabled. The C library has fewer dependencies: someparts of the C library rely on kernel functionality, but itis possible to disable these parts and thus build a systemthat has the C library but no kernel. The<command>ecosconfig</command> tool has the capability ofchecking that all the dependencies are satisfied, but itmay still be possible to produce configurations that willnot build or (conceivably) that will build but not run.Developers should be aware of this and take appropriatecare.</PARA><PARA>By default, <!-- <index></index> --><command>ecosconfig</command> willinclude all packages that are appropriate for the specified hardwarein the configuration. The common <!-- <index></index> -->HAL package andthe <productname>eCos</productname> infrastructure must be present in every configuration. Inaddition, it is always necessary to have one architectural HAL packageand one platform HAL package. Other packages are optional, and canbe added or removed from a configuration as required.</PARA><PARA>The application may not require all of the packages; for example,it might not need the µITRON compatibilitypackage, or the floating point support provided by the math library.There is a slight overhead when <productname>eCos</productname> is built because the packageswill get compiled, and there is also a small disk space penalty.However, any unused facilities will get stripped out at link-time,so having redundant packages will not affect the final executable. </PARA></SECT1><SECT1 id="coarse-grained-configuration"><TITLE>Coarse-grained Configuration</TITLE><PARA>Coarse-grained <!-- <index></index> -->configuration ofan <productname>eCos</productname> system means making configuration changes using the<COMMAND>ecosconfig</COMMAND> tool. These changesinclude: </PARA><ORDEREDLIST><LISTITEM><PARA>switching to different target hardware</PARA></LISTITEM><LISTITEM><PARA>switching to a different template</PARA></LISTITEM><LISTITEM><PARA>adding or removing a package</PARA></LISTITEM><LISTITEM><PARA>changing the version of a package</PARA></LISTITEM></ORDEREDLIST><PARA>Whenever <COMMAND>ecosconfig</COMMAND> generates orupdates an <productname>eCos</productname> configuration, it generates a configurationsave file.</PARA><PARA>Suppose that the configuration was first created usingthe following command line: </PARA><SCREEN>$ ecosconfig new stdeval1</SCREEN><PARA>To change the target hardware to the Cogent CMA28xPowerPC board, the following command would be needed:</PARA><SCREEN>$ ecosconfig target cma28x</SCREEN><PARA>To switch to the PowerPC simulator instead: </PARA><SCREEN>$ ecosconfig target psim</SCREEN><PARA>As the hardware changes, hardware-related packages such asthe HAL packages and device drivers will be added to and removedfrom the configuration as appropriate. </PARA><PARA>To remove any package from the current configuration, usethe <COMMAND>remove</COMMAND> command: </PARA><SCREEN>$ ecosconfig remove uitron</SCREEN><PARA>You can disable multiple packages using multiple arguments,for example: </PARA><SCREEN>$ ecosconfig remove uitron libm</SCREEN><PARA>If this turns out to have been a mistake then you canre-enable one or more packages with the<COMMAND>add</COMMAND> command: </PARA><SCREEN>$ ecosconfig add libm</SCREEN><PARA>Changing the desired version for a package is alsostraightforward:</PARA><SCREEN>$ ecosconfig version v2_1 kernel</SCREEN><PARA>It is necessary to regenerate the build tree and headerfiles following any changes to the configuration beforerebuilding <productname>eCos</productname>:</PARA><SCREEN>$ ecosconfig tree</SCREEN></SECT1><SECT1 id="fine-grained-configuration"><TITLE>Fine-grained Configuration</TITLE><PARA><COMMAND>ecosconfig</COMMAND> only providescoarse-grained control over the configuration: the hardware,the template and the packages that should be built. Unlikethe Configuration Tool,<COMMAND>ecosconfig</COMMAND> does not provideany facilities for manipulating finer-grained <!--<index></index> -->configuration options such as how manypriority levels the scheduler should support. There arehundreds of these options, and manipulating them by means ofcommand line arguments would not be sensible. </PARA><PARA>In the current system fine-grained configuration options maybe manipulated by manual editing of the configuration file. Whena file has been edited in this way, the <COMMAND>ecosconfig</COMMAND> toolshould be used to check the configuration for any conflicts whichmay have been introduced:</PARA><SCREEN>$ ecosconfig check</SCREEN><PARA>The <COMMAND>check</COMMAND> command will listall conflicts and will also rewrite the configuration file, propagatingany changes which affect other options. The user may choose to resolvethe conflicts either by re-editing the configuration file manuallyor by invoking the inference engine using the <COMMAND>resolve</COMMAND> command:</PARA><SCREEN>$ ecosconfig resolve</SCREEN><PARA>The <COMMAND>resolve</COMMAND> command willlist all conflicts which can be resolved and save the resulting changesto the configuration.</PARA><PARA>It is necessary to regenerate the build tree and header filesfollowing any changes to the configuration before rebuilding <productname>eCos</productname>:</PARA><SCREEN>$ ecosconfig tree</SCREEN><PARA>All the configuration options and their descriptions are listedin the <citetitle><productname>eCos</productname> Reference Manual</citetitle>. </PARA></SECT1><SECT1 id="editing-an-ecos-savefile"><TITLE>Editing an <productname>eCos</productname> Savefile</TITLE><PARA>The <productname>eCos</productname> configuration information is held in a singlesavefile, typically <FILENAME>ecos.ecc</FILENAME>, which canbe generated by either the GUI configuration tool or by thecommand line <command>ecosconfig</command> tool. The filenormally exists at the top level of the build tree. It is atext file, allowing the various configurations options to beedited inside a suitable text editor or by other programs orscripts, as well as in the GUI config tool.</PARA><PARA>An <productname>eCos</productname> savefile is actually a script in the <EMPHASIS>Tcl</EMPHASIS> 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<literal> CYGDAT_UITRON_TASK_EXTERNS</literal>,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 “#” isusually a comment, and the bulk of an <productname>eCos</productname> savefile actually consistsof such comments, to make it easier to edit.</PARA><SECT2><TITLE>Header</TITLE><PARA>An <productname>eCos</productname> savefile begins with a header, which typicallylooks something like this:</PARA><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_commandcdl_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 };</SCREEN><PARA>This section of the savefile is intended for use by theconfiguration system, and should not be edited. If thissection is edited then the various configuration tools may nolonger be able to read in the modified savefile.</PARA></SECT2><SECT2><TITLE>Toplevel Section</TITLE><PARA>The header is followed by a section that defines theconfiguration as a whole. A typical example wouldbe:</PARA><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 ;};</SCREEN><PARA>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:</PARA><PROGRAMLISTING>$ ecosconfig remove CYGPKG_LIBM</PROGRAMLISTING><PARA>There are two fields which can be edited. Configurations havea name; in this case <productname>eCos</productname>. 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.</PARA></SECT2><SECT2><TITLE>Conflicts Section</TITLE><PARA>The toplevel section is followed by details of all theconflicts (if any) in the configuration, forexample:</PARA><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</SCREEN><PARA>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 <literal>CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET</literal> 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 <EMPHASIS>requires</EMPHASIS> 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 <literal>CYGFUN_KERNEL_THREADS_TIMER</literal>,or disabling <literal>CYGSEM_LIBC_TIME_CLOCK_WORKING</literal>.Both of these options will be listed later on in the file.</PARA><PARA>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 <literal>CYGSEM_LIBC_TIME_CLOCK_WORKING</literal>,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.</PARA><PARA>It is not absolutely required that a configuration be conflict-freebefore generating a build tree and building <productname>eCos</productname>. It is up to thedevelopers of each component to decide what would happen if an attemptis made to build <productname>eCos</productname> 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’srisk.</PARA></SECT2><SECT2><TITLE>Data Section</TITLE><PARA>The bulk of the savefile lists the various packages,components, and options, including their values and thevarious dependencies. A number of global options comefirst, especially those related to the build process suchas compiler flags. These are followed by the variouspackages, and the components and options within thosepackages, in order.</PARA><PARA>Packages, components and options are organized in ahierarchy. If a particular component is disabled then alloptions and sub-components below it will be inactive: anychanges made to these will have no effect. The savefilecontains information about the hierarchy in the form ofcomments, for example:</PARA><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 ...# <# <</SCREEN><PARA>This corresponds to the following hierarchy:</PARA><SCREEN> CYGPKG_KERNELCYGPKG_KERNEL_EXCEPTIONSCYGSEM_KERNEL_EXCEPTIONS_DECODECYGSEM_KERNEL_EXCEPTIONS_GLOBALCYGPKG_KERNEL_SCHEDCYGSEM_KERNEL_SCHED_MLQUEUECYGSEM_KERNEL_SCHED_BITMAP</SCREEN><PARA>Providing the hierarchy information in this way allowsprograms or scripts to analyze the savefile and readilydetermine the hierarchy. It could also be used by asufficiently powerful editor to support structured editingof <productname>eCos</productname> savefiles. The information is not used by theconfiguration tools themselves since they obtain thehierarchy from the original CDL scripts.</PARA><PARA>Each configurable entity is preceded by a comment, ofthe following form:</PARA><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 {...};</SCREEN><PARA>This provides a short textual alias<literal>Kernel schedulers</literal> for thecomponent. If online documentation is available for theconfigurable entity then this will come next. Finallythere is a short description of the entity as a whole. Allthis information is provided by the componentdevelopers.</PARA><PARA>Each configurable entity takes the form:</PARA><SCREEN><type> <name> {<data>};</SCREEN><PARA>Configurable entities may not be active. This can be eitherbecause the parent is disabled or inactive, or because there areone or more <EMPHASIS>active_if</EMPHASIS> properties. Modifyingthe value of an inactive entity has no effect on the configuration,so this information is provided first:</PARA><PARA></PARA><SCREEN>cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE {# This option is not active# The parent CYGPKG_KERNEL_EXCEPTIONS is disabled...};...cdl_option CYGIMP_IDLE_THREAD_YIELD {# This option is not active# ActiveIf constraint: (CYGNUM_KERNEL_SCHED_PRIORITIES == 1)# CYGNUM_KERNEL_SCHED_PRIORITIES == 32# --> 0...};</SCREEN><PARA>For <literal>CYGIMP_IDLE_THREAD_YIELD</literal> thesavefile lists the expression that must be satisfied if the optionis to be active, followed by the current value of all entities thatare referenced in the expression, and finally the result of evaluatingthat expression.</PARA><PARA>Not all options are directly modifiable in the savefile. First,the value of packages (which is the version of that package loadedinto the configuration) cannot be modified here.</PARA><SCREEN>cdl_package CYGPKG_KERNEL {# Packages cannot be added or removed, nor can their version be changed,# simply by editing their value. Instead the appropriate configuration# should be used to perform these actions....};</SCREEN><PARA>The version of a package can be changed using e.g.: </PARA><SCREEN>$ ecosconfig version 1.3 CYGPKG_KERNEL</SCREEN><PARA>Even though a package’s value cannot be modifiedhere, it is still important for the savefile to contain the details.In particular packages may impose constraints on other configurableentities and may be referenced by other configurable entities. Alsoit would be difficult to understand or extract the configuration’shierarchy if the packages were not listed in the appropriate placesin the savefile.</PARA><PARA>Some components (or, conceivably, options) do not have anyassociated data. Typically they serve only to introduce anotherlevel in the hierarchy, which can be useful in the context of theGUI configuration tool.</PARA><SCREEN>cdl_component CYGPKG_HAL_COMMON_INTERRUPTS {# There is no associated value.};</SCREEN><PARA>Other components or options have a calculated value. Theseare not user-modifiable, but typically the value will depend onother options which can be modified. Such calculated options canbe useful when controlling what gets built or what ends up in thegenerated configuration header files. A calculated value may alsoeffect other parts of the configuration, for instance, via a <EMPHASIS>requires</EMPHASIS> constraint.</PARA><SCREEN>cdl_option BUFSIZ {# Calculated value: CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO ? CYGNUM_LIBC_STDIO_BUFSIZE : 0# CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO == 1# CYGNUM_LIBC_STDIO_BUFSIZE == 256# Current_value: 256};</SCREEN><PARA>A special type of calculated value is the <EMPHASIS>interface</EMPHASIS>.The value of an interface is the number of active and enabled optionswhich <EMPHASIS>implement</EMPHASIS> that interface. Again the valueof an interface cannot be modified directly; only by modifying theoptions which implement the interface. However, an interface canbe referenced by other parts of the configuration. </PARA><SCREEN>cdl_interface CYGINT_KERNEL_SCHEDULER {# Implemented by CYGSEM_KERNEL_SCHED_MLQUEUE, active, enabled# Implemented by CYGSEM_KERNEL_SCHED_BITMAP, active, disabled# This value cannot be modified here.# Current_value: 1# Requires: 1 == CYGINT_KERNEL_SCHEDULER# CYGINT_KERNEL_SCHEDULER == 1# --> 1</SCREEN><SCREEN># The following properties are affected by this value# interface CYGINT_KERNEL_SCHEDULER# Requires: 1 == CYGINT_KERNEL_SCHEDULER}; </SCREEN><PARA>If the configurable entity is modifiable then there will belines like the following:</PARA><SCREEN>cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {...# Flavor: bool# No user value, uncomment the following line to provide one.# user_value 1# value_source default# Default value: 1...};</SCREEN><PARA>Configurable entities can have one of four different flavors:none, bool, data and booldata. Flavor none indicates that thereis no data associated with the entity, typically it just acts asa placeholder in the overall hierarchy. Flavor bool is the mostcommon, it is a simple yes-or-no choice. Flavor data is for morecomplicated configuration choices, for instance the size of an arrayor the name of a device. Flavor booldata is a combination of booland data: the option can be enabled or disabled, and there is someadditional data associated with the option as well.</PARA><PARA>In the above example the user has not modified this particularoption, as indicated by the comment and by the commented-out <literal>user_value</literal> line.To disable this option the file should be edited to:</PARA><SCREEN>cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {...# Flavor: bool# No user value, uncomment the following line to provide one.user_value 0# value_source default# Default value: 1...}</SCREEN><PARA>The comment preceding the <literal>user_value0</literal> line can be removed if desired, otherwise itwill be removed automatically the next time the file is read andupdated by the configuration tools.</PARA><PARA>Much the same process should be used for options with thedata flavor, for example:</PARA><SCREEN>cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {# Flavor: data# No user value, uncomment the following line to provide one.# user_value 3600# value_source default# Default value: 3600# Legal values: -90000 to 90000};</SCREEN><PARA>can be changed to:</PARA><SCREEN>cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET {# Flavor: datauser_value 7200# value_source default# Default value: 3600# Legal values: -90000 to 90000 };</SCREEN><PARA>Note that the original text provides the default value inthe <literal>user_value</literal> comment,on the assumption that the desired new value is likely to be similarto the default value. The <literal>value_source</literal> commentdoes not need to be updated, it will be fixed up if the savefileis fed back into the configuration system and regenerated.</PARA><PARA>For options with the booldata flavor, the <literal>user_value</literal> lineneeds take two arguments. The first argument is for the booleanpart, the second for the data part. For example:</PARA><SCREEN>cdl_component CYGNUM_LIBM_COMPATIBILITY {# Flavor: booldata# No user value, uncomment the following line to provide one.# user_value 1 POSIX# value_source default# Default value: 1 POSIX# Legal values: “POSIX” “IEEE” “XOPEN” “SVID”...};</SCREEN><PARA>could be changed to:</PARA><SCREEN>cdl_component CYGNUM_LIBM_COMPATIBILITY {# Flavor: booldatauser_value 1 IEEE# value_source default# Default value: 1 POSIX# Legal values: “POSIX” “IEEE” “XOPEN” “SVID”...};</SCREEN><PARA>or alternatively, if the whole component should be disabled,to:</PARA><SCREEN>cdl_component CYGNUM_LIBM_COMPATIBILITY {# Flavor: booldatauser_value 0 POSIX# value_source default# Default value: 1 POSIX# Legal values: “POSIX” “IEEE” “XOPEN” “SVID”...};</SCREEN><PARA>Some options take values that span multiple lines. An examplewould be:</PARA><SCREEN>cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {# Flavor: data# No user value, uncomment the following line to provide one.# user_value \# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\# CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\# CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”# value_source default# Default value: \# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\# CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\# CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”};</SCREEN><PARA>Setting a user value for this option involves uncommentingand modifying all relevant lines, for example:</PARA><SCREEN>cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS {# Flavor: datauser_value \“CYG_UIT_MEMPOOLVAR( vpool1, 4000 ), \\CYG_UIT_MEMPOOLVAR( vpool2, 4000 ),”# value_source default# Default value: \# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\# CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\# CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),”};</SCREEN><PARA>In such cases appropriate care has to be taken to preserveTcl syntax, as discussed below.</PARA><PARA>The configuration system has the ability to keep track ofseveral different values for any given option. All optionsstart off with a default value, in other words their valuesource is set to <literal>default</literal>. If aconfiguration involves conflicts and the configurationsystem’s inference engine is allowed to resolve theseautomatically then it may provide an<literal>inferred</literal> value instead, forexample:</PARA><SCREEN>cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {# Flavor: bool# No user value, uncomment the following line to provide one.# user_value 1# The inferred value should not be edited directly.inferred_value 0# value_source inferred# Default value: 1...};</SCREEN><PARA>Inferred values are calculated by the configuration systemand should not be edited by the user. If the inferred value is notcorrect then a user value should be substituted instead:</PARA><SCREEN>cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {# Flavor: booluser_value 1# The inferred value should not be edited directly.inferred_value 0# value_source inferred# Default value: 1...}; </SCREEN><PARA>The inference engine will not override a user value with aninferred one. Making a change like this may well re-introduce aconflict, since the inferred value was only calculated to resolvea conflict. Another run of the inference engine may find a differentand more acceptable way of resolving the conflict, but this is not guaranteedand it may be up to the user to examine the various dependenciesand work out an acceptable solution.</PARA><PARA>Inferred values are listed in the savefile because the exactinferred value may depend on the order in which changes were madeand conflicts were resolved. If the inferred values were absentthen it is possible that reloading a savefile would not exactlyrestore the configuration. Default values on the other hand areentirely deterministic so there is no actual need for the valuesto be listed in the savefile. However, the default value can bevery useful information so it is provided in a comment.</PARA><PARA>Occasionally the user will want to do some experimentation,and temporarily switch an option from a user value back to a defaultor inferred one to see what the effect would be. This could be achievedby simply commenting out the user value. For instance, if the currentsavefile contains:</PARA><SCREEN>cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {# Flavor: booluser_value 1# The inferred value should not be edited directly.inferred_value 0# value_source user# Default value: 1...};</SCREEN><PARA>then the inferred value could be restored by commenting outor removing the <literal>user_value</literal> line:</PARA><SCREEN>cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {# Flavor: bool# user_value 1# The inferred value should not be edited directly.inferred_value 0# value_source user# Default value: 1...};</SCREEN><PARA>This is fine for simple values. However if the value is complicatedthen there is a problem: commenting out the <LITERAL>user_value</LITERAL> lineor lines means that the user value becomes invisible to the configuration system,so if the savefile is loaded and then regenerated the informationwill be lost. An alternative approach is to keep the <LITERAL>user_value</LITERAL> butexplicitly set the <LITERAL>value_source</LITERAL> line,for example:</PARA><SCREEN>cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT {# Flavor: booluser_value 1# The inferred value should not be edited directly.inferred_value 0value_source inferred# Default value: 1...};</SCREEN><PARA>In this case the configuration system will use the inferredvalue for the purposes of dependency analysis etc., even thougha user value is present. To restore the user value the <LITERAL>value_source</LITERAL> linecan be commented out again. If there is no explicit <LITERAL>value_source</LITERAL> thenthe configuration system will just use the highest priority one:the user value if it exists; otherwise the inferred value if itexists; otherwise the default value which always exists.</PARA><PARA>The default value for an option can be a simple constant,or it can be an expression involving other options. In the lattercase the expression will be listed, together with the values forall options referenced in the expression and the current resultof evaluating that expression. This is for informational purposesonly, the default value is always recalculated deterministicallywhen loading in a savefile.</PARA><SCREEN>cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {# Flavor: data# No user value, uncomment the following line to provide one.# user_value arm-elf# value_source default# Default value: CYGHWR_THUMB ? “thumb-elf” : “arm-elf”# CYGHWR_THUMB == 0# --> arm-elf};</SCREEN><PARA>For options with the data or booldata flavor, there are likelyto be constraints on the possible values. If the value is supposedto be a number in a given range and a user value of “<LITERAL>helloworld</LITERAL>” is provided instead then thereare likely to be compile-time failures. Component developers canspecify constraints on the legal values, and these will be listedin the savefile.</PARA><SCREEN>cdl_option X_TLOSS {# Flavor: data# No user value, uncomment the following line to provide one.# user_value 1.41484755040569E+16# value_source default# Default value: 1.41484755040569E+16# Legal values: 1 to 1e308};</SCREEN><SCREEN>cdl_component CYGNUM_LIBM_COMPATIBILITY {# Flavor: booldata# No user value, uncomment the following line to provide one.# user_value 1 POSIX# value_source default# Default value: 1 POSIX# Legal values: “POSIX” “IEEE” “XOPEN” “SVID”...};</SCREEN><PARA>In some cases the legal values list may be an expression involvingother options. If so then the current values of the referenced optionswill be listed, together with the result of evaluating the listexpression, just as for default value expressions.</PARA><PARA>If an illegal value is provided then this will result in aconflict, listed in the conflicts section of the savefile. For morecomplicated options a simple legal values list is not sufficientto allow the current value to be validated, and the configurationsystem will be unable to flag conflicts. This issue will be addressed infuture releases of the configuration system.</PARA><PARA>Following the value-related fields for a given option, any <EMPHASIS>requires</EMPHASIS> constraints belongingto this option will be listed. These constraints are only effectiveif the option is active and, for bool and booldata flavors, enabled.If some aspect of <productname>eCos</productname> functionality is inactive or disabled thenit cannot impose any constraints on the rest of the system. As usual,the full expression will be listed followed by the current valuesof all options that are referenced and the result of evaluatingthe expression:</PARA><SCREEN>cdl_option CYGSEM_LIBC_TIME_TIME_WORKING {...# Requires: CYGPKG_DEVICES_WALLCLOCK# CYGPKG_DEVICES_WALLCLOCK == current# --> 1};</SCREEN><PARA>When modifying the value of an option it is useful to knownot only what constraints the option imposes on the rest of thesystem but also what other options in the system depend in someway on this one. The savefile provides this information:</PARA><SCREEN>cdl_option CYGFUN_KERNEL_THREADS_TIMER {...# The following properties are affected by this value# option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT# Requires: CYGFUN_KERNEL_THREADS_TIMER# option CYGIMP_UITRON_STRICT_CONFORMANCE# Requires: CYGFUN_KERNEL_THREADS_TIMER# option CYGSEM_LIBC_TIME_CLOCK_WORKING# Requires: CYGFUN_KERNEL_THREADS_TIMER};</SCREEN></SECT2><SECT2><TITLE>Tcl Syntax</TITLE><PARA><productname>eCos</productname> savefiles are implemented as Tcl scripts, and are readin by running the data through a standard Tcl interpreter that hasbeen extended with a small number of additional commands such as <LITERAL>cdl_option</LITERAL> and <LITERAL>cdl_configuration</LITERAL>.In many cases this is an implementation detail that can be safelyignored while editing a savefile: simply replacing a <LITERAL>1</LITERAL> witha <LITERAL>0</LITERAL> to disable some functionalityis not going to affect whether or not the savefile is still a validTcl script and can be processed by a Tcl interpreter. However, thereare more complicated cases where an understanding of Tcl syntaxis at least desirable, for example:</PARA><SCREEN>cdl_option CYGDAT_UITRON_MEMPOOLVAR_EXTERNS {# Flavor: datauser_value \“static char vpool1\[ 2000 \], \\vpool2\[ 2000 \], \\vpool3\[ 2000 \];”# value_source default# Default value: \# “static char vpool1\[ 2000 \], \\# vpool2\[ 2000 \], \\# vpool3\[ 2000 \];”};</SCREEN><PARA>The backslash at the end of the <LITERAL>user_value</LITERAL> lineis processed by the Tcl interpreter as a line continuation character.The quote marks around the user data are also interpreted by theTcl interpreter and serve to turn the entire data field into a singleargument. The backslashes preceding the opening and closing squarebrackets prevent the Tcl interpreter from treating these charactersspecially, otherwise there would be an attempt at <EMPHASIS>commandsubstitution</EMPHASIS> as described below. The double backslashesat the end of each line of the data will be turned into a singlebackslash by the Tcl interpreter, rather than escaping the newlinecharacter, so that the actual data seen by the configuration systemis:</PARA><SCREEN>static char vpool1[ 2000 ], \vpool2[ 2000 ], \vpool3[ 2000 ];</SCREEN><PARA>This is of course the data that should end up in the µITRONconfiguration header file. The opening and closing braces surroundingthe entire body of the option data are also significant and causethis body to be passed as a single argument to the <command>cdl_option</command> command.The closing semicolon is optional in this example, but providesa small amount of additional robustness if the savefile is editedsuch that it is no longer a valid Tcl script. If the data containedany <LITERAL>$</LITERAL> characters thenthese would have to be treated specially as well, via a backslash escape.</PARA><PARA>In spite of what all the above might seem to suggest, Tclis actually a very simple yet powerful scripting language: the syntaxis defined by just eleven rules. On occasion this simplicity meansthat Tcl’s behaviour is subtly different from other languages,which can confuse newcomers.</PARA><PARA>When the Tcl interpreter is passed some data such as <LITERAL>putsHello</LITERAL>, it splits this data into a command and itsarguments. The command will be terminated by a newline or by a semicolon,unless one of the quoting mechanisms is used. The command and eachof its arguments are separated by white space. So in the followingexample:</PARA><SCREEN>puts Helloset x 42 </SCREEN><PARA>will result in two separate commands being executed. The firstcommand is <LITERAL>puts</LITERAL> and is passed asingle argument, <LITERAL>Hello</LITERAL>. The secondcommand is <LITERAL>set</LITERAL> and is passed twoarguments, <LITERAL>x</LITERAL> and <LITERAL>42</LITERAL>.The intervening newline character serves to terminate the firstcommand, and a semi-colon separator could be used instead: </PARA><programlisting>puts Hello;set x 42</programlisting><PARA>Any white space surrounding the semicolon is just ignoredbecause it does not serve to separate arguments.</PARA><PARA>Now consider the following:</PARA><SCREEN>set x Hello world</SCREEN><PARA>This is not valid Tcl. It is an attempt to invoke the <LITERAL>set</LITERAL> commandwith three arguments: <LITERAL>x</LITERAL>, <LITERAL>Hello</LITERAL>,and <LITERAL>world</LITERAL>. The <LITERAL>set</LITERAL> onlytakes two arguments, a variable name and a value, so it is necessaryto combine the data into a single argument by quoting:</PARA><PROGRAMLISTING>set x “Hello world”</PROGRAMLISTING><PARA>When the Tcl interpreter encounters the first quote characterit treats all subsequent data up to but not including the closingquote as part of the current argument. The quote marks are removedby the interpreter, so the second argument passed to the <LITERAL>set</LITERAL> commandis just <LITERAL>Hello world</LITERAL> without thequote characters. This can be significant in the context of <productname>eCos</productname> savefiles.For instance, consider the following configuration option:</PARA><SCREEN>cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {# Flavor: data# No user value, uncomment the following line to provide one.# user_value “\”/dev/ttydiag\””# value_source default# Default value: “\”/dev/ttydiag\””};</SCREEN><PARA>The desired value of the configuration option should be avalid C string, complete with quote characters. If the savefilewas edited to: </PARA><SCREEN>cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE {# Flavor: datauser_value “/dev/ttydiag”# value_source default# Default value: “\”/dev/ttydiag\””};</SCREEN><PARA>then the Tcl interpreter would remove the quote marks whenthe savefile is read back in, so the option’s value wouldnot have any quote marks and would not be a valid C string. Theconfiguration system is not yet able to perform the required validationso the following <LITERAL>#define</LITERAL> wouldbe generated in the configuration header file:</PARA><PROGRAMLISTING>#define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE /dev/ttydiag </PROGRAMLISTING><PARA>This is likely to cause a compile-time failure when building<productname>eCos</productname>.</PARA><PARA>A quoted argument continues until the closing quote characteris encountered, which means that it can span multiple lines. Thiscan also be encountered in <productname>eCos</productname> savefiles, for instance, in the <literal>CYGDAT_UITRON_MEMPOOLVAR_EXTERNS</literal> examplementioned earlier. Newline or semicolon characters do not terminatethe current command in such cases.</PARA><PARA>The Tcl interpreter supports much the same forms of backslashsubstitution as other common programming languages. Some backslashsequences such as <literal>\n</literal> willbe replaced by the appropriate character. The sequence <literal>\\</literal> willbe replaced by a single backslash. A backslash at the very end ofa line will cause that backslash, the newline character, and anywhite space at the start of the next line to be replaced by a singlespace. Hence the following two Tcl commands are equivalent:</PARA><PROGRAMLISTING>puts “Hello\nworld\n”puts \“Helloworld“</PROGRAMLISTING><PARA>In addition to quote and backslash characters, the Tcl interpretertreats square brackets, the <literal>$</literal> character,and braces specially. Square brackets are used for command substitution,for example:</PARA><PROGRAMLISTING>puts “The answer is [expr 6 * 9]”</PROGRAMLISTING><PARA>When the Tcl interpreter encounters the square brackets itwill treat the contents as another command that should be executedfirst, and the result of executing that is used when continuingto process the script. In this case the Tcl interpreter will executethe command <literal>expr 6 * 9</literal>,yielding a result of 54, and then the Tcl interpreter will execute<literal>puts “The answer is 54”</literal>. It should be noted thatthe interpreter contains only one level of substitution: if theresult of performing command substitution performs further specialcharacters such as square brackets then these will not be treatedspecially.</PARA><PARA>Command line substitution is very unlikely to prove usefulin the context of an <productname>eCos</productname> savefile, but it is part of the Tcl languageand hence cannot be easily suppressed while reading in a savefile.As a result care has to be taken when savefile data involves squarebrackets. Consider the following:</PARA><PROGRAMLISTING>cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {...user_value \“static char fpool1[ 2000 ],fpool2[ 2000 ];”...};</PROGRAMLISTING><PARA>The Tcl interpreter will interpret the square brackets asan attempt at command substitution and hence it will attempt toexecute the command <literal>2000</literal> with noarguments. No such command is defined by the Tcl language or bythe savefile-related extensions provided by the configuration system,so this will result in an error when an attempt is made to readback the savefile. Instead it is necessary to backslash-escape thesquare brackets and thus suppress command substitution:</PARA><PROGRAMLISTING>cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {...user_value \“static char fpool1\[ 2000 \],fpool2\[ 2000 \];”...}; </PROGRAMLISTING><PARA>Similarly the <literal>$</literal> characteris used in Tcl scripts to perform variable substitution:</PARA><PROGRAMLISTING>set x [expr 6 * 9]puts “The answer is $x” </PROGRAMLISTING><PARA>Variable substitution, like command substitution, is veryunlikely to prove useful in the context of an <productname>eCos</productname> savefile. Shouldit be necessary to have a <literal>$</literal> characterin configuration data then again a backslash escape needs to beused.</PARA><PROGRAMLISTING>cdl_option FOODAT_MONITOR_PROMPT {...user_value “\$ “...};</PROGRAMLISTING><PARA>Braces are used to collect a sequence of characters into asingle argument, just like quotes. The difference is that variable,command and backslash substitution do not occur inside braces (withthe sole exception of backslash substitution at the end of a line).So, for example, the <literal>CYGDAT_UITRON_MEMPOOL_EXTERNFIXED_EXTERNS</literal> valuecould be written as:</PARA><PROGRAMLISTING>cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS {...user_value \{static char fpool1[ 2000 ],fpool2[ 2000 ];}...};</PROGRAMLISTING><PARA>The configuration system does not use this when generatingsavefiles because for simple edits of a savefile by inexperiencedusers the use of brace characters is likely to be a little bit moreconfusing than the use of quotes.</PARA><PARA>At this stage it is worth noting that the basic format ofeach configuration option in the savefile makes use of braces:</PARA><PROGRAMLISTING>cdl_option <name> {...};</PROGRAMLISTING><PARA>The configuration system extends the Tcl language with a smallnumber of additional commands such as <LITERAL>cdl_option</LITERAL>.These commands take two arguments, a name and a body, where thebody consists of all the text between the braces. First a checkis made that the specified option is actually present in the configuration.Then the body is executed in a recursive invocation of the Tcl interpreter,this time with additional commands such as <LITERAL>user_value</LITERAL> and <LITERAL>value_source</LITERAL>.If, after editing, the braces are not correctly matched up thenthe savefile will no longer be a valid Tcl script and errors willbe reported when the savefile is loaded again.</PARA><PARA>Comments in Tcl scripts are introduced by a hash character <LITERAL>#</LITERAL>.However, a hash character only introduces a comment if it occurswhere a command is expected. Consider the following:</PARA><PROGRAMLISTING># This is a commentputs “Hello” # world </PROGRAMLISTING><PARA>The first line is a valid comment, since the hash characteroccurs right at the start where a command name is expected. Thesecond line does not contain a comment. Instead it is an attemptto invoke the <LITERAL>puts</LITERAL> command withthree arguments: <LITERAL>Hello</LITERAL>, <LITERAL>#</LITERAL> and <LITERAL>world</LITERAL>.These are not valid arguments for the <LITERAL>puts</LITERAL> commandso an error will be raised.</PARA><PARA>If the second line was rewritten as:</PARA><PROGRAMLISTING>puts “Hello”; # world</PROGRAMLISTING><PARA>then this is a valid Tcl script. The semicolon identifiesthe end of the current command, so the hash character occurs ata point where the next command would start and hence it is interpretedas the start of a comment.</PARA><PARA>This handling of comments can lead to subtle behaviour. Considerthe following:</PARA><PROGRAMLISTING>cdl_option WHATEVER {# This is a comment }user_value 42...}</PROGRAMLISTING><PARA>Consider the way the Tcl interpreter processes this. The commandname and the first argument do not pose any special difficulties.The opening brace is interpreted as the start of the next argument,which continues until a closing brace is encountered. In this casethe closing brace occurs on the second line, so the second argumentpassed to <LITERAL>cdl_option</LITERAL> is <literal>\n # This is a comment</LITERAL> . This second argumentis processed in a recursive invocation of the Tcl interpreter anddoes not contain any commands, just a comment. Toplevel savefileprocessing then resumes, and the next command that is encounteredis <LITERAL>user_value</LITERAL>. Since therelevant savefile code is not currently processing a configurationoption this is an error. Later on the Tcl interpreter would encountera closing brace by itself, which is also an error. Fortunately thissequence of events is very unlikely to occur when editing generatedsavefiles.</PARA><PARA>This should be sufficient information about Tcl to allow forsafe editing of <productname>eCos</productname> savefiles. Further information is availablefrom a wide variety of sources, for example the book <EMPHASIS>Tcland the Tk Toolkit </EMPHASIS>by John K Ousterhout.</PARA></SECT2></SECT1><SECT1 id="editing-the-sources"><TITLE>Editing the Sources</TITLE><PARA>For many users, controlling the packages andmanipulating the available configuration options will besufficient to create an embedded operating system that meetsthe application's requirements. However, since <productname>eCos</productname> isshipped entirely in source form, it is possible to gofurther when necessary: you can edit the <productname>eCos</productname> <!--<index></index> -->sources themselves. This requires someunderstanding of the way the <productname>eCos</productname> build system works.</PARA><PARA>The most obvious place to edit the source code is directlyin the <!-- <index></index> -->component repository. For example, you couldedit the file <filename>kernel/<replaceable>&Version;</replaceable>/src/sync/mutex.cxx</filename>to change the way kernel mutexes work, or possibly just to add someextra diagnostics or assertions. Once the file has been edited,it is possible to invoke <command>make</command> atthe top level of the build tree and the target library will be rebuiltas required. A small optimization is possible: the build tree islargely a mirror of the component repository, so it too will containa subdirectory <filename>kernel/<replaceable>&Version;</replaceable></filename>;if make is invoked in this directorythen it will only check for changes to the kernel sources, whichis a bit more efficient than checking for changes throughout the componentrepository. </PARA><PARA>Editing a file in the component repository is fine if thistree is used for only one <productname>eCos</productname> configuration. If the repositoryis used for several different configurations, however, and especiallyif it is shared by multiple users, then making what may be experimentalchanges to the master sources would be a bad idea. The build system providesan alternative. It is possible to make a copy of the file in thebuild tree, in other words copy <filename>mutex.cxx</filename> fromthe <filename>kernel/<replaceable>&Version;</replaceable>/src/sync</filename> directoryin the component repository to <filename>kernel/<replaceable>&Version;</replaceable>/src/sync</filename> inthe build tree, and edit the file in the build tree. When <command>make</command> isinvoked it will pick up local copies of any of the sources in preferenceto the master versions in the component repository. Once you havefinished modifying the <productname>eCos</productname> sources you can install the final versionback in the component repository. If the changes were temporaryin nature and only served to aid the debugging process, then youcan discard the modified version of the sources. </PARA><PARA>The situation is slightly more complicated for the headerfiles that a package may export, such as the C library’s <filename>stdio.h</filename> headerfile, which can be found in the directory <filename>language/c/libc/<replaceable>&Version;</replaceable>/include</filename>.If such a header file is changed, either directly in the componentrepository or after copying it to the build tree, then <command>make</command> mustbe invoked at the top level of the build tree. In cases like thisit is not safe to rebuild just the C library because other packagesmay depend on the contents of <filename>stdio.h</filename>. </PARA></SECT1><SECT1 id="modifying-the-memory-layout"><TITLE>Modifying the Memory Layout</TITLE><PARA>Each <productname>eCos</productname> platform package is supplied with linker scriptfragments which describe the location of memory regions on the evaluationboard and the location of memory sections within these regions.The correct linker script fragment is selected and included in the<productname>eCos</productname> linker script <!-- <index></index> --><filename>target.ld</filename> when<productname>eCos</productname> is built.</PARA><PARA>It is not necessary to <!-- <index></index> -->modify the default memorylayouts in order to start development with <productname>eCos</productname>. However, it willbe necessary to edit a linker script fragment when the memory mapof the evaluation board is changed. For example, if additional memoryis added, the linker must be notified that the new memory is availablefor use. As a minimum, this would involve modifying the length ofthe corresponding memory region. Where the available memory is non-contiguous,it may be necessary to declare a new memory region and reassigncertain linker output sections to the new region.</PARA><PARA>Linker script fragments and memory layout header files shouldbe <!-- <index></index> -->edited within the <productname>eCos</productname> install tree. They arelocated at <filename>include/pkgconf/mlt_*.*</filename>.Where multiple start-up types are in use, it will be necessary toedit multiple linker script fragments and header files. The informationprovided in the header file and the corresponding linker scriptfragment must always match. A typical linker script fragment isshown below:</PARA><EXAMPLE><!-- <index></index> --><TITLE><productname>eCos</productname> linker script fragment</TITLE><PROGRAMLISTING>MEMORY{rom : ORIGIN = 0x40000000, LENGTH = 0x80000ram : ORIGIN = 0x48000000, LENGTH = 0x200000}SECTIONS{SECTIONS_BEGINSECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA)SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)SECTION_rodata1 (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_data (ram, 0x48000000, FOLLOWING (.gcc_except_table))SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)SECTIONS_END}</PROGRAMLISTING></EXAMPLE><PARA>The file consists of two blocks, the <literal>MEMORY</literal> blockcontains lines describing the address (<literal>ORIGIN</literal>)and the size (<literal>LENGTH</literal>) of each memoryregion. The <literal>MEMORY</literal> block is followedby the <literal>SECTIONS</literal> block which containslines describing each of the linker output sections. Each sectionis represented by a macro call. The arguments of these macros areordered as follows: </PARA><ORDEREDLIST><LISTITEM><PARA>The memory region in which the section will finallyreside.</PARA></LISTITEM><LISTITEM><PARA>The final address (<LITERAL>VMA</LITERAL>) of the section. This is expressed using one of the following forms:</PARA><VARIABLELIST><VARLISTENTRY><TERM><EMPHASIS>n</EMPHASIS></TERM><LISTITEM><PARA>at the absolute address specified by theunsigned integer <EMPHASIS>n</EMPHASIS></PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM>ALIGN (<EMPHASIS>n</EMPHASIS>)</TERM><LISTITEM><PARA>following the final location of the previous sectionwith alignment to the next <EMPHASIS>n</EMPHASIS>-byteboundary</PARA></LISTITEM></VARLISTENTRY></VARIABLELIST></LISTITEM><LISTITEM><PARA>The initial address (<LITERAL>LMA</LITERAL>)of the section. This is expressed using one of thefollowing forms:</PARA><VARIABLELIST><VARLISTENTRY><TERM>LMA_EQ_VMA</TERM><LISTITEM><PARA>the <LITERAL>LMA</LITERAL>equals the <LITERAL>VMA</LITERAL> (no relocation)</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM>AT (<EMPHASIS>n</EMPHASIS>)</TERM><LISTITEM><PARA>at the absolute address specified by theunsigned integer <EMPHASIS>n</EMPHASIS></PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM>FOLLOWING (.<EMPHASIS>name</EMPHASIS>)</TERM><LISTITEM><PARA>following the initial location of section<EMPHASIS>name</EMPHASIS></PARA></LISTITEM></VARLISTENTRY></VARIABLELIST></LISTITEM></ORDEREDLIST><PARA>In order to maintain compatibility with linker scriptfragments and header files exported by the<productname>eCos</productname> <APPLICATION>Configuration Tool</APPLICATION>, the useof other expressions within these files is notrecommended.</PARA><PARA>Note that the names of the linker output sections will varybetween target architectures. A description of these sections canbe found in the specific <productname>GCC</productname> documentation foryour architecture.</PARA></SECT1></CHAPTER><CHAPTER id="managing-package-repository"><TITLE>Managing the <!-- <index></index> -->Package Repository</TITLE><PARA>A source distribution of <productname>eCos</productname> consists of a number ofpackages, such as the kernel, the C library, and theµITRON subsystems. These areindividually versioned in the tree structure of the sourcecode, to support distribution on a per-package basis and tosupport third party packages whose versioning systems might bedifferent. The <productname>eCos</productname> <application>PackageAdministration Tool</application> is used to manage theinstallation and removal of packages from a variety of sourceswith potentially multiple versions.</PARA><PARA>The presence of the version information in the source treestructure might be a hindrance to the use of a separate sourcecontrol system such as <EMPHASIS>CVS</EMPHASIS> or<EMPHASIS>SourceSafe</EMPHASIS>. To workin this way, you can rename all the version components to somecommon name (such as “current”) thus unifying thestructure of source trees from distinct <productname>eCos</productname> releases.</PARA><PARA>The <productname>eCos</productname> build system will treat any such name as just anotherversion of the package(s), and support building in exactly the sameway. However, performing this rename invalidates any existing buildtrees that referred to the versioned source tree, so do the renamefirst, before any other work, and do a complete rebuild afterwards.</PARA><SECT1 id="package-installation"><TITLE>Package Installation</TITLE><PARA>Package installation and removal is performed using the<productname>eCos</productname> <application>Package Administration Tool</application>. Thistool is a Tcl script named<command>ecosadmin.tcl</command> which allowsthe user to add new <productname>eCos</productname> packages and new versions ofexisting packages to an <productname>eCos</productname> repository. Such packages mustbe distributed as a single file in the <productname>eCos</productname> packagedistribution format. Unwanted packages may also be removedfrom the repository using this tool. A graphical version ofthe tool is provided as part of the<productname>eCos</productname> <application>Configuration Tool</application>.</PARA><SECT2><TITLE>Using the Administration Tool</TITLE> <PARA>The graphicalversion of the <productname>eCos</productname> <application>PackageAdministration Tool</application>, provided as part of the<productname>eCos</productname> <application>ConfigurationTool</application>, provides functions equivalent to the command-lineversion for those who prefer a Windows-based interface.</PARA><PARA>It may be invoked in one of two ways:</PARA><ITEMIZEDLIST><LISTITEM><PARA>from the <GUIMENU>start menu</GUIMENU> (by default<GUIMENUITEM>Start->Programs->eCos->Package AdministrationTool</GUIMENUITEM>)</PARA><!--<para>XXXXX What is the Windows menu structure now? XXXXX</para>--></LISTITEM><LISTITEM><PARA>from the <productname>eCos</productname> <APPLICATION>ConfigurationTool</APPLICATION> via the<GUIMENUITEM>Tools->Administration</GUIMENUITEM>menu item</PARA></LISTITEM></ITEMIZEDLIST><PARA><GRAPHIC ENTITYREF="graphic31"></GRAPHIC></PARA><PARA>The main window of the tool displays the packages which arecurrently installed in the form of a tree. The installed versionsof each package may be examined by expanding the tree.</PARA><PARA>Packages may be added to the <productname>eCos</productname> repository by clicking onthe <EMPHASIS>Add</EMPHASIS> button. The <productname>eCos</productname> package distributionfile to be added is then selected via a <EMPHASIS>File Open</EMPHASIS> dialogbox.</PARA><PARA>Packages may be removed by selecting a package in the treeand then clicking on the <EMPHASIS>Remove</EMPHASIS> button. Ifa package node is selected, all versions of the selected packagewill be removed. If a package version node is selected, only theselected version of the package will be removed.</PARA></SECT2><SECT2><TITLE>Using the command line</TITLE><PARA>The <command>ecosadmin.tcl</command>script is located in the base of the <productname>eCos</productname> repository. Usea command of the following form under versions ofUNIX:</PARA><SCREEN>$ tclsh ecosadmin.tcl <command></SCREEN><PARA>Under Windows, a command of the following form may be usedat the Cygwin command line prompt:</PARA><SCREEN>$ cygtclsh80 ecosadmin.tcl <command></SCREEN><PARA>The following commands are available:</PARA><VARIABLELIST><VARLISTENTRY><TERM><COMMAND>add <file></COMMAND></TERM><LISTITEM><!-- <index></index> --><PARA>Adds the packages contained with the specified package distributionfile to the <productname>eCos</productname> repository and updates the package database accordingly.By convention, <productname>eCos</productname> package distribution files are given the <filename>.epk</filename> suffix.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>remove <package> [ --version=<version> ]</COMMAND></TERM><!-- <index></index> --><LISTITEM><PARA>Removes the specified package from the <productname>eCos</productname>repository and updates the package databaseaccordingly. Where the optional version qualifier isused, only the specified version of the package isremoved.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY><TERM><COMMAND>list</COMMAND></TERM><!-- <index></index> --><LISTITEM><PARA>Produces a list of the packages whichare currently installed and their versions. Theavailable templates and hardware targets are alsolisted.</PARA></LISTITEM></VARLISTENTRY></VARIABLELIST><PARA>Note that is is possible to remove critical packagessuch as the common HAL package using this tool. Usersshould take care to avoid such errors since core <productname>eCos</productname>packages may only be re-installed in the context of acomplete re-installation of <productname>eCos</productname>.</PARA></SECT2></SECT1><SECT1 id="package-structure"><TITLE>Package Structure</TITLE><PARA>The files in an installed <productname>eCos</productname> source tree are organized ina natural tree structure, grouping together files which work togetherinto <EMPHASIS>Packages</EMPHASIS>. For example, the kernel filesare all together in: </PARA><SIMPLELIST><MEMBER><FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/<replaceable>&Version;</replaceable>/include/</FILENAME></MEMBER><MEMBER> <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/<replaceable>&Version;</replaceable>/src/</FILENAME></MEMBER><MEMBER> <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/<replaceable>&Version;</replaceable>/tests/</FILENAME></MEMBER></SIMPLELIST><PARA>and µITRON compatibility layer files are in:</PARA><SIMPLELIST><MEMBER> <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/<replaceable>&Version;</replaceable>/include/</FILENAME></MEMBER><MEMBER> <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/<replaceable>&Version;</replaceable>/src/</FILENAME></MEMBER><MEMBER> <FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/<replaceable>&Version;</replaceable>/tests/</FILENAME></MEMBER></SIMPLELIST><PARA>The feature of these names which is of interest here isthe <replaceable>&Version;</replaceable> near the end. It may seem odd to place a version number deep in thepath, rather than having something like<FILENAME><REPLACEABLE>BASE_DIR</REPLACEABLE>/<replaceable>&Version;</replaceable>/...everything...</FILENAME>or leaving it up to you to choose a differentinstall-place when a new release of the system arrives.</PARA><PARA>There is a rationale for this organization: asindicated, the kernel and theµITRON compatibility subsystemare examples of software packages. For the first fewreleases of <productname>eCos</productname>, all the packages will move alongin step, i.e. Release 1.3.x will feature Version1.3.x of every package, and so forth. But in future,especially when third party packages become available, it isintended that the package be the unit of softwaredistribution, so it will be possible to build a system froma selection of packages with different version numbers, andeven differing versioning <EMPHASIS>schemes</EMPHASIS>. ATcl script <command>ecosadmin.tcl</command> isprovided in the <productname>eCos</productname> repository to manage the installationand removal of packages in this way.</PARA><PARA>Many users will have their own source code control system,version control system or equivalent, and will want to use it with<productname>eCos</productname> sources. In that case, since a new release of <productname>eCos</productname> comes withdifferent pathnames for all the source files, a bit of work is necessaryto import a new release into your source repository. </PARA><PARA>One way of handling the import is to rename all the versionparts to some common name, for example “current”,and continue to work. “current” is suggested because <command>ecosconfig</command> recognizesit and places it first in any list of versions. In the future, wemay provide a tool to help with this, or an option in the installwizard. Alternatively, in a POSIX shell environment (Linux or Cygwinon Windows) use the following command: </PARA><SCREEN>find . -name <replaceable>&Version;</replaceable> -type d -printf 'mv %p %h/current\n' | sh</SCREEN><PARA>Having carried out such a renaming operation, yoursource tree will now look like this: </PARA><SCREEN><REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/current/include/<REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/current/src/<REPLACEABLE>BASE_DIR</REPLACEABLE>/kernel/current/tests/...<REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/current/include/<REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/current/src/<REPLACEABLE>BASE_DIR</REPLACEABLE>/compat/uitron/current/tests/</SCREEN><PARA>which is a suitable format for import into your ownsource code control system. When you get a subsequentrelease of <productname>eCos</productname>, do the same thing and use your own sourcecode control system to manage the new source base, byimporting the new version from </PARA><SCREEN><REPLACEABLE>NEW_BASE_DIR</REPLACEABLE>/kernel/current/include/</SCREEN><PARA>and so on. </PARA><PARA>The <productname>eCos</productname> build tool will now offer only the“current” version of each package; select thisfor the packages you wish to use. </PARA><PARA>Making such a change has implications for any buildtrees you already have in use. A configured build treecontains information about the selected packages and theirselected versions. Changing the name of the“versioning” folder in the source treeinvalidates this information, and in consequence it alsoinvalidates any local configuration options you have set upin this build tree. So if you want to change the versioninformation in the source tree, do it first, beforeinvesting any serious time in configuring and building yoursystem. When you create a new build tree to deal with thenew source layout, it will contain default settings for allthe configuration options, just like the old build tree didbefore you configured it. You will need to redo thatconfiguration work in the new tree. </PARA><PARA>Moving source code around also invalidates debugging informationin any programs or libraries built from the old tree; these willneed to be rebuilt. </PARA></SECT1></CHAPTER></PART><!-- Keep this comment at the end of the fileLocal variables:mode: sgmlsgml-omittag:nilsgml-shorttag:tsgml-namecase-general:tsgml-general-insert-case:lowersgml-minimize-attributes:nilsgml-always-quote-attributes:tsgml-indent-step:2sgml-indent-data:tsgml-parent-document:("user-guide.sgml" "book" "part")sgml-exposed-tags:nilsgml-local-catalogs:nilsgml-local-ecat-files:nilEnd:-->
Go to most recent revision | Compare with Previous | Blame | View Log
