?? 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">
<META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="The eCos Component Writer's Guide"
HREF="cdl-guide.html"><LINK
REL="PREVIOUS"
TITLE="The eCos Component Writer's Guide"
HREF="cdl-guide.html"><LINK
REL="NEXT"
TITLE="Why Configurability?"
HREF="overview.configurability.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> Component Writer's Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="cdl-guide.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="overview.configurability.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="OVERVIEW">Chapter 1. Overview</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="overview.html#OVERVIEW.TERMINOLOGY"
>Terminology</A
></DT
><DT
><A
HREF="overview.configurability.html"
>Why Configurability?</A
></DT
><DT
><A
HREF="overview.approaches.html"
>Approaches to Configurability</A
></DT
><DT
><A
HREF="overview.degress.html"
>Degrees of Configurability</A
></DT
><DT
><A
HREF="overview.warning.html"
>Warnings</A
></DT
></DL
></DIV
><P
><SPAN
CLASS="APPLICATION"
>eCos</SPAN
> was designed from the very beginning as a configurable
component architecture. The core <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> system consists of a number of
different components such as the kernel, the C library, an
infrastructure package. Each of these provides a large number of
configuration options, allowing application developers to build a
system that matches the requirements of their particular application.
To manage the potential complexity of multiple components and lots of
configuration options, <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> comes with a component framework: a
collection of tools specifically designed to support configuring
multiple components. Furthermore this component framework is
extensible, allowing additional components to be added to the system
at any time.</P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="OVERVIEW.TERMINOLOGY">Terminology</H1
><P
>The <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> component architecture involves a number of key concepts.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONCEPTS.TERMINOLOGY.FRAMEWORK">Component Framework</H2
><P
>The phrase <SPAN
CLASS="phrase"
><SPAN
CLASS="PHRASE"
>component framework</SPAN
></SPAN
> is used to describe
the collection of tools that allow users to configure a system and
administer a component repository. This includes the <SPAN
CLASS="APPLICATION"
>ecosconfig</SPAN
> command line tool, the
graphical configuration tool, and the package administration tool.
Both the command line and graphical tools are based on a single
underlying library, the <SPAN
CLASS="APPLICATION"
>CDL</SPAN
> library.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONCEPTS.TERMINOLOGY.OPTION">Configuration Option</H2
><P
>The option is the basic unit of configurability. Typically each option
corresponds to a single choice that a user can make. For example there
is an option to control whether or not assertions are enabled, and the
kernel provides an option corresponding to the number of scheduling
priority levels in the system. Options can control very small amounts
of code such as whether or not the C library's
<TT
CLASS="FUNCTION"
>strtok</TT
> gets inlined. They can also control quite
large amounts of code, for example whether or not the
<TT
CLASS="FUNCTION"
>printf</TT
> supports floating point conversions.</P
><P
>Many options are straightforward, and the user only gets to choose
whether the option is enabled or disabled. Some options are more
complicated, for example the number of scheduling priority levels is a
number that should be within a certain range. Options should always
start off with a sensible default setting, so that it is not necessary
for users to make hundreds of decisions before any work can start on
developing the application. Once the application is running the
various configuration options can be used to tune the system for the
specific needs of the application.</P
><P
>The component framework allows for options that are not directly
user-modifiable. Consider the case of processor endianness: some
processors are always big-endian or always little-endian, while with
other processors there is a choice. Depending on the user's choice of
target hardware, endianness may or may not be user-modifiable.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONCEPTS.TERMINOLOGY.COMPONENT">Component</H2
><P
>A component is a unit of functionality such as a particular kernel
scheduler or a device driver for a specific device. A component is
also a configuration option in that users may want to enable
or disable all the functionality in a component. For example, if a
particular device on the target hardware is not going to be used by
the application, directly or indirectly, then there is no point in
having a device driver for it. Furthermore disabling the device driver
should reduce the memory requirements for both code and data.</P
><P
>Components may contain further configuration options. In the case of a
device driver, there may be options to control the exact behavior of
that driver. These will of course be irrelevant if the driver as a
whole is disabled. More generally options and components live in a
hierarchy, where any component can contain options specific to that
component and further sub-components. It is possible to view the
entire <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> kernel as one big component, containing sub-components
for scheduling, exception handling, synchronization primitives, and so
on. The synchronization primitives component can contain further
sub-components for mutexes, semaphores, condition variables, event
flags, and so on. The mutex component can contain configuration
options for issues like priority inversion support.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONCEPTS.TERMINOLOGY.PACKAGE">Package</H2
><P
>A package is a special type of component. Specifically, a package is
the unit of distribution of components. It is possible to create a
distribution file for a package containing all of the source code,
header files, documentation, and other relevant files. This
distribution file can then be installed using the appropriate tool.
Afterwards it is possible to uninstall that package, or to install a
later version. The core <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> distribution comes with a number of
packages such as the kernel and the infrastructure. Other packages
such as network stacks can come from various different sources and can
be installed alongside the core distribution.</P
><P
>Packages can be enabled or disabled, but the user experience is a
little bit different. Generally it makes no sense for the tools to
load the details of every single package that has been installed. For
example, if the target hardware uses an ARM processor then there is no
point in loading the HAL packages for other architectures and
displaying choices to the user which are not relevant. Therefore
enabling a package means loading its configuration data into the
appropriate tool, and disabling a package is an unload operation. In
addition, packages are not just enabled or disabled: it is also
possible to select the particular version of a package that should be
used.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONCEPTS.TERMINOLOGY.CONFIGURATION">Configuration</H2
><P
>A configuration is a collection of user choices. The various
tools that make up the component framework deal with entire
configurations. Users can create a new configuration, output a
savefile (by default <TT
CLASS="FILENAME"
>ecos.ecc</TT
>), manipulate a
configuration, and use a configuration to generate a build tree prior
to building <SPAN
CLASS="APPLICATION"
>eCos</SPAN
> and any other packages that have been selected.
A configuration includes details such as which packages have been
selected, in addition to finer-grained information such as which
options in those packages have been enabled or disabled by the user. </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="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 + -