Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1336762
  • 博文数量: 198
  • 博客积分: 1629
  • 博客等级: 上尉
  • 技术积分: 2743
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-01 15:41
文章分类
文章存档

2023年(6)

2022年(20)

2021年(8)

2020年(3)

2018年(17)

2017年(3)

2016年(3)

2015年(9)

2014年(13)

2013年(17)

2012年(77)

2011年(22)

分类:

2012-04-28 09:19:43

原文地址:yaffs移植 作者:studyfeng

1,内核支持

YAFFS2YAFFS的升级版,能更好的支持NAND FLASH,我们采用最新的YAFFS2文件系统。我们首先下载YAFFS文件系统。

下载完成以后解压着文件包,在文件包的根目录下面有个文件patch-ker.sh,我们执行这个文件,就可以很轻松的把yaffs2加入到内核中。具体命令是:

[root@localhost yaffs2]# sh patch-ker.sh /linux2.6_2410/linux-2.6.14

这里我们假设我们的linux2.6.14的内核在/linux2.6_2410/linux-2.6.14目录下。执行完成以后,我们的yaffs2已经加入到了内核,在内核的fs目录下你会发现多了一个yaffs2目录,在这个目录下是yaffs2的相关内容,在内核的配置菜单[File systems]à[miscellaneous filesystems]中增加了[Yaffs2 file systems support]选项。这个选项就是yaffs2的配置内容。我们可以选择这个选项的全部内容,保存配置,然后退到终端,输入make,重新编译内核,内核中就增加了对yaffs2文件系统的支持。

主要是把yaffs2文件系统的文件拷贝到fs目录,并修改MakefileKconfig文件。

在配置方面有些地方要注意一下,以下是我的配置信息:


1,首先make menuconfig,进入配置窗口,然后选择”load an Alternate Configuration File”

arch/arm/configs/smdk2410_defconfig配置文件load进来。


2,进入Device Drivers->Memory Technology Devices(MTD)目录,配置界面如下:

Memory Technology Device (MTD) support

[ ] Debugging │ │

[ ] MTD concatenating support │ │

[*] MTD partitioning support │ │

[ ] RedBoot partition table parsing │ │

[ ] Command line partition table parsing │ │

[ ] ARM Firmware Suite partition parsing │ │

--- User Modules And Translation Layers │ │

[*] Direct char device access to MTD devices │ │

[*] Caching block device access to MTD devices │ │

[ ] FTL (Flash Translation Layer) support │ │

[ ] NFTL (NAND Flash Translation Layer) support │ │

[ ] INFTL (Inverse NAND Flash Translation Layer) support │ │

RAM/ROM/Flash chip drivers ---> │ │

Mapping drivers for chip access ---> │ │

Self-contained MTD device drivers ---> │ │

NAND Flash Device Drivers ---> │ │


3,进入NAND Flash Device Drivers目录,配置界面如下:

[*] NAND Device Support │ │

[ ] Verify NAND page writes │ │

[*] NAND Flash support for S3C2410/S3C2440 SoC │ │

[*] S3C2410 NAND driver debug │ │

[ ] S3C2410 NAND Hardware ECC │ │

[ ] DiskOnChip 2000, Millennium and Millennium Plus (NAND reimplement│ │

[ ] Support for NAND Flash Simulator │ │


回到File systems->Miscellaneous filesystems目录,配置信息如下:

[*] YAFFS2 file system support │ │

--- 512 byte / page devices │ │

[*] Lets Yaffs do its own ECC │ │

[*] Use the same ecc byte order as Steven Hill's nand_ecc.c │ │

--- 2048 byte (or larger) / page devices │ │

[*] Autoselect yaffs2 format │ │

[*] Disable lazy loading │ │

[*] Turn off wide tnodes │ │

[*] Turn off debug chunk erase check │ │

[*] Cache short names in RAM



2.6.12fs/Kconfig中拷贝下面几项到2.6.14fs/Kconfig中去:


config DEVFS_FS

bool "/dev file system support (OBSOLETE)"

depends on EXPERIMENTAL

help

This is support for devfs, a virtual file system (like /proc) which

If unsure, say N.


config DEVFS_MOUNT

bool "Automatically mount at boot"

depends on DEVFS_FS

help

This option appears if you have CONFIG_DEVFS_FS enabled. Setting

this to 'Y' will make the kernel automatically mount devfs onto /dev

when the system is booted, before the init thread is started.

You can override this with the "devfs=nomount" boot option.

If unsure, say N.


config DEVFS_DEBUG

bool "Debug devfs"

depends on DEVFS_FS

help

If you say Y here, then the /dev file system code will generate

debugging messages. See the file

for more

details.

If unsure, say N.

重新make menuconfig 在File systems->Pseudo filesystems目录里面可以后到devfs的配置选项如下:

[*] /proc file system support │ │

[*] /dev file system support (OBSOLETE) │ │

[*] Automatically mount at boot │ │

[*] Debug devfs │ │

[*] Virtual memory file system support (former shm fs) │ │

[ ] Relayfs file system support

改变启动参数

noinitrd root=/dev/mtdblock/3 init=linuxrc console=ttySAC0,115200

好了,应该完成了,保存配置后,make 生成的zImage下载到flash中就可以成功挂载yaffs2文件系统了(我现在用的是原来2.4内核用的yaffs2文件系统,所以,我现在只是帮我的板换了个2.6的内核而已,下一步打算搞一个属于自己的文件系统,呵呵)。

/****************************

声明:

由于这次作Linux确实是第一次接触,大量查找了网上的资源,目的也就是编一个 最为简单的操作系统,于是乎所作步骤所写总结可能会很多copy自其他地方,敬请作者谅解

备注:

编译器版本:arm-linux-gcc3.4.5

参考文档:luofuchong在华恒上的帖子


阅读(2912) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~