?? vxw_pt3.html
字號:
can be found at:<a href="http://developer.axis.com/software/jffs/">http://developer.axis.com/software/jffs/</a>.<br>(From: Hwa Jin Bae, bae@mail.com)<p><hr WIDTH="50%"><a NAME="3.2-E"></a><p>Q: I have problems getting TFFS to work with StataFlash chips.<p>A: I had the same problem and found that the problem was a low-level flashinterface problem (and there was no way to tell that from the tffsDevFormat()call results - this was confirmed by WRS tech "support".)<p>I had to debug at the sockets layer, to find out where the error(s) were. WhenI flushed out all the socket interface layer bugs, the tffsDevFormat() worked.Basically; get it to the point that you don't have any error messages from thesocket layer, and it seems to work ok<p>There are a good many debug statements in the cfiscs.c file - I just turned themon, and added a few of my own, to track down the problem. I left the error (asopposed to debug info) messages enabled in cfiscs.c - this has turned out tobe *very* helpful during development.<p>It would be very nice if any low-level (socket layer) problems were somehowpassed up the to the higher layers, so that you could get a meaningful responsefrom the API-layer calls. But, then, it has been my experience that, if anerror occurs at a lower software layer, all bets are off (we have frequentvxWorks hang conditions due to this problem).<p>Our board has multiple flash chips, and I also found it helpful to be able tolimit the number of flash chips used (because we had chip-location-specifichardware problems). I got it to work with a single chip, first (our chips are4MB each).<br>(From: Bill Fulton, bill_a_fulton_please.nospam@raytheon.com)<p><hr WIDTH="50%"><a NAME="3.2-F"></a><p>Q: How can I defragment a TFFS volume?<p>A: To defragment TrueFFS flash array, you can use code fragmentsimilar to the one below:<pre> int freeSectors = 0x70000000; /* impossible number of sectors */ (void) tffsRawio (0, TFFS_DEFRAGMENT_VOLUME, freeSectors, 0, 0);</pre>The call above could return error code, but, as far as I know, it is safeto ignore it. If media is badly fragmented, the call above can take verylong time to complete, since it is doing complete defragmentation of theentire flash array.<br>(From: Andray Kaganovsky, andreyk@home.com)<p><hr WIDTH="50%"><a NAME="3.2-G"></a><p>Q: How can I access a TFFS device using raw I/O after it was mounted?<p>A: Here is an umount and mount function that was suggested by our WindRiverFAE:<pre>#include "tffs/fatlite.h"/*************************************************************************** ****** tffsUnmout - Unmount the requested drive** This routine unmounts a TFFS drive.** RETURNS: OK or ERROR*/STATUS tffsUnmount(int tffsDriveNo){ IOreq ioreq; FLStatus status; ioreq.irHandle = tffsDriveNo; status = flCall(FL_DISMOUNT_VOLUME ,&ioreq); return ((status == flOK) ? OK : ERROR); }/********************************************************************************* tffsMount - Mount the requested drive** This routine mounts a requested TFFS drive.** RETURNS: OK or ERROR*/STATUS tffsMount(int tffsDriveNo) { IOreq ioreq; FLStatus status; ioreq.irHandle = tffsDriveNo; status = flCall(FL_MOUNT_VOLUME ,&ioreq); return ((status == flOK) ? OK : ERROR); }</pre>I modified tffsBootImagePut() to unmount the flash drive, re-write to the boot region,and re-mount the flash drive. tffRawio() and tffsBootImagePut() in conjunction withtffsMount() and tffsUnmount() are working very reliably now.<br>(From: M. Nurmohamed, mehmood@gte.NOSPAM.net)<p><hr WIDTH="50%"><a NAME="3.2-H"></a><p>Q: How can I format a 128 Mbyte device? I can only see 32 Mbyte.<p>A: AFAIK, your limit should not be 32MB, but 40MB. You'll find intarget/h/tffs/flCustom.h:<pre>#define MAX_VOLUME_MBYTES 40</pre>I had to increase SECTOR_SIZE_BITS (512 byte->1024 byte) to get over 64MB.Change this defines and recompile TFFS-sources if available or ask your FAE.<br>(From: Michael Lawnick, Lawnick@softec.de)<p>It is true that TFFS limits size of the single TFFS volume to 40MBytes. If you happened to have TFFS source code, then Michael's suggestion above will allow you to work around this limit. If you don'thave TFFS source code, then you can "partition" your physical flash arrayinto independent TFFS volumes. You will have to do minor change inyour TFFS's socket code in <bsp_dir>/sysTffs.c to do address wrap around 32MBytes offsets. <br>This will allow you to install four socket components, with base addressesas follows:<pre> socket # address range 0 <flash_address> ... <flash_address> + 32MB 1 <flash_address> + 32MB ... <flash_address> + 64MB 2 <flash_address> + 64MB ... <flash_address> + 96MB 3 <flash_address> + 96MB ... <flash_address> + 128MB</pre>Each of the memory ranges above can be formatted and mounted as independentTFFS volume. Depending on the size of the physical flash parts thatcomprise your flash array, and flash array's interleaving, you cando I/O in parallel to all four TFFS volumes, which can greatlyimprove 'write' performance.<br>(From: Andray Kaganovsky, andraykNOSPAM@primus.ca)<p><hr WIDTH="50%"><a NAME="3.2-I"></a><p>Q: How can I reduce wear by updating the "Last Accessed" field?<p>A: The code changes are very easy, but you might have to ask yourFAE to do this, as this source code is not included in the standarddistribution.<br>"dosFs/dosFsLib.c" needs to be changed. I have a diff below.However, I think you just need to search for "->accessed" and note howthe code is being used to understand. There are about three to fouroccurrences of this. As Leonid noted, this should probably beconfigurable.<pre>[dosFsLib.c differences]*** c:/TEMP/dosFsLib.c.~1.2~ Wed Feb 27 19:52:55 2002--- c:/TEMP/dosFsLib.c.~1.1.~ Wed Feb 27 19:52:55 2002****************** 2532,2543 **** } /* update file's directory entry */! if(cbioModeGet(pVolDesc->pCbio) != O_RDONLY)! {! pFd->accessed = 0;! if(pFd->changed)! pVolDesc->pDirDesc->updateEntry(pFd, DH_TIME_MODIFY, time(NULL));! } /* * flush buffers and deallocate unused clusters beyond EOF, * if last file descriptor is being closed for the file--- 2532,2547 ---- } /* update file's directory entry */! ! if( cbioModeGet(pVolDesc->pCbio) != O_RDONLY &&! ( pFd->accessed || pFd->changed ) )! {! u_int timeFlag = (pFd->accessed)? DH_TIME_ACCESS :! DH_TIME_MODIFY ;! pVolDesc->pDirDesc->updateEntry( pFd, timeFlag, time( NULL ) );! pFd->accessed = 0;! }! /* * flush buffers and deallocate unused clusters beyond EOF, * if last file descriptor is being closed for the file****************** 3986,3996 **** retVal = OK; /* store directory entry */! if(pFd->changed)! { retVal = pVolDesc->pDirDesc->updateEntry(! pFd, DH_TIME_MODIFY, time(NULL));! } if( retVal == OK ) { retVal = cbioIoctl( --- 3990,4003 ---- retVal = OK; /* store directory entry */! ! if( pFd->accessed || pFd->changed )! {! ptrBuf = (void *)((pFd->accessed)? DH_TIME_ACCESS :! DH_TIME_MODIFY ) ; retVal = pVolDesc->pDirDesc->updateEntry(! pFd, (u_int)ptrBuf, time( NULL ) );! } if( retVal == OK ) { retVal = cbioIoctl( </pre>(From: Bill Pringlemeir, bpringlemeir@yahoo.com)<p><hr WIDTH="60%"><p><h3><a NAME="3.3"><center>3.3 Floppy-disk File system</center></a></h3><a NAME="3.3-A"></a>Q: I try to create a floppy device using usrFdConfig(0,0,"/fd0/")as suggested in the programmer's manual, but I always get the"dosFsDevInit() failed" error message. How can I avoid this message andhave the system create the device?<p>A: Typically there is no floppy in the drive. We found a workaround thatinitializes the datastructures needed by the dosFsDevInit() call for afloppy with 3.5" and 1.44Mb.<br>Following is the change that should be made to usrFd.c to initialise thisstructure.<pre>--- org\usrfd.c+++ new\usrFd.c@@ -54,6 +54,7 @@ ) { BLK_DEV *pBootDev;+ DOS_VOL_CONFIG DVC; char bootDir [BOOT_FILE_LEN]; if ((UINT)drive >= FD_MAX_DRIVES)@@ -74,9 +75,20 @@ devSplit (fileName, bootDir); + /* Modification: create the dosvolume data struture */+ DVC.dosvc_mediaByte = 0xf0; /* media descriptor byte */+ DVC.dosvc_secPerClust = 1; /* sectors per cluster (minimum 1) */+ DVC.dosvc_nResrvd = 1; /* number of reserved sectors (min 1) */+ DVC.dosvc_nFats = 2; /* number of FAT copies (minimum 1) */+ DVC.dosvc_secPerFat = 9; /* number of sectors per FAT copy */+ DVC.dosvc_maxRootEnts = 224; /* max number of entries in root dir */+ DVC.dosvc_nHidden = 0; /* number of hidden sectors */+ DVC.dosvc_options = 0; /* volume options */+ DVC.dosvc_reserved = 0; /* reserved for future use */+ /* initialize the boot block device as a dosFs device named <bootDir> */ if (dosFsDevInit (bootDir, pBootDev, NULL) == NULL) {+ if (dosFsDevInit (bootDir, pBootDev, &DVC) == NULL)+ { printErr ("dosFsDevInit failed.\n"); return (ERROR);+ } } return (OK); }</pre>(From: Christian Doppelbauer, Christian.Doppelbauer@br-automation.co.at)<p>Another possibility is to use the following code:<pre>STATUS initMyFDisk(){ IMPORT int dosFsDrvNum; /* number Dos file driver */ fdDrv (FD_INT_VEC, FD_INT_LVL); /* initialize floppy disk */ if (dosFsDrvNum == ERROR) { dosFsInit (NUM_DOSFS_FILES); /* initialize DOS-FS */ } /* * Create the device; */ if (usrFdConfig (0, 0, "/vxA/") == ERROR) { printErr("initMyFDisk(): usrFdConfig failed.\n"); return(ERROR); } return(OK);}</pre>(From: Pritam De, pde@cisco.com)<p><hr WIDTH="60%"><p><h3><a NAME="3.4"><center>3.4 RAM-disk File system</center></a></h3><a NAME="3.4-A"></a>Q: When I use the RAM-disk as supplied with DosFS2 (configured using theitem Hardware->Peripherals->RAM Disk with MSDOS filesystem) it is formattedevery time I startup, even if I assign a seperate memory area.<p>A: Using the device provided as-is this is right. During the initialisationof the device it is formatted. This can be changed by replacing/adding a numberof lines to the component INCLUDE_RAM_DISK in the file 10dosfs2.cdf intarget\config\comps\vxworks. The definition of INIT_RTN should be changedto:<pre> INIT_RTN { void * cbio ; int ramDiskTestFd = -1;\ cbio=ramDiskDevCreate(RAM_DISK_MEM_ADRS,512,17,RAM_DISK_SIZE/512,0);\ if(cbio!=NULL){ \ dosFsDevCreate(RAM_DISK_DEV_NAME,cbio,RAM_DISK_MAX_FILES,NONE);\ if(RAM_DISK_FORMAT_ALWAYS == FALSE){ \ ramDiskTestFd = open(RAM_DISK_DEV_NAME, 2, 0);\ } \ if((RAM_DISK_FORMAT_ALWAYS != FALSE)||(ramDiskTestFd == -1)){\ dosFsVolFormat(cbio,DOS_OPT_BLANK | DOS_OPT_QUIET, NULL);\ } \ if(ramDiskTestFd != -1){ \ close(ramDiskTestFd);\ } \ }}</pre>Also a configuration parameter should be added, called RAM_DISK_FORMAT_ALWAYS. Todefine this parameter the Parameter-definition has to be added:<pre>Parameter RAM_DISK_FORMAT_ALWAYS { NAME Format always, even if already formatted TYPE bool DEFAULT FALSE }</pre>When this parameter is set to TRUE the disk is always formatted, just like theoriginal situation. When this parameter is set to FALSE (the default situation)the disk is only formatted when the open of the RAM-disk root does not succeed.<p>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -