📄 overview.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Overview</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="The eCos Component Writer's Guide"HREF="cdl-guide.html"><LINKREL="PREVIOUS"TITLE="The eCos Component Writer's Guide"HREF="cdl-guide.html"><LINKREL="NEXT"TITLE="Why Configurability?"HREF="overview.configurability.html"></HEAD><BODYCLASS="CHAPTER"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">The <SPANCLASS="APPLICATION">eCos</SPAN> Component Writer's Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="cdl-guide.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="overview.configurability.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="OVERVIEW">Chapter 1. Overview</H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT><AHREF="overview.html#OVERVIEW.TERMINOLOGY">Terminology</A></DT><DT><AHREF="overview.configurability.html">Why Configurability?</A></DT><DT><AHREF="overview.approaches.html">Approaches to Configurability</A></DT><DT><AHREF="overview.degress.html">Degrees of Configurability</A></DT><DT><AHREF="overview.warning.html">Warnings</A></DT></DL></DIV><P><SPANCLASS="APPLICATION">eCos</SPAN> was designed from the very beginning as a configurablecomponent architecture. The core <SPANCLASS="APPLICATION">eCos</SPAN> system consists of a number ofdifferent components such as the kernel, the C library, aninfrastructure package. Each of these provides a large number ofconfiguration options, allowing application developers to build asystem that matches the requirements of their particular application.To manage the potential complexity of multiple components and lots ofconfiguration options, <SPANCLASS="APPLICATION">eCos</SPAN> comes with a component framework: acollection of tools specifically designed to support configuringmultiple components. Furthermore this component framework isextensible, allowing additional components to be added to the systemat any time.</P><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="OVERVIEW.TERMINOLOGY">Terminology</H1><P>The <SPANCLASS="APPLICATION">eCos</SPAN> component architecture involves a number of key concepts.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="CONCEPTS.TERMINOLOGY.FRAMEWORK">Component Framework</H2><P>The phrase <SPANCLASS="phrase"><SPANCLASS="PHRASE">component framework</SPAN></SPAN> is used to describethe collection of tools that allow users to configure a system andadminister a component repository. This includes the <SPANCLASS="APPLICATION">ecosconfig</SPAN> command line tool, thegraphical configuration tool, and the package administration tool.Both the command line and graphical tools are based on a singleunderlying library, the <SPANCLASS="APPLICATION">CDL</SPAN> library.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="CONCEPTS.TERMINOLOGY.OPTION">Configuration Option</H2><P>The option is the basic unit of configurability. Typically each optioncorresponds to a single choice that a user can make. For example thereis an option to control whether or not assertions are enabled, and thekernel provides an option corresponding to the number of schedulingpriority levels in the system. Options can control very small amountsof code such as whether or not the C library's<TTCLASS="FUNCTION">strtok</TT> gets inlined. They can also control quitelarge amounts of code, for example whether or not the<TTCLASS="FUNCTION">printf</TT> supports floating point conversions.</P><P>Many options are straightforward, and the user only gets to choosewhether the option is enabled or disabled. Some options are morecomplicated, for example the number of scheduling priority levels is anumber that should be within a certain range. Options should alwaysstart off with a sensible default setting, so that it is not necessaryfor users to make hundreds of decisions before any work can start ondeveloping the application. Once the application is running thevarious configuration options can be used to tune the system for thespecific needs of the application.</P><P>The component framework allows for options that are not directlyuser-modifiable. Consider the case of processor endianness: someprocessors are always big-endian or always little-endian, while withother processors there is a choice. Depending on the user's choice oftarget hardware, endianness may or may not be user-modifiable.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="CONCEPTS.TERMINOLOGY.COMPONENT">Component</H2><P>A component is a unit of functionality such as a particular kernelscheduler or a device driver for a specific device. A component isalso a configuration option in that users may want to enableor disable all the functionality in a component. For example, if aparticular device on the target hardware is not going to be used bythe application, directly or indirectly, then there is no point inhaving a device driver for it. Furthermore disabling the device drivershould reduce the memory requirements for both code and data.</P><P>Components may contain further configuration options. In the case of adevice driver, there may be options to control the exact behavior ofthat driver. These will of course be irrelevant if the driver as awhole is disabled. More generally options and components live in ahierarchy, where any component can contain options specific to thatcomponent and further sub-components. It is possible to view theentire <SPANCLASS="APPLICATION">eCos</SPAN> kernel as one big component, containing sub-componentsfor scheduling, exception handling, synchronization primitives, and soon. The synchronization primitives component can contain furthersub-components for mutexes, semaphores, condition variables, eventflags, and so on. The mutex component can contain configurationoptions for issues like priority inversion support.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="CONCEPTS.TERMINOLOGY.PACKAGE">Package</H2><P>A package is a special type of component. Specifically, a package isthe unit of distribution of components. It is possible to create adistribution file for a package containing all of the source code,header files, documentation, and other relevant files. Thisdistribution file can then be installed using the appropriate tool.Afterwards it is possible to uninstall that package, or to install alater version. The core <SPANCLASS="APPLICATION">eCos</SPAN> distribution comes with a number ofpackages such as the kernel and the infrastructure. Other packagessuch as network stacks can come from various different sources and canbe installed alongside the core distribution.</P><P>Packages can be enabled or disabled, but the user experience is alittle bit different. Generally it makes no sense for the tools toload the details of every single package that has been installed. Forexample, if the target hardware uses an ARM processor then there is nopoint in loading the HAL packages for other architectures anddisplaying choices to the user which are not relevant. Thereforeenabling a package means loading its configuration data into theappropriate tool, and disabling a package is an unload operation. Inaddition, packages are not just enabled or disabled: it is alsopossible to select the particular version of a package that should beused.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="CONCEPTS.TERMINOLOGY.CONFIGURATION">Configuration</H2><P>A configuration is a collection of user choices. The varioustools that make up the component framework deal with entireconfigurations. Users can create a new configuration, output asavefile (by default <TTCLASS="FILENAME">ecos.ecc</TT>), manipulate aconfiguration, and use a configuration to generate a build tree priorto building <SPANCLASS="APPLICATION">eCos</SPAN> and any other packages that have been selected.A configuration includes details such as which packages have beenselected, in addition to finer-grained information such as whichoptions in those packages have been enabled or disabled by the user. </P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="CONCEPTS.TERMINOLOGY.TARGET">Target</H2><P>The target is the specific piece of hardware on which the application
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -