Flash File System Suggestions (DOSFS or others)
brett.swimley at aedbozeman.com
Thu May 25 12:21:20 UTC 2006
Hello All -
We have a boot flash on our board that contains a bootloader as well as
our application. Together, these pieces of software comprise less than
1/2 of the flash capacity. It is my desire to utilize a portion of the
remainder of the flash as a flash file system.
I have put together a rudimentary flash file system that works, but it
lacks any sort of directory structure. I would like to move toward a
more standardized file system.
Initially, the DOSFS seemed like a good choice (and it still may be).
Starting with some Secure Digital drivers that I put together for use
with DOSFS (which works well I might add), I hacked together some block
drivers for use with the flash that I could use with DOSFS.
The problem with my Flash is that my sector sizes are quite large (64K),
and I certainly didn't want that size of block on my Flash File system,
so I chose a block size of 512 bytes for the File system. This sort of
works, but the way my driver is structured, every time a 512 byte block
is written, I really have to rewrite an entire 64K sector. Obviously
My next thought to overcome this was to maintain a 64K sector cache
within my driver. 512 block reads and writes within this cache would not
need to access the flash, and I could flush the cache to flash if a new
block write required an address outside of my current sector cache.
This doesn't quite work, as only a block read and block write ioctl is
supported as the interface between DOSFS and the block driver, and I
really need to know when to flush the cache. I tried to add a block open
and block close ioctl, but it appears that the low level physical device
open and close functions are only called during initialization.
This cache mechanism seems to have some potential, but I would need to
have some hooks placed into DOSFS to allow the cache flushing to occur.
I'm hoping that perhaps Thomas could make some comments on the
feasibility of adding these hooks (via ioctls?) or if there is a better
mechanism to interface my flash device with DOSFS.
Secondly, is DOSFS really the best choice? Jay Monkman had posted that
he was porting JFFS2 to RTEMS, but was working on a device independent
flash interface. Does anyone (Jay?) know the status of this port?
JFFS2 seems like a great candidate, and I'd be willing to help with any
Any comments or suggestions would be greatly appreciated.
More information about the users