关于内核配置选项中没有yaffs2这个选项问题的解决方案

从官方网站http://www.aleph1.co.uk/gitweb?p=yaffs2.git;a=summary下载yaffs2源码,解压后给linux3.6.7打补丁:./patch-ker.sh c m /kernel directory,完后看到fs目录下的Kconfig和Makefile文件都有增加yaffs2相关内容;fs目录下也多了yaffs2文件夹。基本上说明打补丁成功了,接下来在linux3.6.7主目录下make menuconfig,找到File Systems--->Miscellaneous filesystem,却没有发现YAFFS2(用的是s3c6400_defconfig)。查看YAFFS2的Kconfig文件,需要先选择MTD_BLOCK才会有显示YAFFS2.

#
# yaffs file system configurations
#

config YAFFS_FS
tristate "yaffs2 file system support"
default n
depends on MTD_BLOCK
select YAFFS_YAFFS1
select YAFFS_YAFFS2
help
yaffs2, or Yet Another Flash File System, is a file system
optimised for NAND Flash chips.

To compile the yaffs2 file system support as a module, choose M
here: the module will be called yaffs2.

If unsure, say N.

Further information on yaffs2 is available at
<http://www.aleph1.co.uk/yaffs/>.

于是去MTD目录下找Kconfig的内容,看到:

config MTD_BLOCK
tristate "Caching block device access to MTD devices"
depends on BLOCK
select MTD_BLKDEVS
---help---
Although most flash chips have an erase size too large to be useful
as block devices, it is possible to use MTD devices which are based
on RAM chips in this manner. This block device is a user of MTD
devices performing that function.

At the moment, it is also required for the Journalling Flash File
System(s) to obtain a handle on the MTD device when it's mounted
(although JFFS and JFFS2 don't actually use any of the functionality
of the mtdblock device).

Later, it may be extended to perform read/erase/modify/write cycles
on flash chips to emulate a smaller block size. Needless to say,
this is very unsafe, but could be useful for file systems which are
almost never written to.

You do not need this option for use with the DiskOnChip devices. For
those, enable NFTL support (CONFIG_NFTL) instead.

也就说需要先选择Device Drivers-->MTD-->Caching block device access to MTD devices,然后才能够在File Systems--->Miscellaneous filesystem下面找到YAFFS2。

保存后make uImage.这时,错误来了:

1.struct super_block(include/fs.h) 缺少成员unsigned char        s_dirt;//需要添加

2.struct super_operations (include/fs.h)缺少成员void (*write_super) (struct super_block *);

//需要添加

3.找不到d_alloc_root()函数;//用d_make_root()函数替换

4.找不到end_writeback()函数;//用clear_node(   )函数替换

5.找不到struct mtd_info 下面的write,read,erase,sync等等成员;//全部在前面加下划线_write,_read,_erase等等。

改完这些再编译就可以了。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值