📄 rebuilding-redboot.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>Rebuilding RedBoot</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="RedBoot™ User's Guide"HREF="redboot.html"><LINKREL="PREVIOUS"TITLE="exec"HREF="exec-command.html"><LINKREL="NEXT"TITLE="Updating RedBoot"HREF="updating-redboot.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">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="exec-command.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="updating-redboot.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="REBUILDING-REDBOOT">Chapter 3. Rebuilding RedBoot</H1><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN4673">Introduction</H1><P> RedBoot is built as an application on top of eCos. The makefile rulesfor building RedBoot are part of the eCos CDL package, so it'spossible to build eCos from the <SPANCLASS="APPLICATION">ConfigurationTool</SPAN>, as well as from the command line using<SPANCLASS="APPLICATION">ecosconfig</SPAN>.</P><P>Building RedBoot requires only a few steps: selecting theplatform and the RedBoot template, importing a platform specificconfiguration file, and finally starting the build.</P><P>The platform specific configuration file makes sure the settingsare correct for building RedBoot on the given platform. Each platformshould provide at least two of these configuration files:<TTCLASS="FILENAME">redboot_RAM.ecm</TT> for a RAM mode RedBootconfiguration and <TTCLASS="FILENAME">redboot_ROM.ecm</TT> or<TTCLASS="FILENAME">redboot_ROMRAM.ecm</TT> for a ROM or ROMRAM modeRedBoot configuration. There may be additionalconfiguration files according to the requirements of the particularplatform.</P><P>The RedBoot build process results in a number of files in theinstall <TTCLASS="FILENAME">bin</TT> directory. The ELFfile <TTCLASS="FILENAME">redboot.elf</TT> is the pricipalresult. Depending on the platform CDL, there will also be generatedversions of RedBoot in other file formats, such as<TTCLASS="FILENAME">redboot.bin</TT> (binary format, good when doing anupdate of a primary RedBoot image, see <AHREF="updating-redboot.html#UPDATE-PRIMARY-IMAGE">the Section called <I>Update the primary RedBoot flash image</I> in Chapter 4</A>), <TTCLASS="FILENAME">redboot.srec</TT>(Motorola S-record format, good when downloading a RAM mode image forexecution), and <TTCLASS="FILENAME">redboot.img</TT> (stripped ELF format,good when downloading a RAM mode image for execution, smaller than the.srec file). Some platforms may provide additional file formats andalso relocate some of these files to aparticular address making them more suitable for downloading using adifferent boot monitor or flash programming tools.</P><P>The platform specific information in <AHREF="installation-and-testing.html">Chapter 5</A> should be consulted, as there maybe other special instructions required to build RedBoot for particularplatforms.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4697">Rebuilding RedBoot using <SPANCLASS="APPLICATION">ecosconfig</SPAN></H2><P>To rebuild RedBoot using the<SPANCLASS="APPLICATION">ecosconfig</SPAN> tool, create a temporarydirectory for building RedBoot, name it according to the desiredconfiguration of RedBoot, here RAM:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>mkdir /tmp/redboot_RAM</B></TT>$ <TTCLASS="USERINPUT"><B>cd /tmp/redboot_RAM</B></TT></PRE></TD></TR></TABLE></P><P>Create the build tree according to the chosen platform, hereusing the Hitachi Solution Engine 7751 board asan example:<DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>It is assumed that the environment variableECOS_REPOSITORY points to the eCos/RedBoot source tree.</P></BLOCKQUOTE></DIV><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>ecosconfig new se7751 redboot</B></TT>U CYGPKG_HAL_SH_7750, new inferred value 0U CYGPKG_HAL_SH_7751, new inferred value 1U CYGHWR_HAL_SH_IRQ_USE_IRQLVL, new inferred value 1U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0U CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM, new inferred value 0U CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS, new inferred value 1U CYGFUN_LIBC_STRING_BSD_FUNCS, new inferred value 0U CYGPKG_NS_DNS_BUILD, new inferred value 0</PRE></TD></TR></TABLE>Replace the platform name ("se7751") with the appropriate name for thechosen platform.</P><P>Then import the appropriate platform RedBoot configuration file,here for RAM configuration:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>ecosconfig import <TTCLASS="FILENAME">${ECOS_REPOSITORY}/hal/sh/se7751/<TTCLASS="REPLACEABLE"><I>VERSION</I></TT>/misc/redboot_RAM.ecm</TT></B></TT>$ <TTCLASS="USERINPUT"><B>ecosconfig tree</B></TT></PRE></TD></TR></TABLE>Replace architecture ("sh"), platform ("se7751") and version("<TTCLASS="REPLACEABLE"><I>VERSION</I></TT>") with those appropriate for thechosen platform and the version number of its HAL package. Alsoreplace the configuration name ("redboot_RAM.ecm") with that of theappropriate configuration file.</P><P>RedBoot can now be built:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>make</B></TT></PRE></TD></TR></TABLE></P><P>The resulting RedBoot files will be in the associatedinstall directory, in this example, <TTCLASS="FILENAME">./install/bin</TT>.</P><P>In <AHREF="installation-and-testing.html">Chapter 5</A> each platform'sdetails are described in the form of shell variables. Using those,the steps to build RedBoot are:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">export REDBOOT_CFG=redboot_ROMexport VERSION=<TTCLASS="REPLACEABLE"><I>VERSION</I></TT>mkdir /tmp/${REDBOOT_CFG}cd /tmp/${REDBOOT_CFG}ecosconfig new ${TARGET} redbootecosconfig import ${ECOS_REPOSITORY}/hal/${ARCH_DIR}/${PLATFORM_DIR}/${VERSION}/misc/${REDBOOT_CFG}.ecmecosconfig treemake</PRE></TD></TR></TABLE>To build for another configuration, simply change the<TTCLASS="REPLACEABLE"><I>REDBOOT_CFG</I></TT> definition accordingly. Alsomake sure the <TTCLASS="REPLACEABLE"><I>VERSION</I></TT> variable matches theversion of the platform package.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4728">Rebuilding RedBoot from the <SPANCLASS="APPLICATION">Configuration Tool</SPAN></H2><P>To rebuild RedBoot from the <SPANCLASS="APPLICATION">ConfigurationTool</SPAN>, open the template window (<SPANCLASS="GUIMENUITEM">Build->Templates</SPAN>) andselect the appropriate Hardware target and in Packages select"redboot". Then press OK. Depending on the platform, a number ofconflicts may need to be resolved before the build can be started;select "Continue".</P><P>Import the desired RedBoot configuration file from the platform HAL(<SPANCLASS="GUIMENUITEM">File->Import...</SPAN>). Depending on the platform, a number ofconflicts may need to be resolved before the build can be started;select "Continue". For example, if the platform selected is HitachiSE7751 board and the RAM configuration RedBoot should be built, importthe file<TTCLASS="FILENAME">hal/sh/se7751/<TTCLASS="REPLACEABLE"><I>VERSION</I></TT>/misc/redboot_RAM.ecm</TT>.</P><P>Save the configuration somewhere suitable with enough disk spacefor building RedBoot (<SPANCLASS="GUIMENUITEM">File->Save...</SPAN>). Choose the name according tothe RedBoot configuration, for example<TTCLASS="FILENAME">redboot_RAM.ecc</TT>.</P><P>Then start the build (<SPANCLASS="GUIMENUITEM">Build->Library</SPAN>) and wait for it tocomplete. The resulting RedBoot files will be in the associatedinstall directory, for the example this would be <TTCLASS="FILENAME">redboot_RAM_install/bin</TT>.</P><P>As noted above, each platform's details are described in <AHREF="installation-and-testing.html">Chapter 5</A>. Use the information provided inthe shell variables to find the configuration file - the path to it is<TTCLASS="FILENAME">${ECOS_REPOSITORY}/hal/${ARCH_DIR}/${PLATFORM_DIR}/${VERSION}/misc/${REDBOOT_CFG}.ecm</TT>,where <TTCLASS="REPLACEABLE"><I>ECOS_REPOSITORY</I></TT> points to theeCos/RedBoot sources, <TTCLASS="REPLACEABLE"><I>VERSION</I></TT> is theversion of the package (usually "current") and<TTCLASS="REPLACEABLE"><I>REDBOOT_CFG</I></TT> is the desired configuration,e.g. redboot_RAM.</P></DIV></DIV></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="exec-command.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="updating-redboot.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">exec</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="redboot.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Updating RedBoot</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -