公告

非常抱歉,由于我们的服务器提供商硬盘出错,数据丢失,网站重建中...
I am so sorry, because of our server's hard disk error, data lost, the website reconstructioning
QQ:512000523
MSN : funchip@hotmail.com

 
首页 arrow 技术文章 arrow pla arrow 让linux内核支持yaffs
让linux内核支持yaffs Recommend to my friend via E-mail(推荐给朋友)
作者: Administrator   
2007-11-15

yaffs具有不易失特性,在嵌入式系统中占有一席之地。

下面介绍如何在内核中添加对yaffs文件系统的支持,以及如何使用yaffs根文件系统启动linux系统。

add yaffs fs support in kernel and make yaffs rootfs
1 preparation
  adownload yaffs source code and add it in your kernel source code in fsyaffs
    httphusaberg.toby-churchill.comballoonlinux-2.6.8.1-tcl1fsyaffs
    modify fsKconfig , add following option
    config YAFFS_FS
        tristate YAFFS filesystem support
        depends on MTD_NAND
       help
        If you want YAFFS support on NAND flash devices you either need to have
        NAND mtd support or customise the NAND interface.
        YAFFS is a journaling filesystem tailored to the idiosyncrasies of
        NAND flash memory. For further details see
        YAFFS is also available as a module ( = code which can be
        i nserted in and removed from the running kernel whenever you want).
        The module is called nfsd. If you want to compile it as a module,
        say M here and read . If unsure,
        say N.

        config CRAMFS
        tristate Compressed ROM file system support (cramfs)
        ...

  bdownload nandwrite.c , nanddump.c and eraseall.c from
      ftp166.111.68.183pubembeduclinuxsoftuClinux-distusermtd-utils
        compile them.
        arm-linux-gcc nandwrite.c -o nandwrite
        arm-linux-gcc nanddump.c -o nanddump
        arm-linux-gcc eraseall.c -o eraseall

  cmodify devs.c to add a new partition in mtd (optional) , the yaffs will be in theyaffs partition
    like
    {
        name user,
        size 0x00c00000,
        offset 0x00400000,
        mask_flags MTD_WRITEABLE,
    }, {
        name yaffs,
        size 0x02000000,
        offset 0x01000000,
        mask_flags MTD_WRITEABLE,
    }
    ......
    nr_partitions 6 ,

    note if you do so, the bootloader(vivi)'s partition table should be changed too.(part deladd)
2 compile your kernel
3 make yaffs partition
    amake yaffs image
        download mkyaffsimage from httphusaberg.toby-churchill.comballoonreleasesv0.7roots
        put your files in temp directory
        .mkyaffsimage temp temp.yaffs
    bwrite image to flash
        .eraseall devmtd5
        .nandwrite devmtd5 temp.yaffs 16384
    noteI've read the source code of yaffs, and find that the first block is not scaned when the super block is loaded. So             your image should be write to the second block.
            Each block is 51232 (BYTESPERCHUNKCHUNKSPERBLOCK) bytes.
4 Good luck.....

 

在嵌入式系统中应用yaffs。。。- -
                                      

首先download一个yaffs的源程序包。。。

解压,进入yaffs/utils目录,编辑Makefile为自己相应的资源目录

make mkyaffs

make mkyaffsimage

产生两个bin工具。。。

进入目标板程序,

mkyaffsimage是用来产生img用的,例如

./mkyaffsimage /dir filename.img

就会产生一个filename.img的文件,再

./mkyaffs /dev/mtd1 filename.img,

把mtd1设备mount到相应的目录,就可以了。

评论 (0)Add Comment

输入评论内容
quote
bold
italicize
underline
strike
url
image
quote
quote
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley

security code
输入验证码


busy
最近更新 ( 2007-11-18 )
 
< 上一篇   下一篇 >

© 2008 杭州福芯电子 浙ICP备05040812号
Joomla!是基于GNU/GPL许可发行的免费软件.