📄 gettingstarted2.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Getting Started </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="gettingStarted.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="gettingStarted1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="gettingStarted3.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="90759">2.2 An Overview of Configuring and Using TrueFFS </a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="94311"> </a>Configuring VxWorks to include TrueFFS for Tornado is a matter of rebuilding the VxWorks image after editing the following files:</p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="94312"> </a><b class="file">Makefile</b>--to add <b class="file">sysTffs.o </b>to the list of objects built for this BSP</li></ul><ul class="BulletSingle" type="disc"><li><a name="94313"> </a><b class="file">config.h</b>--to include TrueFFS in VxWorks</li></ul><ul class="BulletSingle" type="disc"><li><a name="89650"> </a><b class="file">sysLib.c</b>--to adjust the description of the ROM area </li></ul><ul class="BulletSingle" type="disc"><li><a name="90577"> </a><b class="file">sysTffs.c</b>--to determine the features included in TrueFFS </li></ul></dl><dl class="margin"><dd><p class="Body"><a name="90578"> </a>When you boot this image, it automatically runs <b class="routine"><i class="routine">tffsDrv</i></b><b>( )</b>. This function call automatically registers a socket component for each flash device. At this point, there is not yet a block device driver for the flash, but the socket component driver does provide enough of a connection to support a call to <b class="routine"><i class="routine">tffsDevFormat</i></b><b>( )</b>. Use this routine to format the flash medium for use with TrueFFS. To create a TrueFFS block device on top of the socket component and then mount dosFs on that block device, call <b class="routine"><i class="routine">usrTffsConfig</i></b><b>( )</b>. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="90582">2.2.1 Configuring VxWorks and TrueFFS</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="94338"> </a>As mentioned above, configuring VxWorks to include TrueFFS requires edits to:</p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="94339"> </a><b class="file">Makefile</b>--to add <b class="file">sysTffs.o </b>to the list of objects built for this BSP</li></ul><ul class="BulletSingle" type="disc"><li><a name="94340"> </a><b class="file">config.h</b>--to include TrueFFS in VxWorks</li></ul><ul class="BulletSingle" type="disc"><li><a name="90600"> </a><b class="file">sysLib.c</b>--to adjust the description of the ROM area </li></ul><ul class="BulletSingle" type="disc"><li><a name="90601"> </a><b class="file">sysTffs.c</b>--to determine the features included in TrueFFS </li></ul></dl><dl class="margin"><dd><p class="Body"><a name="94371"> </a>For a BSP that supports TrueFFS, all these files must reside within your BSP configuration directory under <b class="file">target/config</b>. However, <b class="file">sysTffs.c</b> is not automatically shipped in this directory. Instead, several versions of <b class="file">sysTffs.c</b> are shipped in <b class="file">src/drv/tffs/sockets </b>as <b class="file">ads860-sysTffs.c</b>, <b class="file">mv177-sysTffs.c</b>, <b class="file">hkbaha47-sysTffs.c</b>, and so on. </p><dd><p class="Body"><a name="94477"> </a>Read <b class="file">src/drv/tffs/sockets/README </b>to determine which <i class="textVariable">bspname</i><b class="file">-sysTffs.c</b> is appropriate to your BSP. This <b class="file">README</b> file also contains brief descriptions of all the BSP-specific changes needed to support TrueFFS. After choosing a <b class="file">sysTffs.c</b> file, copy it to your BSP's <b class="file">target/config/</b><i class="textVariable">bspname</i><b class="file"> </b>directory.<b class="file"> </b></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85369">Changing the <b class="file">Makefile</b> </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85370"> </a>To add <b class="file">sysTffs.o</b> to the list of objects it built for your BSP, edit your BSP's <b class="file">Makefile</b> and add the following configuration macro definition: </p><dl class="margin"><dd><pre class="Code2"><b><a name="84503">MACH_EXTRA = sysTffs.o </a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="88652">Changing <b class="file">config.h</b> </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="88655"> </a>For most BSPs, including TrueFFS means editing <b class="file">config.h</b> and defining <b class="symbol_UC">INCLUDE_TFFS</b>. Because TrueFFS provides a block driver for use with dosFs, you also want to define <b class="symbol_UC">INCLUDE_DOSFS</b>. To avoid a flood of compiler warnings, you should make these <b class="symbol_lc">#define</b> statements conditional. For example:</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="89580">#ifndef INCLUDE_TFFS #define INCLUDE_TFFS #endif #ifndef INCLUDE_DOSFS #define INCLUDE_DOSFS #endif</a></b></pre></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="89077">Changing <b class="file">sysLib.c</b> </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89634"> </a>If your target includes an MMU, its BSP defines a <b class="symbol_lc">sysPhysMemDesc[ ]</b> table in its <b class="file">sysLib.c</b>. Typically, this table tells the MMU that the memory area that contains the boot image is <b class="symbol_UC">WRITABLE_NOT</b>, or, in other words, ROM. Until recently, ROM was the only technology that could reliably store a memory-resident boot image. As a result, VxWorks has always defaulted to the assumption that the memory area containing a boot image is ROM. </p><dd><p class="Body"><a name="91983"> </a>However, with the advent of flash technology, the possibilities have been expanded. Flash memory is both writable and capable of reliably storing a boot image. Thus, if you intend to store a boot image in flash memory, you must edit <b class="symbol_lc">sysPhysMemDesc[ ]</b> and reassign the boot image memory area as <b class="symbol_UC">WRITABLE</b>. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="89636">Changing <b class="file">sysTffs.c</b> </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="87859"> </a>The primary function of this file is to define the BSP-specific socket code that bridges the gap between the flash hardware and VxWorks. You also use <b class="file">sysTffs.c</b> to determine which software modules you want to include in TrueFFS. By default, a WRS-supplied <b class="file">sysTffs.c</b> includes all translation layer modules, all MTD modules, as well as code for <b class="routine"><i class="routine">tffsBootImagePut</i></b><b>( )</b>, <b class="routine"><i class="routine">tffsShow</i></b><b>( )</b>, and <b class="routine"><i class="routine">tffsShowAll</i></b><b>( )</b>. To reduce the image size, you can edit <b class="file">sysTffs.c</b> to exclude modules that you know to be unnecessary to your particular application. </p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="88782">Choosing Translation Layer Modules </a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="91044"> </a>Use the symbolic constants shown in <a href="gettingStarted2.html#91051">Table 2-1</a> to determine which translation layer modules are included in <b class="file">sysTffs.o</b>. <b class="symbol_UC"><p class="table"><h4 class="EntityTitle"><a name="91051"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 2-1: Defines for Including Translation Layer Modules</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="91055"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Symbolic Constant</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="91057"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Associated Flash Technology </font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91059"> </a><b class="symbol_UC">INCLUDE_TL_NFTL</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91061"> </a>NAND-based flash </div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91063"> </a><b class="symbol_UC">INCLUDE_TL_FTL</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91065"> </a>NOR-based flash </div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91067"> </a><b class="symbol_UC">INCLUDE_TL_SSFDC</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91069"> </a>SSFDC flash </div></td><td width="10"> </td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -