This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Creating a file in JFFS2 within FIS


"/dev/flash" is independent of any file-system. It is a facility
provided to do block write and read to/from the flash device, just like
any other file, using "open". Flash filesystem is built on top of this
basic flash driver.   

Jffs2 has to be explicitly mounted, to make it work.
Also note that it is mentioned somewhere in the code that if 'dev/flash"
is blank, then the code will automatically create a jffs2 partition on
it. But I'm not very sure about that. Please verify it once.

regards,
Alok

-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Paul D.
DeRocco
Sent: Tuesday, July 24, 2007 3:11 AM
To: 'Andrew Lunn'
Cc: 'ecos-discuss'
Subject: RE: [ECOS] Creating a file in JFFS2 within FIS

> >On Sun, Jul 22, 2007 at 01:06:54AM -0400, Paul D. DeRocco wrote:
> >
> > System: Atmel EB40A, ARM7. Redboot has FIS, and there's a blank 
> > "image" called "jffs2". eCos application loaded over serial 
> > for now, 
> > includes Posix, flash, JFFS2, etc.
> > 
> > My app is trying to create a file, using
> > 
> >   f = open("/dev/flash/fis/jffs2/cal.bin", 
> >              O_WRONLY|O_CREAT|O_TRUNC);
> > 
> > Down inside flashiodev_lookup, it's detecting the "fis/" 
> > part of the string, and trying to do the 
> > CYGNUM_CALL_IF_FLASH_FIS_GET_FLASH_BASE 
> > function on the name "jffs2/cal.bin", but the latter is returning 
> > -ENOENT. I'm under the impression that JFFS2 is supposed to 
> > be able to 
> > automatically initialize a blank flash area, but I also don't think 
> > it's getting that far. Am I missing something? Do I have to do an 
> > explicit mount? It seems like the system is designed so that 
> > "/dev/flash/fis" doesn't need mounting. Is the Redboot 
> > flash function somehow expecting a name like "jffs2" instead of 
> > "jffs2/cal.bin"? Any ideas?

> From: Andrew Lunn [mailto:andrew@lunn.ch] 
> 
> You need to mount the filesystem. It is not automagically 
> mounted. There is a way to use FIS to indicate the location 
> of the filesystem in flash, however, im not sure how to use 
> it. Take a look at CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1 in 
> io/flash/current/

That appears to be related to the legacy flash driver. I'm using the
version
2 driver. I've selected CYGPKG_IO_FLASH_BLOCK_DEVICE and
CYGFUN_IO_FLASH_BLOCK_FROM_FIS.

I thought mounting was necessary in order to make the system recognize a
particular name in the form of "/dev/foo". However, the system is
already
recognizing "/dev/flash", so that suggests that it is already mounted.
It's
already getting to the flashiodev_lookup function in flashiodev.c, where
special code checks for the "fis/" part of the string. Where it's
failing is
in the VV call to Redboot to get the base address of the flash. Yet the
Redboot signon shows the flash address range, and the "fis list" command
shows my image named "jffs2". However, as I said, it's asking Redboot to
find "jffs2/cal.bin" (the file I'm trying to create), not just "jffs2".

Or is there a second level of mounting needed to mount JFFS2, as opposed
to
the flash device? I'm looking at the mount() function call, but I can't
figure what would be the devname and what would be the dir.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss




--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]