MicroMonitor TFS & RTEMS
Ed Sutter
esutter at lucent.com
Tue Sep 28 17:27:52 UTC 2004
> >>>All,
> >>>Last night I took Joel's advice (from a while ago) and used the
> >>>tftpDriver.c code as a model for integrating TFS into RTEMS as
> >>>a mountable FS. I shamelessly reused a good portion of the
> >>>generic parts of the code in tftpDriver.c (in places simply
> >>>changing _tftp_ to _tfs_). At first glance, it appears to be
> >>>working fine, and now I can access TFS files through RTEMS's FS.
> >>>
> >>>So, assuming there must be more to it (it just can't be that easy!),
>
> Maybe it can be. You already had the magic code -- all you had to
> do it hook it to the RTEMS filesystem. :)
>
Great! I was cautiously hoping that might be the case.
The tftpDriver.c code was very easy to use as a template, kudos to the
author.
>
> >>>what kind of limitations are imposed by this interface? I see
> >>>there is a limited number of interfaces (no ioctl, fstat,
> >>>etc...), but I hope to eventually get that stuff working.
> >>>Are there any other "gotchas" I need to be aware of for
> >>>integrating TFS into RTEMS as a mountable FS?
>
> Can you have more than one TFS filesystem in a system?
TFS can have several independent "devices". A "device" to TFS
is a block of memory allocated as a single contiguous memory range
for file storage. There can be multiple TFS devices in one flash
device, and there can be multiple non-contiguous blocks of memory
(RAM and/or FLASH) that can be used as independent TFS devices.
There are a lot of different configuration options, none of which
affect the way it would hook up to RTEMS.
> Do you need to consider concurrent access of the filesystem?
> You might want to add a mutex on it.
Yep, I have a stub in the code now, just need to hook it into
something that is RTEMSish.
> Are there API differences between CPU families, MicroMonitor
> versions, etc that need to be accounted for?
Nope, one size fits all. If MicroMonitor is "underneath", then
it just works. The TFS API hasn't changed in quite some time,
and usually when it does, it's just adding something new.
> Of course, the filesystem code is typical of an open source
> project -- severely under documented. So any documentation
> or README is good.
>
> And assuming you will submit it, we need to add it to the Wiki.
Sure, whatever works.
Gotta get to know this "Wiki" stuff. Never used one.
> I think just providing a single directory view for "readdir()" would
> be sufficient.
>
> You should be able to lift at least the shell of this code from the
> IMFS. See cpukit/libfs/src/imfs/*dir*.c
>
> > The fstat and seek
> > functionality is already in TFS's API, so that should easily hook into
> > RTEMS.
>
> Ditto for this code.
Thanks, I'll check out that code and hook it in.
Ed
More information about the users
mailing list