This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: jffs2 creat file error
Jürgen Lambrecht wrote:
Hello Srinivas,
I had the same problem with that magic bitmask. For all 32b words in
flash it gives that message. Your system probably does not hang, at
mount time it just prints that message for each 4B of your flash ...
The problem is that your flash is not "formatted". You just have to mark
all empty nodes of your flash as unused with that magic bitmask. I have
added a "format jffs2" command to redboot that we run for each new
board. Maybe I should commit this to ecos if someone could use this..
David and I discussed this long ago; simply erasing all the blocks in
the partition (FIS image) that contains the JFFS2 file system is sufficient.
Here's how I create such an image:
RedBoot> lo -r -b 0x100000 image.JFFS2
Raw file loaded 0x00100000-0x0024915f, assumed entry at 0x00100000
RedBoot> fi cr JFFS2 -l 0x800000
This will create an 8MB file system, with the space from 0x249160 through
the end left totally blank. The JFFS2 routines handle this just as well
as having the special markers in place (they are inserted during the first
mount).
And for ARM platforms, there is a bug in gcc that prevents to solve the
magic bitmask problem when noticed. With that bug solved, the first time
you get all those errors printed, but they are solved by writing the
correct magic bitmask.
/* struct jffs2_unknown_node marker = { */
/* .magic = cpu_to_je16(JFFS2_MAGIC_BITMASK), */
/* .nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), */
/* .totlen = cpu_to_je32(c->cleanmarker_size) */
/* }; */
/* patch from 2003-08-04 <Øyvind Harboe <oyvind.harboe@zylin.com>
because of
broken arm-elf-gcc 3.2.1
http://ecos.sourceware.org/ml/ecos-patches/2003-08/msg00006.html */
struct jffs2_unknown_node marker;
memset(&marker, 0, sizeof(marker));
marker.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
marker.nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER);
marker.totlen = cpu_to_je32(c->cleanmarker_size);
There's a test for ARM GCC 3.2.x that's supposed to catch this. Is it
actually broken in other versions as well?
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss