This is the mail archive of the ecos-discuss@sources.redhat.com 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: Re: cannot mount effs2 filesystem at boot


---------- Initial Header -----------

>From      : ecos-discuss-owner@ecos.sourceware.org
To          : "brix82@libero.it" brix82@libero.it
Cc          : "Andrew Lunn" andrew@lunn.ch,"ecos-discuss"
ecos-discuss@sources.redhat.com
Date      : Mon, 30 Aug 2004 16:36:40 +0200
Subject : [ECOS] Re: cannot mount effs2 filesystem at boot

> On Mon, Aug 30, 2004 at 04:10:23PM +0200, brix82@libero.it wrote:
> > I have configured ecos, now the device "/dev/flash1" points to the correct
> > location of the FIS directory:
> >
> > cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
> >     # Flavor: data
> >     user_value 0x00300000
> > }
> >
> > And here is the FIS directory listing:
> >
> > RedBoot> fis list
> > Name              FLASH addr  Mem addr    Length      Entry point
> > RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
> > ...
> > jffs              0x50300000  0x50300000  0x00080000  0x00050000
> >
> > Unfortunately, i can't write to the filesystem. I modified
> > /opt/ecos.massimo/ecos-2.0/packages/fs/jffs2/v2_0/src/os-ecos.h
> > and changed CONFIG_JFFS2_FS_DEBUG to 2. Here are the last few lines of the
output:
> >
> > ...
> > <7>erase_pending_list: 00000000 (used 00000000, dirty 00000000, wasted 00000000,
> > unchecked 00000000, free 00040000)
> > <7>erasable_pending_wbuf_list: empty
> > <7>free_list: empty
> > <7>bad_list: empty
> > <7>bad_used_list: empty
> > <7>Not rotating empty clean_list
> > <7>Not rotating empty very_dirty_list
> > <7>Not rotating empty dirty_list
> > <7>Not rotating empty erasable_list
> > <7>Rotating erase_pending_list by 0
> > <7>Erase block at front of erase_pending_list is at 00000000
> > <7>Not rotating empty free_list
> > <7>jffs2_read_super(): Getting root inode
> > <7>jffs2_read_inode(): inode->i_ino == 1
> > <7>Allocated inocache at 0x00050438
> > <7>jffs2_do_read_inode(): Creating inocache for root inode
> > <7>jffs2_do_read_inode_internal(): ino #1 nlink is 1
> > <7>jffs2_get_inode_nodes(): ino #1
> > <7>jffs2_read_inode() returning
> > <7>jffs2_read_super(): d_alloc_root()
> > <7>Starting erase of pending block 0x00000000
> > <7>Freeing all node refs for eraseblock offset 0x00000000
> > <7>Erase completed successfully at 0x00000000
> > <7>Verifying erase at 0x00000000
> > <7>Writing erased marker to block at 0x00000000
> > <7>jffs2_erase_pending_blocks completed
> > arenasize 66781112, freeblocks 1, totalallocated 1584, totalfree 66779508,
> > maxfree 66779508
> > <INFO>: reading directory /
> > <7>jffs2_readdir() for dir_i #1
> > <7>Dirent 0: ".", ino #1
> > <INFO>: entry              . [mode 00016f01 ino 000503b0 nlink 1 size 0]
> > <7>jffs2_readdir() for dir_i #1
> > <INFO>: entry             .. [mode 00016f01 ino 000503b0 nlink 1 size 0]
> > <7>jffs2_readdir() for dir_i #1
> > <INFO>: create file /foo size 202
> > jffs2_lookup()
> > jffs2_lookup()
> > <7>jffs2_create()
> > <7>jffs2_new_inode(): dir_i 1, mode 0x16f08
> > <7>Allocated inocache at 0x00050750
> > <7>jffs2_do_new_inode(): Assigned ino# 2
> > <7>jffs2_reserve_space(): Requested 0x44 bytes
> > <7>jffs2_reserve_space(): alloc sem got
> > <7>dirty size 0x00000000 + unchecked_size 0x00000000 < sector size 0x00040000,
> > returning -ENOSPC
>
> You have run out of memory.
>
> > I also have an application (a mini shell, this is my real interest) which should
> > browse the jffs2 filesystem image. In the main() function i do this:
> >
> > 	mount( "/dev/flash1", "/", "jffs2" );
> > 	while( 1 ) {
> > 		getcwd( pwd, 100 );
> > 		while( ( putchar(pwd[aptr++] ) ) != 0 );  // print PWD in the prompt
> >                 ...
> >        }
>
> Before you can getcwd() you first need to do a cddir() to /, otherwise
> the cwd is undefined and generally causes problems.
>
>         Andrew

Ok, i added some memory in the "Extra memory required by FLASH device drivers",
and now the shells works better, but not very well. For e
I built my filesystem image with mkfs.jffs2 1.39 for redhat with the following
command:

$ mkfs.jffs2 -o jffs.img -d jffs_tree/ -p 0x00400000 -e 0x00040000
$ ls -l jffs2.img
-rw-r--r--    1 root     root       262144  1 set 11:19 jffs.img

It produces a file of 256Kbytes (the erase block size), although i tried to pad
it to 4Mbytes. Is this ok? I think it's at the origin of the ENOSPC error i
still get when i do a fopen() to create a new file.
Here i try to create a file named "foo2" of size 1000 bytes (first 4 lines are
printed by the shell) :

> create foo2 1000
Creating file with name foo2
Creating file with size 1000
foo2
1000
jffs2_stat
icache_evict
init_dirsearch name = foo2
init_dirsearch dir = 152220
jffs2_find for path =foo2
find_entry
find_entry for name = foo2
jffs2_lookup()
find_entry got dir = 0
jffs2_open
icache_evict
init_dirsearch name = foo2
init_dirsearch dir = 152220
jffs2_find for path =foo2
find_entry
find_entry for name = foo2
jffs2_lookup()
find_entry got dir = 0
<7>jffs2_create()
<7>jffs2_new_inode(): dir_i 1, mode 0x16f08
malloc new_inode 152490 ####################################
<7>Allocated inocache at 0x00152518
<7>jffs2_do_new_inode(): Assigned ino# 6
<7>jffs2_add_ino_cache: Add 0x00152518 (ino #6)
<7>jffs2_reserve_space(): Requested 0x44 bytes
<7>jffs2_reserve_space(): alloc sem got
<7>dirty size 0x00000000 + unchecked_size 0x00000000 < sector size 0x00040000,
returning -ENOSPC
<7>jffs2_do_create(): reserved 0x1509c bytes
<7>jffs2_clear_inode(): ino #6 mode %o
make_bad_inode
free iput inode 152490 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
<7>jffs2_clear_inode(): ino #6 mode %o
jffs2_getinfo
icache_evict
init_dirsearch name =
init_dirsearch dir = 152220
jffs2_find for path =
Error while opening file : No such entity>

It seems there is no space left on device, but i can't understand how to solve
the problem (or how to produce a jffs2 image with some free space, if this is
the solution).
Another strange but not important thing happens when i do the following sequence:

/> cd dir1
/dir1> cd ..
>

As you can see, when i return to the root directory the getcwd() function
doesn't give me the "/" string, but an empty one. This is not important however.
The real problem is to write to the filesystem.

Thanks in advance,

   Marco


--
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]