Linux-2.6.32.2內(nèi)核在mini2440上的移植(二_第1頁
Linux-2.6.32.2內(nèi)核在mini2440上的移植(二_第2頁
Linux-2.6.32.2內(nèi)核在mini2440上的移植(二_第3頁
Linux-2.6.32.2內(nèi)核在mini2440上的移植(二_第4頁
Linux-2.6.32.2內(nèi)核在mini2440上的移植(二_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、Linux-內(nèi)核在mini2440上的移植(二)-yaffs2文件系統(tǒng)移植 移植環(huán)境(紅色粗字體字為修改后內(nèi)容,藍(lán)色粗體字為特別注意內(nèi)容)1,主機(jī)環(huán)境:VMare下CentOS 5.5 ,1G內(nèi)存。2,集成開發(fā)環(huán)境:Elipse IDE3,編譯編譯環(huán)境:arm-linux-gcc v4.4.3,arm-none-linux-gnueabi-gcc v4.5.1。4,開發(fā)板:mini2440,2M nor flash,128M nand flash。5,u-boot版本:u-boot-2009.086,linux 版本:linux-7,參考文章:【1】嵌入式lin

2、ux應(yīng)用開發(fā)完全手冊,韋東山,編著?!?】/u3/showart_.html【3】Mini2440 之Linux 移植開發(fā)實戰(zhàn)指南2.1, yaffs2文件系統(tǒng)移植【1】獲取yaffs2 源代碼現(xiàn)在大部分開發(fā)板都可以支持 yaffs2 文件系統(tǒng),它是專門針對嵌入式設(shè)備,特別是使用nand flash 作為存儲器的嵌入式設(shè)備而創(chuàng)建的一種文件系統(tǒng),早先的yaffs 僅支持小頁(512byte/page)的nand flash,現(xiàn)在的開發(fā)板大都配備了更大容量的nand flash,它們一般是大頁模式的(2K/page),使用yaffs2 就可以支

3、持大頁的nand flash,下面是yaffs2 的移植詳細(xì)步驟。在 /node/346 可以下載到最新的yaffs2 源代碼,需要使用git工具( 安裝方法見Git版本控制軟件安裝與使用),在命令行輸入:rootlocalhost # cd ./linux-testrootlocalhost linux-test# git clone git:/www.aleph1.co.uk/yaffs2Cloning into yaffs2.remote: Counting objects: 6592, done.remote: Compressing object

4、s: 100% (3881/3881), done.remote: Total 6592 (delta 5237), reused 3396 (delta 2642)Receiving objects: 100% (6592/6592), 3.34 MiB | 166 KiB/s, done.Resolving deltas: 100% (5237/5237), done.rootlocalhost linux-test# lslinux- linux-2.6.39 yaffs2rootlocalhost linux-test# 片刻時間之后,可以看到下載的最新的yaffs2

5、的源代碼目錄?!?】為內(nèi)核打上yaffs2 補(bǔ)丁(1)將yaffs2代碼加入內(nèi)核這可以通過yaffs2目錄下的腳本文件patch-ker.sh來給內(nèi)核打補(bǔ)丁,用法如下:usage: ./patch-ker.sh c/l kernelpathif c/l is c, then copy. if l then link.這表明,如果c/l是c,則yaffs2的代碼會被復(fù)制到內(nèi)核目錄下,如果是l,則在內(nèi)核的目錄下創(chuàng)建一些鏈接文件。這里yaff2所在的目錄/root/linux-test/,和linux-在同一個目錄下,執(zhí)行如下命令打補(bǔ)?。簉ootlocalhost yaffs2# .

6、/patch-ker.sh c /root/linux-test/linux-usage: ./patch-ker.sh c/l m/s kernelpathif c/l is c, then copy. If l then linkif m/s is m, then use multi version code. If s then use single version coderootlocalhost yaffs2# ./patch-ker.sh c s /root/linux-test/linux-* Warning *You have chosen t

7、o use the single kernel variant of the yaffs VFS glue codethat only works with the latest Linux kernel tree. If you are using an olderversion of Linux then you probably wanted to use the multi-version variant byre-running the patch-ker.sh script using m as a the second argument.ie ./patch-ker.sh c m

8、 /root/linux-test/linux-Updating /root/linux-test/linux-/fs/KconfigUpdating /root/linux-test/linux-/fs/Makefilerootlocalhost yaffs2# 注意第二個參數(shù)m/s,如果不指定,有時會執(zhí)行失敗。上述命令完成下面三件事:修改內(nèi)核文件/fs/Kconfig,增加下面兩行(在177行附近):if MISC_FILESYSTEMSsource fs/adfs/Kconfigsource fs/affs/Kconfigsource fs

9、/ecryptfs/Kconfigsource fs/hfs/Kconfigsource fs/hfsplus/Kconfigsource fs/befs/Kconfigsource fs/bfs/Kconfigsource fs/efs/Kconfigsource fs/yaffs2/Kconfigsource fs/jffs2/Kconfig# UBIFS File system configuration修改內(nèi)核文件/fs/Makefile,增加下面兩行(在129行附近):obj-$(CONFIG_GFS2_FS) += gfs2/obj-$(CONFIG_EXOFS_FS) += ex

10、ofs/obj-$(CONFIG_YAFFS_FS) += yaffs2/在內(nèi)核文件的fs目錄下創(chuàng)建yaffs2子目錄,然后復(fù)制如下文件:將yaffs2源碼目錄下的Makefile.kernel文件復(fù)制為內(nèi)核fs/yaffs2/Makefile文件。將yaffs2源碼目錄下的Kconfig文件復(fù)制為內(nèi)核fs/yaffs2/目錄下。將yaffs2源碼目錄下的*.c、*.h文件(不包括子目錄下的文件)復(fù)制為內(nèi)核fs/yaffs2/目錄下。(2)配置內(nèi)核選項閱讀內(nèi)核fs/Kconfig文件可以了解各配置選項的作用。以下是用到的幾個選項:CONFIG_YAFFS_FS:支持yaffs文件系統(tǒng)。CONF

11、IG_YAFFS_YAFFS2:支持yaffs2文件系統(tǒng),對于每頁大小為2k字節(jié)nand flash,需要選中這個選項。CONFIG_YAFFS_AUTO_YAFFS2:自動選擇yaffs2文件格式,如果不配置這個選項,必須使用yaffs2字樣來表示yaffs2文件系統(tǒng)格式,如果配置這個選項,則可以使用yaffs字樣來統(tǒng)一表示yaffs1和yaffs2文件系統(tǒng)格式,驅(qū)動程序會根據(jù)nand flash的頁大小自動分辨是yaffs1還是yaffs2?!?】配置和編譯帶YAFFS2 支持的內(nèi)核在Linux 內(nèi)核源代碼根目錄運(yùn)行:rootlocalhost linux-test# cd linux-2

12、.6.32.2rootlocalhost linux-# make menuconfig移動上下按鍵找到File Systems,如圖按回車進(jìn)入該子菜單,再找到“Miscellaneous filesystems”菜單項,如圖按回車進(jìn)入該子菜單,找到“YAFFS2 file system support”,如圖按空格選中它,這樣我們就在內(nèi)核中添加了yaffs2 文件系統(tǒng)的支持,按“Exit”退出內(nèi)核配置。最好選中“Yes”保存。2.2,編譯測試修改完成之后,因為內(nèi)核中已經(jīng)增加要編譯的模塊,所以要先執(zhí)行:rootlocalhost linux-# make cle

13、an不然可能編譯出錯,然后進(jìn)行編譯:rootlocalhost linux-# make uImage編譯完成后,生成zImage文件,然后給開發(fā)板上電,啟動u-boot,操作如下:u-bootMINI2440# tftp uImagedm9000 i/o: 0x, id: 0x90000a46DM9000: running in 16 bit modeMAC: 08:00:3e:26:0a:5boperating at 100M full duplex modeUsing dm9000 deviceTFTP from server 28; our IP add

14、ress is 29Filename uImage.Load address: 0xLoading: #doneBytes transferred = (2034e0 hex)u-bootMINI2440# bootm# Booting kernel from Legacy Image at .Image Name: Linux-Created: 2011-05-27 4:56:08 UTCImage Type: ARM Linux Kernel Image (uncompressed)Data Size: Bytes = 2 MBLoad Address: E

15、ntry Point: Verifying Checksum . OKLoading Kernel Image . OKOKStarting kernel .Uncompressing Linux. done, booting the kernel.Linux version (rootlocalhost.localdomain) (gcc version 4.4.3 (ctng-1.6.1) ) #8 Fri May 27 12:55:46 CST 2011. .S3C24XX NAND Driver, (c) 2004 Simtec Electronicss3c24xx-

16、nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29nss3c24xx-nand s3c2440-nand: NAND soft ECCNAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)Scanning device for bad blocksCreating 5 MTD partitions on NAND 128MiB 3,3V 8-bit:0x0-0x0 : bootuncorrectable error :

17、0x0-0x0 : paramftl_cs: FTL header not found.0x0-0x0 : kernelftl_cs: FTL header not found.0x0-0x0 : rootmtd: partition root extends beyond the end of device NAND 128MiB 3,3V 8-bit- size truncated to 0x7aa0000ftl_cs: FTL header not found.0x0-0x0 : nandmtd: partition nand extends beyond the end of devi

18、ce NAND 128MiB 3,3V 8-bit- size truncated to 0xuncorrectable error :dm9000 Ethernet Driver, V1.31上面出現(xiàn)還出現(xiàn)“ftl_cs: FTL header not found.”原來應(yīng)在配置菜單-Device Drivers -Memory Technology Devices (MTD),如圖按空格鍵取消選擇,然后選“Exit”退出,最后出現(xiàn)保存提示時選擇“Yes”保存。然后在終端中執(zhí)行:rootlocalhost linux-# make clean然后執(zhí)行rootlocalhost

19、 linux-# make uImage編譯完成后在u-boot中下載、運(yùn)行:u-bootMINI2440# tftp uImagedm9000 i/o: 0x, id: 0x90000a46DM9000: running in 16 bit modeMAC: 08:00:3e:26:0a:5boperating at 100M full duplex modeUsing dm9000 deviceTFTP from server 28; our IP address is 29Filename uImage.Load address: 0xLo

20、ading: #doneBytes transferred = (2034e0 hex)u-bootMINI2440# bootm. .S3C24XX NAND Driver, (c) 2004 Simtec Electronicss3c24xx-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29nss3c24xx-nand s3c2440-nand: NAND soft ECCNAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V

21、 8-bit)Scanning device for bad blocksCreating 5 MTD partitions on NAND 128MiB 3,3V 8-bit:0x0-0x0 : boot0x0-0x0 : param0x0-0x0 : kernel0x0-0x0 : rootfs0x0-0x0 : nanddm9000 Ethernet Driver, V1.31可以看到,前面的出現(xiàn)“ftl_cs: FTL header not found.”信息沒有了。但還是看到下面信息:VFS: Unable to mount root fs via NFS, trying flopp

22、y.VFS: Cannot open root device nfs or unknown-block(2,0)Please append a correct root= boot option; here are the available partitions:1f00 256 mtdblock0 (driver?)1f01 128 mtdblock1 (driver?)1f02 5120 mtdblock2 (driver?)1f03 mtdblock3 (driver?)1f04 mtdblock4 (driver?)Kernel panic - not syncing: VFS: U

23、nable to mount root fs on unknown-block(2,0)這是因為內(nèi)核引導(dǎo)參數(shù)設(shè)置問題,在u-boot命令行執(zhí)行u-bootMINI2440# printenvbootargs=noinitrd console=ttySAC0, init=/linuxrc root=/dev/mtdblock3 rw rootfstype=yaffs ip=29:28:::eth0:offbootcmd=nand read 0x 0x80000 0x;bootm 0xbootdelay=3baudrate=ethaddr=08:00:3e:26:0a:5bipaddr=29serverip=10.1.

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論