[ECOS] file stat mode bits and compatibility
Sat Oct 10 13:54:00 GMT 2009
I wanted to share a YAFFS file system between my eCos application and my
u-boot bootloader. Well, since the NAND flash implementations eCos has
YAFFS, and u-boot has it too. I ran into a problem when sharing a YAFFS
file system. The single incompatibility issue is the value of file stat
mode bits. E.g., u-boot has S_IRUSR = S_IREAD = (1<<8) but eCos has
(1<<16). Now, this incompatibility will not only bite me, but anyone who
wants to share a YAFFS file system between RedBoot and Linux or whatever
combination of systems. There seems to be no hook in YAFFS to disable
the permissions altogether.
POSIX does not appear to prescribe values for these bits
so an implementation appears free to choose them. A short investigation
showed that Linux, Solaris, and M$ Visual C++ all have chosen the same
values as u-boot, which makes eCos the odd one out.
Just changing the eCos mode bit definitions will render existing file
systems unusable. So, this proposal: introduce a .cdl option
CYGBLD_ISO_STAT_MODE_COMPATIBILITY in isoinfra.cdl which, when enabled,
has the mode bit definitions like Linux, u-boot, and the rest; and when
disabled (as by default?), has the old situation.
Enabling this stat mode compatibility made the YAFFS file system fully
accessible between u-boot and eCos.
What is the opinion of the list?
If people agree, shall I submit a patch to the ecos-patches list?
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss