📄 flashmem.ax(2).toc4.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title><i class="i">tffsBootImagePut</i>( ) Subroutines </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="flashMem.aX%282%29.TOC.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="flashMem.aX%282%29.TOC3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="flashMem.aX%282%29.TOC5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h2 class="H1"><i><a name="4564"> <i class="i">tffsBootImagePut</i>( ) </a></i></h2></font><h4 class="SH"><a name="4565"> </a>NAME </h4><dl class="margin"><dl class="margin"><dd><a name="4566"><div class="aX"><b class="routine"><i class="routine">tffsBootImagePut</i></b><b>( )</b> - write to the boot-image region of the flash device </div></a></dl></dl><h4 class="SH"><a name="4567"> </a>SYNOPSIS </h4><dl class="margin"><dl class="margin"><dd><pre class="Code"><b><a name="4569">STATUS tffsBootImagePut ( int driveNo, /* TFFS drive number */ int offset, /* offset in the flash chip/card */ char * filename /* binary format of the bootimage */ )</a></b></pre></dl></dl><h4 class="SH"><a name="4575"> </a>DESCRIPTION </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4576"> </a>This routine writes an input stream to the boot-image region (if any) of a flash memory device. Typically, the input stream contains a boot image, such as the VxWorks boot image, but you are free to use this function to write any data needed. The size of the boot-image region is set by the <b><i>tffsDevFormat</i></b><b>( )</b> call (or the <b><i>sysTffsFormat</i></b><b>( )</b> call, a BSP-specific helper function that calls <b><i>tffsDevFormat</i></b><b>( )</b> internally) that formats the flash device for use with TrueFFS. </p><dd><p class="Body"><a name="8076"> </a>If <b class="routine"><i class="routine">tffsBootImagePut</i></b><b>( )</b> is used to put a VxWorks boot image in flash, you should not use the s-record version of the boot image typically produced by <b class="command">make</b>. Instead, you should take the pre s-record version (usually called <b class="file">bootrom</b> instead of <b class="file">bootrom.hex</b>), and filter out its loader header information using an <i class="textVariable">xxx</i><b class="command">ToBin </b>utility. For example: </p></dl><dl class="margin"><dd><pre class="Code"><b><a name="4577">elfToBin < bootrom > bootrom.bin</a></b></pre></dl><dl class="margin"><dd><p class="Body"><a name="8097"> </a>Use the resulting <b class="file">bootrom.bin</b> as input to <b class="routine"><i class="routine">tffsBootImagePut</i></b><b>( )</b>. </p><dd><p class="Body"><a name="8107"> </a>The discussion above assumes that you want only to use the flash device to store a VxWorks image that is retrieved from the flash device and then run out of RAM. However, because it is possible to map many flash devices directly into the target's memory, it is also possible run the VxWorks image out of flash memory, although there are some restrictions:</p></dl><dl class="margin"><dd><div class="Item"><a name="8127"> </a>1.</div><dl class="margin"><dd><div class="Indent"><a name="8144"> </a>The flash device must be non-NAND. </div><br></dl><dd><div class="Item"><a name="8134"> </a>2.</div><dl class="margin"><dd><div class="Indent"><a name="8145"> </a>Only the text segment of the VxWorks image (<b class="file">vxWorks.res_rom</b>) may run out of flash memory. The data segment of the image must reside in standard RAM. </div><br></dl><dd><div class="Item"><a name="8139"> </a>3.</div><dl class="margin"><dd><div class="Indent"><a name="8146"> </a>No part of the flash device may be erased while the VxWorks image is running from flash memory. </div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="8163"> </a>Because TrueFFS garbage collection triggers an erase, this last restriction means that you cannot run a VxWorks boot image out of a flash device that must also support a writable file system (although a read-only file system is OK). </p><dd><p class="Body"><a name="8125"> </a>This last restriction arises from the way in which flash devices are constructed. The current physical construction of flash memory devices does not allow access to the device while an erase is in progress anywhere on the flash device. As a result, if TrueFFS tries to erase a portion of the flash device, the entire device becomes inaccessible to all other users. If that other user happens to be the VxWorks image looking for its next instruction, the VxWorks image crashes.</p></dl></dl><h4 class="SH"><a name="4579"> </a>RETURNS </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4580"> </a>OK or ERROR </p></dl></dl><h4 class="SH"><a name="4581"> </a>SEE ALSO </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="8538"> </a>tffsConfig</p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="flashMem.aX%282%29.TOC.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="flashMem.aX%282%29.TOC3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="flashMem.aX%282%29.TOC5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -