全部博文(584)
分类: LINUX
2010-06-09 16:29:17
转载时请表明原文出处(http://blog.sina.com.cn/wyw1976)及作者邮箱()
1. 下载mkyaffs源码:
2.
(1) MAKETOOLS = arm-linux-
(2) CFLAGS = 增加“-I /your-kernel-include-dir” 指向你的平台的内核目录,例如/src/preview-kit/linux-2.6.28/include
(3) 这时make, 可能会报错,“'mtd_info_t' has no member named 'oobblock'”,原因是我的系统不支持oobblock,解决的办法可以直接将报错的代码注释掉。
(4) 还可能的一个报错是“mtd-abi.h:16: error: expected ':', ',', ';', '}'
or '__attribute__' before '*'
token,原因是mtd-abi.h中有一个“__user”没有定义,而他的定义在
(5) 现在应该成功的编译出mkyaffs
3.运行mkyaffs
(1)如果运行“./mkyaffs /dev/mtdblock5”, 会报错“MEMGETINFO: Inappropriate ioctl for device”,原因是mtd block device 不支持这个ioctrl,只有mtd char device才支持,参见drivers/mtd/mtdchar.c, drivers/mtd/mtdblock.c
(2) 因此正确的用法是“./mkyaffs /dev/mtd5”, 则是它有报“MEMSETOOBSEL: Inappropriate ioctl for device”,同样是因为系统不支持,注释掉
(3)重新编译,运行,成功!输出信息:
argc 2 sh 0 optcnt 1
Erasing and programming NAND
Erasing block at 0x080
Erasing block at 0x0820000
Erasing block at 0x0840000
Erasing block at 0x0860000
Erasing block at 0x0880000
Erasing block at 0x08a0000
Erasing block at 0x08c0000
Erasing block at 0x08e0000
.....
OK
(4) mkdir /mount_yaffs
(5) mount -t yaffs /dev/mtdblock5 /mount_yaffs