redboot.sgml

来自「eCos操作系统源码」· SGML 代码 · 共 737 行 · 第 1/3 页

SGML
737
字号
<listitem><para>!! repeats last command.</para></listitem><listitem><para>!<userinput>n</userinput> repeats command <userinput>n</userinput>.</para></listitem><listitem><para>!<userinput>string</userinput> repeats most recent command starting with<userinput>string</userinput>.</para></listitem></itemizedlist></para></sect1><sect1 id="startup-mode"><title>RedBoot Startup Mode</title><para>  <indexterm><primary>RedBoot</primary><secondary>mode</secondary></indexterm>  <indexterm><primary>RedBoot</primary><secondary>startup mode</secondary></indexterm></para><para>RedBoot can normally be configured to run in a number of startupmodes (or just "modes" for short), determining its location ofresidence and execution:<variablelist> <varlistentry><term>ROM mode</term> <listitem><para>In this mode, RedBoot both resides and executes from ROM memory (flash or EPROM). This mode is used when there are limited RAM resources. The flash commands cannot update the region of flash where the RedBoot image resides. In order to update the RedBoot image in flash, it is necessary to run a RAM mode instance of RedBoot.</para></listitem> </varlistentry> <varlistentry><term>ROMRAM mode</term> <listitem><para>In this mode, RedBoot resides in ROM memory (flash or EPROM), but is copied to RAM memory before it starts executing. The RAM footprint is larger than for ROM mode, but there are two advantages to make up for this: it normally runs faster (relevant only on slower boards) and it is able to update the flash region where the image resides.</para></listitem> </varlistentry> <varlistentry><term>RAM mode</term> <listitem><para>In this mode, RedBoot both resides and executes from RAM memory. This is used for updating a primary ROM mode image in situ and sometimes as part of the RedBoot installation on the board when there's already an existing (non-RedBoot) boot monitor available.</para> <para> You can only use ROM and ROMRAM mode images for booting a board - a RAM mode image cannot run unless loaded by another ROM monitor. There is no need for this startup mode if a RedBoot ROMRAM mode image is the primary boot monitor.  When this startup mode is programmed into flash (as a convenience as it's fast to load from flash) it will generally be named as "RedBoot[RAM]" in the FIS directory.  </para></listitem> </varlistentry></variablelist>The chosen mode has influence on flash and RAM resource usage (see<xref linkend="resource-usage">) and the procedure of an in situ updateof RedBoot in flash (see <xref linkend="Updating-Redboot">).</para><para>The startup mode is controlled by the option CYG_HAL_STARTUPwhich resides in the platform HAL. Some platforms provide only some ofthe RAM, ROM, and ROMRAM modes, others provide additionalmodes.</para><para>To see mode of a currently executing RedBoot, issue the<command>version</command> command, which prints the RedBoot banner,including the startup mode (here ROM):<screen>RedBoot><userinput>version</userinput>RedBoot(tm) bootstrap and debug environment <emphasis>[ROM]</emphasis>Non-certified release, version UNKNOWN - built 13:31:57, May 17 2002</screen></para></sect1><sect1 id="resource-usage"><title>RedBoot Resource Usage</title><para>  <indexterm><primary>RedBoot</primary><secondary>resource usage</secondary></indexterm></para><para>RedBoot takes up both flash and RAM resources depending on itsstartup mode and number of enabled features. There are also otherresources used by RedBoot, such as timers. Platform-specific resourcesused by RedBoot are listed in the platform specific parts of thismanual.</para><para>Both flash and RAM resources used by RedBoot depend to somedegree on the features enabled in the RedBoot configuration. It ispossible to reduce in particular the RAM resources used by RedBoot byremoving features that are not needed. Flash resources can also bereduced, but due to the granularity of the flash (the block sizes),reductions in feature size do not always result in flash resourcesavings.</para><sect2><title>Flash Resources</title><para>On many platforms, a ROM mode RedBoot image resides in the firstflash sectors, working as the board's primary boot monitor. On theseplatforms, it is also normal to reserve a similar amount of flash fora secondary RAM mode image, which is used when updating the primaryROM mode image.</para><para>On other platforms, a ROMRAM mode RedBoot image is used as theprimary boot monitor. On these platforms there is not normallyreserved space for a RAM mode RedBoot image, since the ROMRAM modeRedBoot is capable of updating the primary boot monitor image.</para><para>Most platforms also contain a FIS directory (keeping track ofavailable flash space) and a RedBoot config block (containing RedBootboard configuration data).</para><para>To see the amount of reserved flash memory, run the <command>fislist</command> command:<screen>RedBoot> <userinput>fis list</userinput>Name              FLASH addr  Mem addr    Length      Entry pointRedBoot           0x00000000  0x00000000  0x00020000  0x00000000RedBoot[RAM]      0x00020000  0x06020000  0x00020000  0x060213C0RedBoot config    0x0007F000  0x0007F000  0x00001000  0x00000000FIS directory     0x00070000  0x00070000  0x0000F000  0x00000000</screen></para><para>To save flash resources, use a ROMRAM mode RedBoot, or if usinga ROM mode RedBoot, avoid reserving space for the RedBoot[RAM] image(this is done by changing the RedBoot configuration) and download theRAM mode RedBoot whenever it is needed. If the RedBoot image takes upa fraction of an extra flash block, it may be possible to reduce theimage size enough to free this block by removing some features.</para></sect2><sect2><title>RAM Resources</title><para>RedBoot reserves RAM space for its run-time data, and suchthings as CPU exception/interrupt tables. It normally does so at thebottom of the memory map. It may also reserve space at the top of thememory map for configurable RedBoot features such as the net stackand zlib decompression support.</para><para>To see the actual amount of reserved space, issue the<command>version</command> command, which prints the RedBoot banner,including the RAM usage:<screen>RedBoot> <userinput>version</userinput>RedBoot(tm) bootstrap and debug environment [ROM]Non-certified release, version UNKNOWN - built 13:31:57, May 17 2002Platform: FooBar (SH 7615)Copyright (C) 2000, 2001, 2002, Red Hat, Inc.<emphasis>RAM: 0x06000000-0x06080000, 0x06012498-0x06061000 available</emphasis>FLASH: 0x00000000 - 0x00080000, 8 blocks of 0x00010000 bytes each.</screen></para><para>To simplify operations that temporarily need data in freememory, the limits of free RAM are also available as aliases (alignedto the nearest kilo-byte limit). These are named<indexterm><primary>FREEMEMLO</primary></indexterm>FREEMEMLO and<indexterm><primary>FREEMEMHI</primary></indexterm>FREEMEMHI, and canbe used in commands like any user defined alias:<screen>RedBoot> <userinput>load -r -b %{FREEMEMLO} file</userinput>Raw file loaded 0x06012800-0x06013e53, assumed entry at 0x06012800</screen><screen>RedBoot> <userinput>x -b %{FREEMEMHI}</userinput>06061000: 86 F5 EB D8 3D 11 51 F2  96 F4 B2 DC 76 76 8F 77  |....=.Q.....vv.w|06061010: E6 55 DD DB F3 75 5D 15  E0 F3 FC D9 C8 73 1D DA  |.U...u]......s..|</screen></para><para>To reduce RedBoot's RAM resource usage, use a ROM modeRedBoot. The RedBoot features that use most RAM are the net stack, theflash support and the gunzip support. These, and other features, canbe disabled to reduce the RAM footprint, but obviously at the cost oflost functionality.</para></sect2></sect1><sect1 id="Configuring-the-RedBoot-Environment"><title>Configuring the RedBoot Environment</title><para><indexterm><primary>configuring the RedBoot environment</primary><secondary></secondary></indexterm><indexterm><primary>RedBoot </primary><secondary>environment configuration</secondary></indexterm><indexterm><primary>environment configuration</primary></indexterm>Once installed, RedBoot will operate fairly generically. However,there are some features that can be configured for a particular installation.These depend primarily on whether <indexterm><primary>flash and/or networkingsupport</primary></indexterm><indexterm><primary>networking and/or flash support</primary></indexterm>flash and/or networking support are available. The remainderof this discussion assumes that support for both of these options is includedin RedBoot.</para><sect2 id=target-network-configuration><title>Target Network Configuration</title><para><indexterm><primary>target network configuration</primary></indexterm><indexterm><primary>network configuration</primary></indexterm><indexterm><primary>configuration</primary><secondary>secondary</secondary></indexterm>Each node in a networkedsystem needs to have a unique address. Since the network support in RedBootis based on <indexterm><primary>TCP/IP</primary></indexterm>TCP/IP, this addressis an IP (Internet Protocol) address. <indexterm><primary>IP address type</primary></indexterm>There are two ways for a system to &ldquo;know&rdquo;its IP address. First, it can be stored locally on the platform. This is knownas having a static IP address. Second, the system can use the network itselfto discover its IP address. This is known as a dynamic IP address. RedBootsupports this dynamic IP address mode by use of the <indexterm><primary>BOOTP</primary></indexterm>BOOTP (a subset of <indexterm><primary>DHCP</primary></indexterm>DHCP) protocol. In this case, RedBoot will ask the network (actuallysome generic server on the network) for the IP address to use.</para><note><title>NOTE</title><para>Currently, RedBoot only supports BOOTP. In future releases, DHCP mayalso be supported, but such support will be limited to additional data items,not lease-based address allocation.</para></note><para>The choice of <indexterm><primary>IP address type</primary></indexterm>IPaddress type is made via the <indexterm><primary>fconfig command</primary></indexterm><command>fconfig</command> command. Once a selectionis made, it will be stored in flash memory. RedBoot only queries the flashconfiguration information at reset, so any changes will require restartingthe platform.</para><para>Here is an example of the RedBoot <command>fconfig</command>command, showing network addressing:    </para><programlisting>RedBoot> <userinput>fconfig -l</userinput>Run script at boot: falseUse BOOTP for network configuration: falseLocal IP address: 192.168.1.29Default server IP address: 192.168.1.101DNS server IP address: 192.168.1.1GDB connection port: 9000Network debug at boot time: false  </programlisting><para>In this case, the board has been configured with a static IP addresslisted as the Local IP address. The default server IP address specifies whichnetwork node to communicate with for TFTP service. This address can be overriddendirectly in the <indexterm><primary>TFTP commands</primary></indexterm>TFTPcommands.</para><para>The <computeroutput>DNS server IP address</computeroutput> optioncontrols where RedBoot should make DNS lookups<indexterm><primary>DNSlookups</primary></indexterm>. A setting of 0.0.0.0 will disable DNSlookups. The DNS server IP address can also be set at runtime.</para><para>If the selection for <computeroutput>Use BOOTP for network configuration</computeroutput> had been <computeroutput>true</computeroutput>, these IPaddresses would be determined at boot time, via the BOOTP protocol. The final

⌨️ 快捷键说明

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