?? vxw_pt3.html
字號:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="VIM on Unix and Win95"> <meta name="Author" content="Johan Borkhuis"> <meta name="description" content="VxWorks / Tornado II information / FAQ"> <meta name="keywords" content="VxWorks,Tornado,FAQ"> <meta name="version" content="$Id: vxw_pt3.html,v 1.22 2002/03/22 09:02:50 borkhuis Exp $"> <title>VxWorks and Tornado II FAQ</title></head><body><center><h1><strong><font size="+4">VxWorks / Tornado II FAQ</font></strong></h1></center><p><hr WIDTH="80%"><h2><a href="#3">3. File System problems</a></h2><blockquote><h3><a href="#3.1">3.1 Dos file system</a></h3></blockquote><blockquote><h3><a href="#3.2">3.2 Flash File system</a></h3></blockquote><blockquote><h3><a href="#3.3">3.3 Floppy-disk File system</a></h3></blockquote><blockquote><h3><a href="#3.4">3.4 RAM-disk File system</a></h3></blockquote><blockquote><h3><a href="#3.5">3.5 General file system questions</a></h3></blockquote><blockquote><h3><a href="#index">Index</a></h3></blockquote><hr WIDTH="80%"><p><h2><a NAME="3"><center>3. File System problems</center></a></h2><p><h3><a NAME="3.1"><center>3.1 DOS File System</center></a></h3><a NAME="3.1-A"></a>Q: All my files on the disk have the date 1 Jan 1980. How can I get thesystem to use the actual date?<p>A: This is a problem related to the original DOS-FS implementation.With the introduction of the new implementation, DosFS2, this problemhas disapeared. There are also a lot of other changes and improvementsmade to the DosFS system. It is advisable to use this version insteadof the original. DosFS2 is a free update to Tornado-2 and can be obtainedfrom your local sales representative.<p>Within the old DOS file system the current date is not used. You haveto use a hook to do this. See the following code to create a funtionthat changes the file-time to the actual time:<pre>voiddosFsDateTimeHook(DOS_DATE_TIME *pDateTime){ time_t tm_t; struct tm currTime; struct timespec timeSpec; tm_t = time(NULL); localtime_r(&tm_t, &currTime); /* pass values to DOS date and time structure */ pDateTime->dosdt_year = currTime.tm_year+1900; pDateTime->dosdt_month = currTime.tm_mon + 1; pDateTime->dosdt_day = currTime.tm_mday; pDateTime->dosdt_hour = currTime.tm_hour; pDateTime->dosdt_minute = currTime.tm_min; pDateTime->dosdt_second = currTime.tm_sec;}</pre>Then add the following line to your startup code (for example after theinitialization of dosFs).<pre>dosFsDateTimeInstall(dosFsDateTimeHook);</pre>See also the description of dosFsLib in the VxWorks Reference Manual.<p><hr WIDTH="50%"><a NAME="3.1-B"></a><p>Q: When I create a file with a size of 0 on a removable medium withVxWorks and run Scandisk on a PC on this filesystem, Scandisk complainsabout Incorrect file size. This in only the case if the size is 0.<p>A: This has been a known problem with dosFsLib for a few years, andit is fixed in DosFs 2.0. Here are some more details:<br>The NFS server module uses the number of the first cluster of a file(16 bits) as part of its File Handle, together with a running generationcounter. Because of this requirement of NFS, dosFs was modified(between VxWorks 5.1.1 and 5.2) to allways allocate at least onecluster to a file, even if it was completely empty, with 0 bytes.<br>This is not entirely in-line with Microsoft implementations whichdo not allocate clusters to empty files, and leave the first clusternumber in directory entries as 0 for file with no data.<br>The action taken by ScanDisk is based on the assumption thatsince the file has one cluster allocated to it, the systemwent down before it had a chanse to update the file size fieldin the directory entry, and adjusts this field in an attempt tosalvage possibly lost data contained in that allocated cluster.<br>Hence it is clear that even though this slight incompatibility issuewas known for some time, (in addition to other small issues) it couldnot be "fixed" without redesigning the NFS server module to use othermeans to generate File Handles.<br>With DosFs 2.0, the file system as well as the NFS server whereredesigned in a way that does away with all the compatibility issues,and making FosFs 2.0 and NFS server completely isolated one from theother.<br>(From: Leonid Rosenboim, leonid@bitband.com)<p><hr WIDTH="50%"><a NAME="3.1-C"></a><p>Q: With the new disk partition manageger which is part of the dosFs2.0release, is there an elegant means to mount all the valid partitions ?? Sincethe current code does not actually do the mount until the first access, none ofthe calls (dpartPartGet() and dosFsDevCreate() for example.) return errorseven if the partition you are mounting really doesn't exist. You have toaccess it first.<p>A: DosFs 2.0 requires you to specify the maximum number of partition youEXPECT to see on the disk, and to provide each of these expected partitiona logical device name. Sinc VxWorks does not have (never had) an automaticmechanism for assigning logical names to devices (a'la A:, B:, C:, ... inMessDos), and a logical name is a necesity to be able to access the deviceafter initialization. <br>Alternatively, the number of expected partitions can be large, since it is notan error if there are less partitions on the actual disk then expected - theexraneous partitions will have logical device names associated with them, butwill yield an error on any access attempt. Moreover, the number of expectedpartitions must accomodate any removable disk which could be inserted into aparticular drive.<br>The partition mamager module "dpartCbio" has an arbitrary limitation of 8partitions, that is supposed to be sufficient for most applications. Manyoperating systems have a similar limitation (SunOS, Solaris have max 8partitions per disk drive) which are seldom reached.<br>It could be possible by slight modification of dpartCbio source code to get morepartitions, but my feeling is that there is something strange if you need morethen 8 partitions on a disk, perhaps your design considerations should berevised... <br>(From: Leonid Rosenboim, leonid@bitband.com)<p><hr WIDTH="50%"><a NAME="3.1-D"></a><p>Q: Is it possible to use FTP with the raw file system?<p>A: The ftp server uses open/read/write/close the same as any other program, so canread (and write) raw filesystems.<br>You will need to use a 'proper' ftp client to request the required transfer. Noneof the windows 'file manager' style ftp clients interact well with the vxWorks ftpserver.<br>If you create a raw file system covering the same disc space as a dosfs one, youcan take an image of the current state of the filesystem and restore it at a laterdate. (Assuming no files are open ...)<br>One thing I found is that the ftp server requires that the raw device driver errorreads for zero bytes at the end of file - otherwise the ftp doesn't complete.<br>(From: David Laight, dsl@tadpole.co.uk)<p><hr WIDTH="50%"><a NAME="3.1-E"></a><p>Q: When I create a direcory <code>chkdsk</code> complains at the next reboot.<p>A: Seems you are rebooting too soon after creating the directory, it had thechance to update the FAT but not the root (parent) directory, so there isa cluster allocated which is not referred from any directory entry, thusit would reclaim it in an attempt to salvage potentially lost data.<br>If you do some more operations prior to rebooting, it will be able to flushthe buffers and then all will be consistent.<br>With TFFS, disk write operations are rather lenghy, perhaps you shold try thesame with a RAM disk or some other media with the same DosFs setup.<br>(From: Leonid Rosenboim, leonid@bitband.com)<p><hr WIDTH="50%"><a NAME="3.1-F"></a><p>Q: Why does the task 'dCacheUpd' take so much of the processortime?<p>A: You have correctly identified the task responsable for using-up your CPU.<br>Knowing Flash, my guess is that what you see is the busy-loop delay code ofthe MTD used to wait for completion of every Flash memory write operation.Typical Flash memories require delays of 6 to 14 microseconds for each bytewritten, and busy-loop is a common solution for such timing requirement.<br>The reason this happens in Disk Cache task is that the write operationsyour application calls write to the disk cache, which using the write-backmachnism updates that data to the disk at a later time.<br>As a first-off solution recommendation, I would recommend that you tune theDisk Cache task priority to be sufficiently low so as not to interfere withother functions of your application, this could potentially slow down themaximum write speed, depending on how much CPU time the disk cache task iseventually getting, and this can also somewhat increase the lag timebetween the write() call from your application, till its on the Flash.<br>There are other ideas which could cause the CPU time used to write Flash tobe spend on behalf of the task which calls write() rather then the diskcache, decreasing the time-lag, but I am afraid this won't improve anyother factor.<br>One good way to improve all aspects of this, is to use Compact Flash ATAcards insead of TrueFFS, which have on-board microcontroller doing all thatgreesy Flash timing for you without consuming any CPU time at all.<br>(From: Leonid Rosenboim, leonid@bitband.com)<p><hr WIDTH="50%"><a NAME="3.1-G"></a><p>Q: How can I unmount a DOS-filesystem?<p>A: Unfortunately 'unmount' isn't part of the dosfs spec. Even in dosfs2.Apparantly 'there is no requirement for it'<br>WRS Support will send you a load of 'unsopported code' that (if compiledwith the correct header files etc) will completely free up all the dataareas allocated by dosfs. However things will go 'tits up' if there are anyopen files, and more so if you cannot guarantee that a file isn't beingopened (by another task) at the same time as you are freeing all thedata areas!<br>(From: David Laight, David.Laight@btinternet.com)<p><hr WIDTH="50%"><a NAME="3.1-H"></a><p>Q: Why does a file, when deleted on the target, still appear on the NFSexported drive?<p>A: The client will compare directory names (cache against server) before itwill assume the directory is unchanged and use cached handles, but dosFs 1.0does not update directory modification time when a file is deleted,<br>In other words, dosFs 1.0 and its NFS server can offer no solution to thissituation.<br>(From: Leonid Rosenboim)<p><hr WIDTH="50%"><a NAME="3.1-I"></a><p>Q: With DosFS2 some of our files started disappearing.<p>A: DosFs 2.0 has a problem with Tornado 2.x on PowerPC 603/604 architecture(or other derivatives using the 603/604 compule flag),which is due to PowerPC compiler improper code generation for 64-bitinteger operations used throughout DosFs 2.0.<p>This bug could is tricky to catch, it will bite you only if you havesome tasks doing Floating Point calculation, and task switch takingplace between these and other tasks doing DosFs I/O in midst of64-bit arithmetics. So do not be fooled to beleive you eint got it!<p>For those who got DosFs 2.0 source code, this can be solved byeither compiling the library with -msoft-float compile flag, or bydisabling 64-bit math (not recommended).For binary only licensees, you need a patch which is available fromWINDSURF.<p>References:<blockquote>SPR # 71089<br>Additional SPR # 33221,33702,33684,34704,62415,28428</blockquote>(From: Leonid Rosenboim)<p><hr WIDTH="60%"><p><h3><a NAME="3.2"><center>3.2 Flash File System</center></a></h3><a NAME="3.2-A"></a>Q: When my system boots from network the network link is opened , but whenI use TFFS as a boot device the network is not opened.<p>A: Define the ethernet device in the "other" boot parameter, for example ifthr original boot device is cpm(0,0) the other (o) parameter should be cpm.The bootline in this case could be if you want to boot from a flash disk:<pre>$tffs=0,0(0,0)host:vxworks e=<target IP> o=cpm</pre><br>(Needed: Include Network components\basic network initialization components\bootlineprocessing components\network device name selection)<p>If this does not help it probably means that the device you want to bootfrom is not defined in usrNetBoot.c In the function usrNetDevNameGet only thestandard file devices (SCSI, IDE, ATA) are checked. If one of these isavailable the "other" boot parameter is checked, but if another device is usedthe parameter is not checked.<br>To fix this add the line with the '+' sign to the moduletarget\config\comps\src\net\usrNetBoot.c (line 97):<pre> if ( (strncmp (sysBootParams.bootDev, "scsi", 4) == 0) ||+ (strncmp (sysBootParams.bootDev, "tffs", 4) == 0) || (strncmp (sysBootParams.bootDev, "ide" , 3) == 0) || (strncmp (sysBootParams.bootDev, "ata" , 3) == 0) || (strncmp (sysBootParams.bootDev, "fd" , 2) == 0))</pre>When some other device is used replace tffs with the correct device name.<p><hr WIDTH="50%"><a NAME="3.2-B"></a><p>Q: Can I use long filenames with TFFS?<p>A: Assuming you are using the old dosFs, which is shipped with Tornado 2,then you are out of luck:<br> TrueFFS is very nosy about the DosFs structure stored on its volumes, andthe only safe way to use it is to format a TrueFFS volume only with theformat function supplied with TrueFFS. Never use dosFsMkfs() to format aTrueFFS volume.<br>DosFs long names are non-standard, and can be created only with dosFsMkfs(),and are known to cause file data to dissapear when used with TrueFFS,because TrueFFS's idea of the meaning of some fields in the boot block andDosFs's idea vary. This has been documented in the SPR database.<br> Your solution is to either go to DosFs 2 which supports standard VFAT longnames, or to do away with TrueFFS.<br>(From: Leonid Rosenboim, leonid@bitband.com)<p><hr WIDTH="50%"><a NAME="3.2-C"></a><p>Q: I want to use TFFS with a Raw file system. Is this possible?<p>A: The MS-DOS specific code in TrueFFS could be disabled by callingthe routine tffsDevOptionsSet() right after the call totffsDevCreate().<br>Once you have done this, you should be able to use TrueFFS withraw filesystem.<br>(From: Andrey Kaganovsky, andreyk@home.com)<p><hr WIDTH="50%"><a NAME="3.2-D"></a><p>Q: Is there an alternative for TFFS?<p>A: There are several alternative flash filing systems. There is also onethat is released under GPL, called JFFS (Journaling Flash File System). This
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -