yaffs2

 最近一直在调试cramfs,yaffs2,ubi
由于cramfs压缩比较厉害,导致挂载时间较长,应用程序也需要较长时间加载,内存使用也较大,因此一直寻找能替代cramfs的文件系统。
叫优秀的除了jffs2(评价一般般)外,就剩下yaffs2和ubi了。

先是调试yaffs2.我的内核版本是linux-2.6.32.17,yaffs2已经有支持了。在内核直接选上就可以了。

yaffs2 压缩比太低
40M的空间,写入(有部分会写不进去)后读取出来得到25M-26M的内容
修改内核配置
 |      <*>   YAFFS2 file system support                                             | | 
  | |      -*-     512 byte / page devices                                              | | 
  | |      [ ]       Use older-style on-NAND data format with pageStatus byte           | | 
  | |      [ ]         Lets Yaffs do its own ECC                                        | | 
  | |      -*-     2048 byte (or larger) / page devices                                 | | 
  | |      [*]       Autoselect yaffs2 format                                           | | 
  | |      [*]       Disable YAFFS from doing ECC on tags by default                    | | 
  | |      [ ]       Disable lazy loading                                               | | 
  | |      [*]     Turn off wide tnodes                                                 | | 
  | |      [ ]     Force chunk erase check                                              | | 
  | |      [*]     Cache short names in RAM                                             | | 
  | |      [ ]     Empty lost and found on boot                                         | | 
  | |      [ ]     Disable yaffs2 block refreshing                                      | | 
  | |      [ ]     Disable yaffs2 background processing                                 | |

  后正常 


下面的工作就是在uboot里面烧写yaffs了。
到yaffs2utils开源项目上下载工具yaffs2utils-0.2_pre3.tar.gz
解压
tar -zxvf yaffs2utils-0.2_pre3.tar.gz
make即可生成工具
mkyaffs2 unyaffs2


#mkyaffs2 modules modules.yaffs.img
mkyaffs2-0.2.0_pre3: image building tool for YAFFS2
stage 1: scanning directory ""... [done]
scanning complete, total 7 objects.
stage 2: making image "modules.yaffs.img"
[=================================================================================================================================================] 7/7 100%
operation complete.
7 objects in 96 NAND pages

# ls -alh modules.yaffs.img
-rw-r--r-- 1 root root 198K 2011-07-06 15:12 modules.yaffs.img
#mkyaffs2 -h
mkyaffs2-0.2.0_pre3: image building tool for YAFFS2
Usage: mkyaffs2 [-e] [-h] [-v] [-p size] [-o file] dirname imgfile
mkyaffs2: A utility to make the yaffs2 image
version: 0.2.0_pre3
options:
-h display this help message and exit.
-e convert endian differed from local machine.
-v verbose details instead of progress bar.
-p size page size of target device (512|2048 bytes, default: 2048).
-o file load external oob image file.
制作
mkyaffs2 rootfs/ rootfs.yaffs.img

tftp 0x80700000 rootfs.yaffs.img

引导信息
[ 2.660000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
[ 2.670000] nand_bbt: ECC error while reading bad block table
[ 2.680000] Creating 8 MTD partitions on "davinci_nand.0":
[ 2.680000] 0x000000000000-0x000000080000 : "bootloader"
[ 2.700000] 0x000000080000-0x000000100000 : "params"
[ 2.710000] 0x000000100000-0x000000400000 : "kernel"
[ 2.720000] 0x000000400000-0x000001200000 : "rootfs"
[ 2.730000] 0x000001200000-0x000001300000 : "driver"
[ 2.740000] 0x000001300000-0x000003b00000 : "app"
[ 2.750000] 0x000003b00000-0x000003f00000 : "config"
[ 2.770000] 0x000003f00000-0x000008000000 : "ext"
[ 2.780000] davinci_nand davinci_nand.0: controller rev. 2.3


[ 4.840000] yaffs: dev is 32505859 name is "mtdblock3"
[ 4.840000] yaffs: passed flags ""
[ 4.850000] yaffs: Attempting MTD mount on 31.3, "mtdblock3"
[ 4.870000] yaffs_read_super: isCheckpointed 0
[ 4.880000] VFS: Mounted root (yaffs2 filesystem) on device 31:3.
[ 4.890000] Freeing init memory: 512K
[ 4.890000] Warning: unable to open an initial console.
[ 4.900000] Failed to execute /linuxrc. Attempting defaults...
[ 4.900000] Kernel panic - not syncing: No init found. Try passing init= option to kernel.
[ 4.910000] Backtrace:
[ 4.910000] [<c008c5f4>] (dump_backtrace+0x0/0x114) from [<c039db94>] (dump_stack+0x18/0x1c)
[ 4.920000] r7:00000000 r6:00000000 r5:00000000 r4:c04d05f0
[ 4.930000] [<c039db7c>] (dump_stack+0x0/0x1c) from [<c039dbec>] (panic+0x54/0x12c)
[ 4.940000] [<c039db98>] (panic+0x0/0x12c) from [<c0088634>] (init_post+0xdc/0x104)
[ 4.940000] r3:00000000 r2:c42bfe00 r1:c0504000 r0:c0436543
[ 4.950000] [<c0088558>] (init_post+0x0/0x104) from [<c00084c0>] (kernel_init+0xe8/0x118)
[ 4.960000] r5:00000000 r4:c04cfec0
[ 4.960000] [<c00083d8>] (kernel_init+0x0/0x118) from [<c00a0d88>] (do_exit+0x0/0x668)
[ 4.970000] r5:00000000 r4:00000000

从上面的情况看是挂载失败了。网上查了些资料,感觉是因为uboot对大块flash的支持不够,导致写入的yaffs的ECC问题,因而挂载失败。

yaffs2-source.tar

make
utils$ ./mkyaffs2image -h
mkyaffs2image: image building tool for YAFFS2 built Jul 5 2011
usage: mkyaffs2image dir image_file [convert]
dir the directory tree to be converted
image_file the output file to hold the image
'convert' produce a big-endian image from a little-endian machine


尝试使用

sudo tar -zxvf mkyaffs2image.gz
[sudo] password for ti:
usr/sbin/mkyaffs2image
usr/sbin/mkyaffs2image-128M


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
YAFFS2(Yet Another Flash File System 2)是一种针对嵌入式系统设计的开源嵌入式文件系统。移植YAFFS2到单片机上涉及以下步骤: 1. 了解单片机的硬件和存储器:单片机的硬件架构和存储器类型对文件系统的移植至关重要。需要了解单片机的处理器类型、存储器大小和类型,例如闪存或EEPROM等。 2. 下载和配置YAFFS2:从官方网站或源代码仓库下载YAFFS2的最新版本。根据单片机的硬件和存储器特性,修改YAFFS2的配置文件,例如设置闪存大小、页大小和块大小等。 3. 移植文件操作接口:单片机的操作系统可能不支持标准的文件操作接口,需要根据单片机的特性实现文件系统的操作接口。这些接口包括读写文件、创建删除文件、目录遍历等。 4. 适配存储器驱动程序:YAFFS2需要针对单片机的存储器类型进行适配。根据单片机的存储器接口和特性,修改YAFFS2的底层驱动程序,确保与单片机的存储器正常交互。 5. 编译和链接YAFFS2:使用适当的交叉编译工具链,将YAFFS2编译为单片机可执行的格式。确保编译选项与单片机的体系结构和操作系统匹配。 6. 测试和调试:将移植后的YAFFS2文件系统部署到单片机上,并进行详细的功能测试和性能测试。通过检查文件系统的功能和性能是否符合预期,进行必要的调试和优化。 总之,移植YAFFS2到单片机需要对单片机硬件和存储器有深入的了解,并进行文件操作接口适配和存储器驱动程序适配。合理配置和编译YAFFS2,最后进行测试和调试,确保其正常运行。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值