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

📄 flashmem.ax(1).toc3.html

📁 vxworks相关论文
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>tffsDrv     Libraries    </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%281%29.TOC.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="flashMem.aX%281%29.TOC2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="flashMem.aX%282%29.TOC.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="4547"> tffsDrv </a></i></h2></font><h4 class="SH"><a name="4548"> </a>NAME </h4><dl class="margin"><dl class="margin"><dd><a name="4549"><div class="aX"><b class="file">tffsDrv</b>     -     TrueFFS interface for VxWorks </div></a></dl></dl><h4 class="SH"><a name="4550"> </a>SYNOPSIS </h4><dl class="margin"><dl class="margin"><dd><div class="Item"><a name="4552"> </a><b><i>tffsDrv</i></b><b>(&nbsp;)</b> - initialize the TrueFFS system </div><dd><div class="Item"><a name="4553"> </a><b><i>tffsDevCreate</i></b><b>(&nbsp;)</b> - create a TrueFFS block device suitable for use with dosFs </div><dd><div class="Item"><a name="4554"> </a><b><i>tffsDevFormat</i></b><b>(&nbsp;)</b> - format a flash device for use with TrueFFS </div><dd><div class="Item"><a name="4555"> </a><b><i>tffsRawio</i></b><b>(&nbsp;)</b> - low level I/O access to flash components </div></dl><dl class="margin"><dd><pre class="Code"><b><a name="4556">STATUS&nbsp;tffsDrv  (void) </a></b><dd> <b><a name="4557">BLK_DEV&nbsp;*&nbsp;tffsDevCreate  (int&nbsp;tffsDriveNo, int&nbsp;removableMediaFlag) </a></b><dd> <b><a name="4558">STATUS&nbsp;tffsDevFormat  (int&nbsp;tffsDriveNo, int&nbsp;arg) </a></b><dd> <b><a name="4559">STATUS&nbsp;tffsRawio  (int&nbsp;tffsDriveNo, int&nbsp;functionNo, int&nbsp;arg0, int&nbsp;arg1, int&nbsp;arg2) </a></b></pre></dl></dl><h4 class="SH"><a name="4560"> </a>DESCRIPTION </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4561"> </a>This module defines the routines that VxWorks uses to create a TrueFFS block device. Using this block device, dosFs can access a board-resident flash memory array or a flash memory card (in the PCMCIA slot) just as if it was a standard disk drive. Also defined in this file are functions that you can use to format the flash medium, as well as functions that handle low-level I/O to the device.</p><dd><p class="Body"><a name="4562"> </a>To include TrueFFS for Tornado in a VxWorks image, you must edit your BSP's <b>config.h</b> and define <b>INCLUDE_TFFS</b>, or, for some hardware, <b>INCLUDE_PCMCIA</b>. This configures the VxWorks initialization code to call <b><i>tffsDrv</i></b><b>(&nbsp;)</b>. This call sets up the structures, the global variables, and the mutual exclusion semaphore needed to manage TrueFFS. This call to <b><i>tffsDrv</i></b><b>(&nbsp;)</b> also registers socket component drivers for each flash device found attached to the target.</p><dd><p class="Body"><a name="4563"> </a>These socket component drivers are not quite block devices, but they are an essential layer within TrueFFS. Their function is to manage the hardware interface to the flash device, and they are intelligent enough to handle formatting and raw I/O requests to the flash device. The other two layers within TrueFFS are known as the translation layer and the MTD (the Memory Technology Driver). The translation layer of TrueFFS implements the error recover and wear-leveling features of TrueFFS. The MTD implements the low-level programming (map, read, write, and erase) of the flash medium.</p><dd><p class="Body"><a name="4564"> </a>To implement the socket layer, each BSP that supports TrueFFS includes a <b>sysTffs.c</b> file. This file contains the code that defines the socket component driver. This file also contains a set of defines that you can use to configure which translation layer modules and MTDs are included in TrueFFS. Which translation layer modules and MTDs you should include depends on which types of flash devices you need to support. Currently, there are three basic flash memory technologies, NAND-based, NOR-based, and SSFDC. Within <b>sysTffs.c</b>, define:</p></dl><dl class="margin"><dd><div class="Item"><a name="4565"> </a><b>INCLUDE_TL_NFTL</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4846"> </a>To include the NAND-based translation layer module. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4566"> </a><b>INCLUDE_TL_FTL</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4848"> </a>To include the NOR-based translation layer module. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4567"> </a><b>INCLUDE_TL_SSFDC</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4850"> </a>To include the SSFDC-appropriate translation layer module. </li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="4568"> </a>To support these different technologies, TrueFFS ships with three different implementations of the translation layer. Optionally, TrueFFS can include all three modules. TrueFFS later binds the appropriate translation layer module to the flash device when it registers a socket component driver for the device.</p><dd><p class="Body"><a name="4569"> </a>Within these three basic flash device categories there are still other differences (largely manufacturer-specific). These differences have no impact on the translation layer. However, they do make a difference for the MTD. Thus, TrueFFS ships with a variety of different MTDs that can support a wide range of flash devices from Intel, Sharp, Samsung, National, Toshiba, AMD, and Fujitsu. Within <b>sysTffs.c</b>, define:</p></dl><dl class="margin"><dd><div class="Item"><a name="4570"> </a><b>INCLUDE_MTD_I28F016</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4823"> </a>For Intel 28f016 flash devices. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4571"> </a><b>INCLUDE_MTD_I28F008</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4825"> </a>For Intel 28f008 flash devices. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4572"> </a><b>INCLUDE_MTD_I28F008_BAJA</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4827"> </a>For Intel 28f008 flash devices on the Heurikon Baja 4000. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4573"> </a><b>INCLUDE_MTD_AMD</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4829"> </a>For AMD, Fujitsu: 29F0{40,80,16} 8-bit flash devices. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4574"> </a><b>INCLUDE_MTD_CDSN</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4831"> </a>For Toshiba, Samsung: NAND CDSN flash devices. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4575"> </a><b>INCLUDE_MTD_DOC2</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4833"> </a>For Toshiba, Samsung: NAND DOC flash devices. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4576"> </a><b>INCLUDE_MTD_CFISCS</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4839"> </a>For CFI/SCS flash devices. </li></ul></p></dl><dl class="margin"><dd><div class="Item"><a name="4840"> </a><b>INCLUDE_MTD_WAMD</b> </div></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="4844"> </a>For AMD, Fujitsu 29F0{40,80,16} 16-bit flash devices. </li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="4841"> </a>The socket component driver and the MTDs are provided in source form. If you need to write your own socket driver or MTD, use these working drivers as a model for your own. </p></dl></dl><h4 class="SH"><a name="4579"> </a>EXTERNALLY CALLABLE ROUTINES </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4580"> </a>Most of the routines defined in this file are accessible through the I/O system only. However, four routines are callable externally. These are: <b><i>tffsDrv</i></b><b>(&nbsp;)</b>, <b><i>tffsDevCreate</i></b><b>(&nbsp;)</b>, <b><i>tffsDevFormat</i></b><b>(&nbsp;)</b>, and <b><i>tffsRawio</i></b><b>(&nbsp;)</b>.</p><dd><p class="Body"><a name="4581"> </a>The first routine called from this library must be <b><i>tffsDrv</i></b><b>(&nbsp;)</b>. Call this routine exactly once. Normally, this is handled automatically for you from within <b><i>usrRoot</i></b><b>(&nbsp;)</b>, if <b>INCLUDE_TFFS</b> is defined, or from within <b><i>pccardTffsEnabler</i></b><b>(&nbsp;)</b>, if <b>INCLUDE_PCMCIA</b> is defined.</p><dd><p class="Body"><a name="4582"> </a>Internally, this call to <b><i>tffsDrv</i></b><b>(&nbsp;)</b> registers socket component drivers for all the flash devices connected to your system. After registering a socket component driver for the device, TrueFFS can support calls to <b><i>tffsDevFormat</i></b><b>(&nbsp;)</b> or <b><i>tffsRawio</i></b><b>(&nbsp;)</b>. However, before you can mount dosFs on the flash device, you must call <b><i>tffsDevCreate</i></b><b>(&nbsp;)</b>. This call creates a block device on top of the socket component driver, but does not mount dosFs on the device. Because mounting dosFs on the device is what you will want to do most of the time, the <b>sysTffs.c</b> file defines a helper function, <b><i>usrTffsConfig</i></b><b>(&nbsp;)</b>. Internally, this function calls <b><i>tffsDevCreate</i></b><b>(&nbsp;)</b> and then does everything necessary (such as calling the <b><i>dosFsDevInit</i></b><b>(&nbsp;)</b> routine) to mount dosFs on the resulting block device. </p></dl></dl><h4 class="SH"><a name="4583"> </a>LOW LEVEL I/O </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4584"> </a>Normally, you should handle your I/O to the flash device using dosFs, which, in turn, uses TrueFFS and its component drivers to read and write from the flash device. However, there are situations in which this level of indirection can cause problems. To handle such situations, this library defines <b><i>tffsRawio</i></b><b>(&nbsp;)</b>. Using this function, you can bypass both dosFs and the TrueFFS translation services to program the flash medium directly.</p><dd><p class="Body"><a name="4585"> </a>However, you should not try to program the flash device directly unless you are intimately familiar with the physical limits of your flash device as well as with how TrueFFS formats the flash medium. Otherwise you risk not only corrupting the medium entirely but permanently damaging the flash device.</p><dd><p class="Body"><a name="4586"> </a>If all you need to do is write a boot image to the flash device, use the <b><i>tffsBootImagePut</i></b><b>(&nbsp;)</b> utility instead of <b><i>tffsRawio</i></b><b>(&nbsp;)</b>. This function provides safer access to the flash medium. </p></dl></dl><h4 class="SH"><a name="4587"> </a>IOCTL </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4588"> </a>This driver responds to all ioctl codes by setting a global error flag. Do not attempt to format a flash drive using ioctl calls. </p></dl></dl><h4 class="SH"><a name="4589"> </a>INCLUDE FILES </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="4590"> </a><b>tffsDrv.h</b>, <b>fatlite.h</b> </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%281%29.TOC.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="flashMem.aX%281%29.TOC2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="flashMem.aX%282%29.TOC.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 + -