<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>Editing the Sources</TITLE
|
>Editing the Sources</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos User Guide"
|
TITLE="eCos User Guide"
|
HREF="ecos-user-guide.html"><LINK
|
HREF="ecos-user-guide.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="Manual Configuration"
|
TITLE="Manual Configuration"
|
HREF="manual-configuration.html"><LINK
|
HREF="manual-configuration.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="Editing an eCos Savefile"
|
TITLE="Editing an eCos Savefile"
|
HREF="editing-an-ecos-savefile.html"><LINK
|
HREF="editing-an-ecos-savefile.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="Modifying the Memory Layout"
|
TITLE="Modifying the Memory Layout"
|
HREF="modifying-the-memory-layout.html"></HEAD
|
HREF="modifying-the-memory-layout.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="SECT1"
|
CLASS="SECT1"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos User Guide</TH
|
>eCos User Guide</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="editing-an-ecos-savefile.html"
|
HREF="editing-an-ecos-savefile.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
>Chapter 28. Manual Configuration</TD
|
>Chapter 28. Manual Configuration</TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="modifying-the-memory-layout.html"
|
HREF="modifying-the-memory-layout.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><DIV
|
><DIV
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><H1
|
><H1
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><A
|
><A
|
NAME="EDITING-THE-SOURCES">Editing the Sources</H1
|
NAME="EDITING-THE-SOURCES">Editing the Sources</H1
|
><P
|
><P
|
>For many users, controlling the packages and
|
>For many users, controlling the packages and
|
manipulating the available configuration options will be
|
manipulating the available configuration options will be
|
sufficient to create an embedded operating system that meets
|
sufficient to create an embedded operating system that meets
|
the application's requirements. However, since <SPAN
|
the application's requirements. However, since <SPAN
|
CLASS="PRODUCTNAME"
|
CLASS="PRODUCTNAME"
|
>eCos</SPAN
|
>eCos</SPAN
|
> is
|
> is
|
shipped entirely in source form, it is possible to go
|
shipped entirely in source form, it is possible to go
|
further when necessary: you can edit the <SPAN
|
further when necessary: you can edit the <SPAN
|
CLASS="PRODUCTNAME"
|
CLASS="PRODUCTNAME"
|
>eCos</SPAN
|
>eCos</SPAN
|
> sources themselves. This requires some
|
> sources themselves. This requires some
|
understanding of the way the <SPAN
|
understanding of the way the <SPAN
|
CLASS="PRODUCTNAME"
|
CLASS="PRODUCTNAME"
|
>eCos</SPAN
|
>eCos</SPAN
|
> build system works.
|
> build system works.
|
</P
|
</P
|
><P
|
><P
|
>The most obvious place to edit the source code is directly
|
>The most obvious place to edit the source code is directly
|
in the component repository. For example, you could
|
in the component repository. For example, you could
|
edit the file <TT
|
edit the file <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>kernel/<TT
|
>kernel/<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
><version></I
|
><version></I
|
></TT
|
></TT
|
>/src/sync/mutex.cxx</TT
|
>/src/sync/mutex.cxx</TT
|
>
|
>
|
to change the way kernel mutexes work, or possibly just to add some
|
to change the way kernel mutexes work, or possibly just to add some
|
extra diagnostics or assertions. Once the file has been edited,
|
extra diagnostics or assertions. Once the file has been edited,
|
it is possible to invoke <B
|
it is possible to invoke <B
|
CLASS="COMMAND"
|
CLASS="COMMAND"
|
>make</B
|
>make</B
|
> at
|
> at
|
the top level of the build tree and the target library will be rebuilt
|
the top level of the build tree and the target library will be rebuilt
|
as required. A small optimization is possible: the build tree is
|
as required. A small optimization is possible: the build tree is
|
largely a mirror of the component repository, so it too will contain
|
largely a mirror of the component repository, so it too will contain
|
a subdirectory <TT
|
a subdirectory <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>kernel/<TT
|
>kernel/<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
><version></I
|
><version></I
|
></TT
|
></TT
|
></TT
|
></TT
|
>;
|
>;
|
if make is invoked in this directory
|
if make is invoked in this directory
|
then it will only check for changes to the kernel sources, which
|
then it will only check for changes to the kernel sources, which
|
is a bit more efficient than checking for changes throughout the component
|
is a bit more efficient than checking for changes throughout the component
|
repository. </P
|
repository. </P
|
><P
|
><P
|
>Editing a file in the component repository is fine if this
|
>Editing a file in the component repository is fine if this
|
tree is used for only one <SPAN
|
tree is used for only one <SPAN
|
CLASS="PRODUCTNAME"
|
CLASS="PRODUCTNAME"
|
>eCos</SPAN
|
>eCos</SPAN
|
> configuration. If the repository
|
> configuration. If the repository
|
is used for several different configurations, however, and especially
|
is used for several different configurations, however, and especially
|
if it is shared by multiple users, then making what may be experimental
|
if it is shared by multiple users, then making what may be experimental
|
changes to the master sources would be a bad idea. The build system provides
|
changes to the master sources would be a bad idea. The build system provides
|
an alternative. It is possible to make a copy of the file in the
|
an alternative. It is possible to make a copy of the file in the
|
build tree, in other words copy <TT
|
build tree, in other words copy <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>mutex.cxx</TT
|
>mutex.cxx</TT
|
> from
|
> from
|
the <TT
|
the <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>kernel/<TT
|
>kernel/<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
><version></I
|
><version></I
|
></TT
|
></TT
|
>/src/sync</TT
|
>/src/sync</TT
|
> directory
|
> directory
|
in the component repository to <TT
|
in the component repository to <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>kernel/<TT
|
>kernel/<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
><version></I
|
><version></I
|
></TT
|
></TT
|
>/src/sync</TT
|
>/src/sync</TT
|
> in
|
> in
|
the build tree, and edit the file in the build tree. When <B
|
the build tree, and edit the file in the build tree. When <B
|
CLASS="COMMAND"
|
CLASS="COMMAND"
|
>make</B
|
>make</B
|
> is
|
> is
|
invoked it will pick up local copies of any of the sources in preference
|
invoked it will pick up local copies of any of the sources in preference
|
to the master versions in the component repository. Once you have
|
to the master versions in the component repository. Once you have
|
finished modifying the <SPAN
|
finished modifying the <SPAN
|
CLASS="PRODUCTNAME"
|
CLASS="PRODUCTNAME"
|
>eCos</SPAN
|
>eCos</SPAN
|
> sources you can install the final version
|
> sources you can install the final version
|
back in the component repository. If the changes were temporary
|
back in the component repository. If the changes were temporary
|
in nature and only served to aid the debugging process, then you
|
in nature and only served to aid the debugging process, then you
|
can discard the modified version of the sources. </P
|
can discard the modified version of the sources. </P
|
><P
|
><P
|
>The situation is slightly more complicated for the header
|
>The situation is slightly more complicated for the header
|
files that a package may export, such as the C library’s <TT
|
files that a package may export, such as the C library’s <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>stdio.h</TT
|
>stdio.h</TT
|
> header
|
> header
|
file, which can be found in the directory <TT
|
file, which can be found in the directory <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>language/c/libc/<TT
|
>language/c/libc/<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
><version></I
|
><version></I
|
></TT
|
></TT
|
>/include</TT
|
>/include</TT
|
>.
|
>.
|
If such a header file is changed, either directly in the component
|
If such a header file is changed, either directly in the component
|
repository or after copying it to the build tree, then <B
|
repository or after copying it to the build tree, then <B
|
CLASS="COMMAND"
|
CLASS="COMMAND"
|
>make</B
|
>make</B
|
> must
|
> must
|
be invoked at the top level of the build tree. In cases like this
|
be invoked at the top level of the build tree. In cases like this
|
it is not safe to rebuild just the C library because other packages
|
it is not safe to rebuild just the C library because other packages
|
may depend on the contents of <TT
|
may depend on the contents of <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>stdio.h</TT
|
>stdio.h</TT
|
>. </P
|
>. </P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="editing-an-ecos-savefile.html"
|
HREF="editing-an-ecos-savefile.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-user-guide.html"
|
HREF="ecos-user-guide.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="modifying-the-memory-layout.html"
|
HREF="modifying-the-memory-layout.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>Editing an <SPAN
|
>Editing an <SPAN
|
CLASS="PRODUCTNAME"
|
CLASS="PRODUCTNAME"
|
>eCos</SPAN
|
>eCos</SPAN
|
> Savefile</TD
|
> Savefile</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="manual-configuration.html"
|
HREF="manual-configuration.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>Modifying the Memory Layout</TD
|
>Modifying the Memory Layout</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|