《電子技術(shù)應(yīng)用》
您所在的位置:首頁 > 嵌入式技術(shù) > 設(shè)計(jì)應(yīng)用 > 在S3C2410上移植yaffs2文件系統(tǒng)
在S3C2410上移植yaffs2文件系統(tǒng)
中電網(wǎng)
摘要: 如果你的NANDFLASH只是512+16B的,可以只移植yaffs,因?yàn)榧词鼓阋浦擦藋affs2,它也會自動選擇掛載yaffs1的。
關(guān)鍵詞: S3C2410 移植 NAND Flash
Abstract:
Key words :

 

當(dāng)然如果你的NAND FLASH只是512+16B的,可以只移植yaffs,因?yàn)榧词鼓阋浦擦藋affs2,它也會自動選擇掛載yaffs1的。

#cd /public

#tar zxf yaffs2.tar.gz

則/public/yaff2/ 目錄之下即是yaffs2的源碼。

(2)在要移植的內(nèi)核目錄下建立yaffs2文件夾,并將需要的文件拷貝過來:

#cd /public/linux-2.6.11.7-2410/

# cd fs

# mkdir yaffs2

# cd yaffs2

# cp /public/yaffs2/*.h .

# cp /public/yaffs2/*.c .

# cp /public/yaffs2/Makefile-kernel Makefile

# cp /public/yaffs2/Kconfig .

(3)修改 /public/linux-2.6.11.7-2410/fs/Makefile 和 Kconfig文件。

# cd /public/linux-2.6.11.7-2410/fs/

# vi Makefile (將下面一行添加到Makefile中)

obj-$(CONFIG_YAFFS_FS) += yaffs2/

# vi Kconfig (將下面一行添加到Kconfig中)

source "fs/yaffs2/Kconfig

(4)cd /public/linux-2.6.11.7-2410/

make menuconfig

在編譯內(nèi)核時(shí)選擇:

<*> YAFFS2 file system support

<*> 512 byte / page devices

<*> Lets Yaffs do its own ECC

<*> 2048 byte (or larger) / page devices

<*> Autoselect yaffs2 format

<*> Disable lazy loading

<*> Turn off wide tnodes

<*> Turn off debug chunk erase check

(5) 編譯內(nèi)核make zImage

看網(wǎng)上有人編譯過程中出現(xiàn)了問題, 我沒有碰到任何問題,很順利。

By the way : 編譯yaffs時(shí)出現(xiàn)了問題,編譯通過不了,這也是我選擇yaff2 而沒有選yaffs的一大原因。

(6) 現(xiàn)在板子上跑的是2.4的內(nèi)核,將板子上的根文件系統(tǒng)換為yaffs文件系統(tǒng)。具體過程參見文檔。

然后在vivi >param set linux_cmd_line "noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0"

修改啟動參數(shù),然后燒寫剛才生成的2.6的內(nèi)核。

(7) 啟動成功。

NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com

IrCOMM protocol (Dag Brattli)

yaffs: dev is 7939 name is "1f:03"

VFS: Mounted root (yaffs filesystem).

Mounted devfs on /dev

Freeing init memory: 76K

hub.c: USB new device connect on bus1/2, assigned device number 2

usb.c: USB device not accepting new address=2 (error=-110)

hub.c: USB new device connect on bus1/2, assigned device number 3

usb.c: USB device not accepting new address=3 (error=-110)

mount /etc as ramfs

re-create the /etc/mtab entries

/lib/yaffs.o: init_module: Device or resource busy

Hint: insmod errors can be caused by incorrect module parameters, including invsyaffs: dev is 7940 name is "1f:04"

console=/dev/coconsole=/dev/co?sole

init started: BusyBox v0.60.3 (2002.05.13-08:36+0000) multi-c?ll binary

Starting pid 20, console /dev/console: '/etc/init.d/rcS'

Waiting for enter to start '/bin/sh' (pid 25, terminal /dev/console)

Please press Enter to activate this console.

Starting pid 25, console /dev/console: '/bin/sh'

BusyBox v0.60.3 (2002.05.13-08:36+0000) Built-in shell (ash)

Enter 'help'for a list of built-in commands.

此內(nèi)容為AET網(wǎng)站原創(chuàng),未經(jīng)授權(quán)禁止轉(zhuǎn)載。