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

📄 editing-the-sources.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 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>Editing the Sources</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos User Guide"HREF="ecos-user-guide.html"><LINKREL="UP"TITLE="Manual Configuration"HREF="manual-configuration.html"><LINKREL="PREVIOUS"TITLE="Editing an eCos Savefile"HREF="editing-an-ecos-savefile.html"><LINKREL="NEXT"TITLE="Modifying the Memory Layout"HREF="modifying-the-memory-layout.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos User Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="editing-an-ecos-savefile.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 28. Manual Configuration</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="modifying-the-memory-layout.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="EDITING-THE-SOURCES">Editing the Sources</H1><P>For many users, controlling the packages and	  manipulating the available configuration options will be	  sufficient to create an embedded operating system that meets	  the application's requirements. However, since <SPANCLASS="PRODUCTNAME">eCos</SPAN> is	  shipped entirely in source form, it is possible to go	  further when necessary: you can edit the <SPANCLASS="PRODUCTNAME">eCos</SPAN> sources themselves. This requires some	  understanding of the way the <SPANCLASS="PRODUCTNAME">eCos</SPAN> build system works.	</P><P>The most obvious place to edit the source code is directlyin the component repository. For example, you couldedit the file <TTCLASS="FILENAME">kernel/<TTCLASS="REPLACEABLE"><I>&#60;version&#62;</I></TT>/src/sync/mutex.cxx</TT>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 <BCLASS="COMMAND">make</B> 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 <TTCLASS="FILENAME">kernel/<TTCLASS="REPLACEABLE"><I>&#60;version&#62;</I></TT></TT>;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. </P><P>Editing a file in the component repository is fine if thistree is used for only one <SPANCLASS="PRODUCTNAME">eCos</SPAN> 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 <TTCLASS="FILENAME">mutex.cxx</TT> fromthe <TTCLASS="FILENAME">kernel/<TTCLASS="REPLACEABLE"><I>&#60;version&#62;</I></TT>/src/sync</TT> directoryin the component repository to <TTCLASS="FILENAME">kernel/<TTCLASS="REPLACEABLE"><I>&#60;version&#62;</I></TT>/src/sync</TT> inthe build tree, and edit the file in the build tree. When <BCLASS="COMMAND">make</B> 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 <SPANCLASS="PRODUCTNAME">eCos</SPAN> 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. </P><P>The situation is slightly more complicated for the headerfiles that a package may export, such as the C library&#8217;s <TTCLASS="FILENAME">stdio.h</TT> headerfile, which can be found in the directory <TTCLASS="FILENAME">language/c/libc/<TTCLASS="REPLACEABLE"><I>&#60;version&#62;</I></TT>/include</TT>.If such a header file is changed, either directly in the componentrepository or after copying it to the build tree, then <BCLASS="COMMAND">make</B> 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 <TTCLASS="FILENAME">stdio.h</TT>. </P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="editing-an-ecos-savefile.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-user-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="modifying-the-memory-layout.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Editing an <SPANCLASS="PRODUCTNAME">eCos</SPAN> Savefile</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="manual-configuration.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Modifying the Memory Layout</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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