Chinaunix

标题: jffs2 挂载的问题 [打印本页]

作者: bob2004    时间: 2007-07-23 16:47
提示: 作者被禁止或删除 内容自动屏蔽
作者: bob2004    时间: 2007-07-23 16:51
提示: 作者被禁止或删除 内容自动屏蔽
作者: sep    时间: 2007-07-23 17:16
以前看nand flash ,是说 不能在nand flash 中执行程序 ,那用jffs2作根文件系统 又是怎么实现的呢?  至少  linuxrc是应该在 jffs2 的分区里执行的吧 ? 有点矛盾了啊 。

能不能在nandflash中执行程序和根文件系统无关。不能在nandflash执行程序是指存放到nandflash中的程序数据要copy到interSRAM或SDRAM中执行,这是由nandflash的特性决定的。你的kernel、文件系统在bootloader阶段就已经被copy到SDRAM中去了,除了开始的4k在“步进石”中执行外,后来都是在SDRAM中执行的。
jffs2根文件系统,我记得是一种可以读写的文件系统;这和cramfs不同,cramfs是只读的。

BTW,没用过jffs2系统,只接触过cramfs和yaffs。尝试一下yaffs吧,广州友善之臂有一些资料,说得比较详细。
作者: bob2004    时间: 2007-07-24 09:39
提示: 作者被禁止或删除 内容自动屏蔽
作者: smalloc    时间: 2007-07-24 16:02
我觉得是设置没配正确
0x1985 not found at 0x001b81c0: 0x0da6
说明在一些固定的地址有确定的值,而你的值确实随机的,也许是ezarerblock的大小不对,猜测而已
作者: bob2004    时间: 2007-07-25 10:05
提示: 作者被禁止或删除 内容自动屏蔽
作者: smalloc    时间: 2007-07-25 14:08
试试#CONFIG_JFFS2_FS_WRITEBUFFER is not set
作者: bob2004    时间: 2007-07-25 21:26
提示: 作者被禁止或删除 内容自动屏蔽
作者: sky_lihongyu    时间: 2007-07-31 11:34
建议把flsah全部擦除然后重bootloader开始所有的都重新烧写一次,有可能就行了!
作者: x4ulocca    时间: 2007-08-03 09:12
bob老大, 问题解决了没有啊?
作者: crifan    时间: 2008-03-30 03:01
如果挂载jffs2的时候,出现类似于:

CLEANMARKER node found at 0x0042c000 has totlen 0xc != normal 0x0  

的问题,则见到网上说的办法:

在嵌入式Linux系统中挂载 jffs2 根文件系统

二、制作根文件系统的JFFS2镜像。使用MTD工具中的mkfs.jffs2命令,具体做法如下: mkfs.jffs2 -r /home/tekkamanninja/working/nfs/rootfs -o rootfs.jffs2 -e 0x4000 --pad=0x500000 -s 0x200 -n

各参数的意义:(1)-r : 指定要做成image的源資料夾.
(2)-o : 指定輸出image檔案的文件名.
(3)-e : 每一塊要抹除的block size,預設是64KB.要注意,不同的flash, 其block size會不一樣.我的是三星的K9F1208U0B.
(4)--pad (-p): 用16進制來表示所要輸出檔案的大小,也就是root.jffs2的size。很重要的是, 為了不浪費flash空間, 這個值最好符合flash driver所規劃的區塊大小.以我的板子來說,就是5MB.
(5)如果挂载后会出现类似:CLEANMARKER node found at 0x0042c000 has totlen 0xc != normal 0x0   的警告,则加上 -n 就会消失。
(6) 还有的选项,自己看帮助!-h


不过,貌似网上记得有人说过,这样最好还是加上:

What is cleanmarker and what it is used for ?

Cleanmarker is a special JFFS2 node which is written to the beginning of
a block just after the block has been erased. On NOR flashes it is a
special small JFFS2 node at the beginning of the block. On NAND flashes
it is placed to the spare area of the first page.

The main reason why cleanmarkers are used is the need to be sure that
the block erase operation was correctly completed. All 0xFF bytes in the
block are not necessarily mean the block is ready to be utilized. For
example, if an unclean reboot happened just at the end of the block
erase cycle, the block might have unstable bits, which are read as "1"
one time and might be read as "0" next time.

When preparing a flash partition for JFFS2, it is recommended to put
cleanmarkers to the erased blocks. This might be done my means of "-j"
option of the "flash_eraseall" MTD utility. Otherwise, JFFS2 will re-
erase the blocks which contain all 0xFF and have no cleanmarker. This is
an unneeded wasting of time.

但是呢,对于大家常见的,也极少出现reboot的情况,所以我们在保证在对nand flash上分区制作jffs2的时候(???),没有reboot,这时候,就可以去掉那个 了,也就是加上 -n 或者 --no-cleanmarker

就像这这位说的:

http://lists.infradead.org/piper ... 04-June/009835.html

> Hi,
> I'm playing with jffs2 on NAND chips (Samsung 128Mbyte), MTD CVS is week
> old and kernel is 2.6.5.
>
> I'm making image with
> ./mkfs.jffs2 -b --eraseblock=131072 --pagesize=2048 -p -r /test_root -v -o
> test_root.img
>
> and then copy it with cp (nandwrite seems to have problems wiht endianess). > Everything work fine except on mounting filesystem I have messages:
>
> CLEANMARKER node found at 0x00000000 has totlen 0xc != normal 0x0
> CLEANMARKER node found at 0x00020000 has totlen 0xc != normal 0x0
> CLEANMARKER node found at 0x00040000 has totlen 0xc != normal 0x0

On NAND we store the cleanmarker (markes a clean erased block) in the out of
band area. So the cleanmarker node should be omitted when creating the fs
image. Add -n to the options




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2