For our application we should have a max of 8-10 directories and to
store & retrieve the files from this directories. We will be using
some of the 'C' functions to open,read,write,lseek and OS API's like
ls,cd. So what type of file system i should have, to perform the above
said operations.
I know that in BSP and vxworks having some of the libraries like
dosFsLib for the file system. Whether including the libraries and
calling functions would be enough to create the file system on the
flash card or any other thing. And when i have to do since file system
will be created once in the system and later applications will use
it.
I am really confused bcz at present i dont have any flash cards to
work on it and we dont have enough time to do experiments on the cards
once it comes. Can anyone please give some ideas how to do on the
hardware.
Thanx in advance for ur suggestions...
1. VxWorks detects the media (disk, flash, ...).
2. VxWorks probes the data on the media to determine what type of
file system is on it.
3. If VxWorks recognizes the file system, it tries to automatically
mount it as that file system.
4. If successful, you are ready to go and use the file system.
5. If it did not recognize it (or if the mounting failed), VxWorks
mounts it as RawFS. That is, it treats the device as a single file
that you can use.
6. If the device was not formatted, it should come up as RawFS, and
you should be able to format it provided that you have included the
appropriate formatting components.
On formatting.
You can format a device in VxWorks 6.2 and beyond for DosFS, or for
HRFS. Each one has different characteristics. To format for DosFS,
the easiest way to do it is to use dosfsDiskFormat "<path to
device>". To format for HRFS, use hrfsDiskFormat "<path to device>".
I don't use VxWorks anymore, so I am going from memroy. I may be
missing parameters.
Examples:
dosfsDiskFormat ("/ata0a") /* format disk for DosFS */
hrfsDiskFormat ("/ata00:2") /* format disk for HRFS */
Devices can be partitioned. I think the command is ...
xbdCreatePartition "<path to device>", # of partitions, size1%,
size2%, size3%
- The size of the partitions is given as a percentage of the
whole. There can be 1, 2, 3 or 4 partitions. Only three percentage
fields are supplied as the final can be computed as the totals must
add to 100%.
xbdCreatePartition "/ata0a", 1, 0, 0, 0 /* 1 partition created
-- takes entire device */
xbdCreatePartition "/ata0a", 2, 40, 0, 0 /* 2 partitions created
-- 1st takes 60%, 2nd takes 40% */
xbdCreatePartition "/ata0a", 3, 10, 20, 0 /* 3 partitions created
-- 10%, 20% and 70% */
xbdCreatePartition "/ata0a", 4, 5, 23, 45 /* 4 partitions created
-- 5%, 23%, 45% and 27% */
One term that you will see in the documentation is XBD -- Extended
Block Device.
Below is a list of file system components. You probably will not need
all of them.
Components you will need. Once again, this is from memory, so I may
be missing something.
INCLUDE_ATA /* If using a hard disk or compact flash,
or CD ROM */
INCLUDE_FD /* If using a floppy disk */
INCLUDE_XBD /* The XBD component --- must have for file
systems */
INCLUDE_XBD_PART /* Partition manager that conforms to XBD --
highly recommended */
INCLUDE_XBD_BLKDEV /* XBD BlkDev wrapper -- maps BLK_DEV devices to
the XBD interface */
INCLUDE_DOSFS /* Includes all the DosFS components,
including formatter */
INCLUDE_HRFS /* Includes the Highly Reliable File System
if desired */
INCLUDE_HRFS_FORMAT /* The formatter for HRFS */
INLCUDE_TRFS /* If you want the transactional file system
-- HRFS is recommended instead */
INCLUDE_CDROMFS /* If you want to use the CDROM file system */
INCLUDE_TFFS /* Flash media support -- I am not sure
about the name */
INCLUDE_ERF /* Event reporting framework -- should be
automatically dragged in when using file systems */
There may be a potential caveat when using flash media ...
particularly if you want to partition the device, or have it work with
HRFS. The flash configlette file located in target/config/comps/src/
may need to be editted. I think the name of the file is
00comp_tffs.c, but I am not sure. When 6.2 came out, flash did not
work properly "out of the box". A couple lines needed to be added to
the configlette file to tell flash not to override some default
behaviour. This might have been addressed in VxWorks 6.3, but I can
not recall. If in doubt, contact Wind River. Both the file system
team and the drivers team flash guy know what is needed.
DosFS -- Almost everybody has an implementation of DosFS (FAT12, FAT16
and FAT32). If you are looking for compatibility, or speed this may
be what you need.
HRFS -- This is the highly reliable file system. It is
transactional. The data is either fully committed to disk, or it is
not there. If there is any sort of failure, provided that the media
itself is not damaged, then none of your data before the last
transaction is lost. The disk remains sane. This is slower than
DosFS and *may* provide more wear on a flash device than DosFS, but it
is more reliable.
I have a feeling I am forgetting something. But the main thing is
that they have tried their best to simplify setting up file systems on
multiple device types. I hope this helps.
Thanx for the information's.
I got some idea how to handle the flash card.
Can i workout this on my simulator
like...
-> dosFsDiskFormat("/tgtsvr")
Whether it will effect the existing file system on my host.
/tgtsvr is pointing to one of the folder in the D drive that is when i
am creating file "hai.c" using fopen("/tgtsvr/hai.c","a+") its created
in that folder.
->iosDevShow
drv name
0 /null
1 /tyCo/0
2 /aioPipe/0x1170d698
7 host:
10 /vio
11 /tgtsvr
value = 25 = 0x19