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: cannot mount effs2 filesystem at boot


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
<7>jffs2_do_create(): reserved 0x15e98 bytes
<7>jffs2_clear_inode(): ino #2 mode %o
<7>jffs2_clear_inode(): ino #2 mode %o
<FAIL>: open() returned -1 Unknown error
<FAIL>: write() returned -1 Bad file handle
<FAIL>: write() returned -1 Bad file handle
<FAIL>: write() returned -1 Bad file handle
...

What is wrong? I cannot find any reason for these errors.
(There are no 'lock' and 'unlock' commands in RedBoot, i guess it's not the
latest release. So it's not a locking problem)

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
                ...
       }

However, when i execute the binary i get errors:

RedBoot> go
<7>jffs2: read_super
<7>Allocating readbuf of 4096 bytes
<7>jffs2_scan_eraseblock(): Scanning block at 0x0
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x2003
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x000c
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xdc6d
instead
<7>Found empty flash at 0x00000010
<7>Empty flash ends normally at 0x00000400
<7>Fewer than %zd bytes (node header) left to end of buf. Reading 0xc at 0x00001000
<7>Found empty flash at 0x00000404
<7>Empty flash ends normally at 0x00001400
<7>Fewer than %zd bytes (node header) left to end of buf. Reading 0xc at 0x00001000
...

It seems to be looking for a filesystem at the address 0x0 instead of
0x50300000; but why did the fileio1 binary find it?

Thanks,

     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]