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

📄 persistent-state-flash.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>Persistent State Flash-based Configuration and Control</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 Commands and Examples"HREF="redboot-commands-and-examples.html"><LINKREL="PREVIOUS"TITLE="fis write"HREF="fis-write-command.html"><LINKREL="NEXT"TITLE="Executing Programs from RedBoot"HREF="executing-programs.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 Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="fis-write-command.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 2. RedBoot Commands and Examples</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="executing-programs.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="PERSISTENT-STATE-FLASH">Persistent State Flash-based Configuration and Control</H1><P></P><P>RedBoot provides flash management support for storage in the flash memoryof multiple executable images and of non-volatile information such as IP addressesand other network information.</P><P>RedBoot on platforms that support flash based configuration informationwill report the following message the first time that RedBoot is booted onthe target:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">flash configuration checksum error or invalid key</PRE></TD></TR></TABLE><P>This error can be ignored if no flash based configuration is desired,or can be silenced by running the <BCLASS="COMMAND">fconfig</B>command as described below. At this point you may also wish to run the <BCLASS="COMMAND">fis init</B> command. See other fis commands in <AHREF="flash-image-system.html">the Section called <I>Flash Image System (FIS)</I></A>.</P><P>Certain control and configuration information used by RedBoot can bestored in flash. </P><P>The details of what information is maintained in flash differ, basedon the platform and the configuration. However, the basic operation used tomaintain this information is the same. Using the <BCLASS="COMMAND">fconfig -l</B> command, the information may be displayed and/or changed.</P><P>If the optional flag <TTCLASS="COMPUTEROUTPUT">-i</TT> is specified,then the configuration database will be reset to its defaultstate. This is also needed the first time RedBoot is installed on thetarget, or when updating to a newer RedBoot with differentconfiguration keys.</P><P>If the optional flag <TTCLASS="COMPUTEROUTPUT">-l</TT> is specified,the configuration data is simply listed. Otherwise, each configuration parameterwill be displayed and you are given a chance to change it. The entire valuemust be typed - typing just carriage return will leave a value unchanged.Boolean values may be entered using the first letter (<TTCLASS="COMPUTEROUTPUT">t</TT>for true, <TTCLASS="COMPUTEROUTPUT">f</TT> for false). At any time the editingprocess may be stopped simply by entering a period (.) on the line. Enteringthe caret (^) moves the editing back to the previous item. See &#8220;RedBootEditing Commands&#8221;, <AHREF="redboot-editing-commands.html">the Section called <I>RedBoot Editing Commands</I> in Chapter 1</A>. </P><P>If any changes are made in the configuration, then the updated datawill be written back to flash after getting acknowledgment from the user.</P><P>If the optional flag <TTCLASS="COMPUTEROUTPUT">-n</TT> is specified(with or without <TTCLASS="COMPUTEROUTPUT">-l</TT>) then &#8220;nicknames&#8221;of the entries are used.  These are shorter and less descriptive than&#8220;full&#8221; names.  The full name may also be displayed by adding the<TTCLASS="COMPUTEROUTPUT">-f</TT> flag.</P><P>The reason for telling you nicknames is that a quick way to set a singleentry is provided, using the format<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">  RedBoot&#62; <TTCLASS="USERINPUT"><B>fconfig <TTCLASS="REPLACEABLE"><I>nickname</I></TT> <TTCLASS="REPLACEABLE"><I>value</I></TT></B></TT></PRE></TD></TR></TABLE>If novalue is supplied, the command will list and prompt for only that entry.If a value is supplied, then the entry will be set to that value.  You willbe prompted whether to write the new information into flash if any changewas made.  For example<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">  RedBoot&#62; <TTCLASS="USERINPUT"><B>fconfig -l -n</B></TT>  boot_script: false  bootp: false  bootp_my_ip: 10.16.19.176  bootp_server_ip: 10.16.19.66  dns_ip: 10.16.19.1  gdb_port: 9000  net_debug: false  RedBoot&#62; <TTCLASS="USERINPUT"><B>fconfig bootp_my_ip 10.16.19.177</B></TT>  bootp_my_ip: 10.16.19.176 Setting to 10.16.19.177  Update RedBoot non-volatile configuration - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>  ... Unlock from 0x507c0000-0x507e0000: .  ... Erase from 0x507c0000-0x507e0000: .  ... Program from 0x0000a8d0-0x0000acd0 at 0x507c0000: .  ... Lock from 0x507c0000-0x507e0000: .  RedBoot&#62;</PRE></TD></TR></TABLE></P><P>Additionally, nicknames can be used like aliases via the format %{nickname}.This allows the values stored by <TTCLASS="USERINPUT"><B>fconfig</B></TT> to be useddirectly by scripts and commands.</P><P>Depending on how your terminal program is connected and itscapabilities, you might find that you are unable to use line-editing todelete the &#8216;old&#8217; value when using the default behaviour of<BCLASS="COMMAND">fconfig <TTCLASS="REPLACEABLE"><I>nickname</I></TT></B> or justplain <BCLASS="COMMAND">fconfig</B>, as shown in this example:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fco bootp</B></TT>bootp: false&#0095;</PRE></TD></TR></TABLE>The user deletes the word &#8220;false;&#8221; and enters &#8220;true&#8221;so the display looks like this:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fco bootp</B></TT>bootp: <TTCLASS="USERINPUT"><B>true</B></TT>Update RedBoot non-volatile configuration - continue (y/n)? y... Unlock from ...RedBoot&#62; &#0095;</PRE></TD></TR></TABLE></P><P>To edit when you cannot backspace, use the optional flag<TTCLASS="COMPUTEROUTPUT">-d</TT> (for &#8220;dumb terminal&#8221;)to provide a simpler interface thus:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fco -d bootp</B></TT>bootp: false ? &#0095;</PRE></TD></TR></TABLE>and you enter the value in the obvious manner thus:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fco -d bootp</B></TT>bootp: false ? <TTCLASS="USERINPUT"><B>true</B></TT>Update RedBoot non-volatile configuration - continue (y/n)? y... Unlock from ...RedBoot&#62; &#0095;</PRE></TD></TR></TABLE></P><P>One item which is always present in the configuration data is the abilityto execute a script at boot time. A sequence of RedBoot commands can be enteredwhich will be executed when the system starts up. Optionally, a time-out periodcan be provided which allows the user to abort the startup script and proceedwith normal command processing from the console.     </P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fconfig -l</B></TT>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</PRE></TD></TR></TABLE></P><P>The following example sets a boot script and then shows it running.    </P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fconfig</B></TT>Run script at boot: false <TTCLASS="USERINPUT"><B>t</B></TT>      Boot script:Enter script, terminate with empty line&#62;&#62; <TTCLASS="USERINPUT"><B>fi li</B></TT>    Boot script timeout: 0 <TTCLASS="USERINPUT"><B>10</B></TT>Use BOOTP for network configuration: false .Update RedBoot non-volatile configuration - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>... Erase from 0xa0fc0000-0xa0fe0000: .... Program from 0x8c021f60-0x8c022360 at 0xa0fc0000: .RedBoot&#62;RedBoot(tm) debug environment - built 08:22:24, Aug 23 2000Copyright (C) 2000, Red Hat, Inc.RAM: 0x8c000000-0x8c800000flash: 0xa0000000 - 0xa1000000, 128 blocks of 0x00020000 bytes ea.Socket Communications, Inc: Low Power Ethernet CF Revision C \5V/3.3V 08/27/98 IP: 192.168.1.29, Default server: 192.168.1.101 \== Executing boot script in 10 seconds - enter ^C to abortRedBoot&#62; <TTCLASS="USERINPUT"><B>fi li</B></TT>Name              flash addr   Mem addr    Length    Entry pointRedBoot          0xA0000000   0xA0000000  0x020000  0x80000000RedBoot config   0xA0FC0000   0xA0FC0000  0x020000  0x00000000FIS directory    0xA0FE0000   0xA0FE0000  0x020000  0x00000000RedBoot&#62;</PRE></TD></TR></TABLE></P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>NOTE: </B>The bold characters above indicate where something was entered on theconsole. As you can see, the <BCLASS="COMMAND">fi li</B> commandat the end came from the script,not the console. Once the script is executed, command processing reverts tothe console. </P></BLOCKQUOTE></DIV><P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>NOTE: </B>RedBoot supports the notion of a boot script timeout, i.e. a period oftime that RedBoot waits before executing the boot time script.  This periodis primarily to allow the possibility of canceling the script.  Sincea timeout value of zero (0) seconds would never allow the script tobe aborted or canceled, this value is not allowed.  If the timeoutvalue is zero, then RedBoot will abort the script execution immediately.</P></BLOCKQUOTE></DIV>On many targets, RedBoot may be configured to run from ROM or it may beconfigured to run from RAM. Other configurations are also possible. AllRedBoot configurations will execute the boot script, but in certain casesit may be desirable to limit the execution of certain script commands toone RedBoot configuration or the other. This can be accomplished byprepending <TTCLASS="COMPUTEROUTPUT">{&lt;startup type&#62;}</TT> to thecommands which should be executed only by the RedBoot configured for thespecified startup type. The following boot script illustrates this conceptby having the ROM based RedBoot load and run the RAM based RedBoot. The RAMbased RedBoot will then list flash images.</P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fco</B></TT>Run script at boot: false <TTCLASS="USERINPUT"><B>t</B></TT>Boot script:Enter script, terminate with empty line&#62;&#62; <TTCLASS="USERINPUT"><B>{ROM}fis load RedBoot[RAM]</B></TT>&#62;&#62; <TTCLASS="USERINPUT"><B>{ROM}go</B></TT>&#62;&#62; <TTCLASS="USERINPUT"><B>{RAM}fis li</B></TT>&#62;&#62;Boot script timeout (1000ms resolution): <TTCLASS="USERINPUT"><B>2</B></TT>Use BOOTP for network configuration: <TTCLASS="USERINPUT"><B>false</B></TT> ...Update RedBoot non-volatile configuration - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>... Unlock from 0x007c0000-0x007e0000: .... Erase from 0x007c0000-0x007e0000: .... Program from 0xa0015030-0xa0016030 at 0x007df000: .... Lock from 0x007c0000-0x007e0000: .RedBoot&#62; <TTCLASS="USERINPUT"><B>reset</B></TT>... Resetting.+Ethernet eth0: MAC address 00:80:4d:46:01:05IP: 192.168.1.153, Default server: 192.168.1.10RedBoot(tm) bootstrap and debug environment [ROM]Red Hat certified release, version R1.xx - built 17:37:36, Aug 14 2001Platform: IQ80310 (XScale)Copyright (C) 2000, 2001, Red Hat, Inc.RAM: 0xa0000000-0xa2000000, 0xa001b088-0xa1fdf000 availableFLASH: 0x00000000 - 0x00800000, 64 blocks of 0x00020000 bytes each.== Executing boot script in 2.000 seconds - enter ^C to abortRedBoot&#62; <TTCLASS="USERINPUT"><B>fis load RedBoot[RAM]</B></TT>RedBoot&#62; <TTCLASS="USERINPUT"><B>go</B></TT>+Ethernet eth0: MAC address 00:80:4d:46:01:05IP: 192.168.1.153, Default server: 192.168.1.10RedBoot(tm) bootstrap and debug environment [RAM]Red Hat certified release, version R1.xx - built 13:03:47, Aug 14 2001Platform: IQ80310 (XScale)Copyright (C) 2000, 2001, Red Hat, Inc.RAM: 0xa0000000-0xa2000000, 0xa0057fe8-0xa1fdf000 availableFLASH: 0x00000000 - 0x00800000, 64 blocks of 0x00020000 bytes each.== Executing boot script in 2.000 seconds - enter ^C to abortRedBoot&#62; <TTCLASS="USERINPUT"><B>fis li</B></TT>Name              FLASH addr  Mem addr    Length      Entry pointRedBoot           0x00000000  0x00000000  0x00040000  0x00002000RedBoot config    0x007DF000  0x007DF000  0x00001000  0x00000000FIS directory     0x007E0000  0x007E0000  0x00020000  0x00000000RedBoot&#62;</PRE></TD></TR></TABLE></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="fis-write-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="executing-programs.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">fis write</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="redboot-commands-and-examples.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Executing Programs from RedBoot</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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