歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

idea6410 linux3.6.6的yaffs移植

其實移植yaffs還是比較簡單,代碼編譯還是挺順利的,但是我碰到了第一次燒寫不能啟動,的重新燒寫內核才行,剛開始移植認為是Ecc校驗有問題,查了好久,今天來了靈感,在燒寫是突然想到內核是多大,超過了2M,唉,這個問題糾結了好久啊~終於解決了~

第一步,我們需要YAFFS2的源碼,如果大家有興趣想了解YAFFS2文件系統的驅動原理的話可以直接去訪問他們的官網,地址是www.yaffs.net

下載是有兩種方法:一種用git,還有一種直接下載~不過直接下載可能打不開

第二步,將下載下來的YAFFS2最新源碼 YAFFS2.tar.gz 放入你Linux的任意一個目錄下,執行 tar zxvf YAFFS2.tar.gz 然後進入YAFFS2源碼包,由於最新的源碼再執行腳本 patch-ker.sh(具體方法見此目錄下README-linux-patch) 時 有四個參數,可以追加:c,l,m,s,
./patch-ker.sh  c/l m/s kernelpath
if c/l is c, then copy. If l then link
if m/s is m, then use multi version code. If s then use single version code
上面這段英文應該很好懂吧,簡而言之,C 是復制文件,L是鏈接文件,M是多種,S是單個的
xiao@urbetter-Ubuntu:~/linux-3.6.6$ ./patch-ker.sh c m ../linux-3.6.6    即可!
 
第三步:配置(make menuconfig)
 Device Drivers  --->
 <*> Memory Technology Device (MTD) support  --->
                    <*>  Direct char device access to MTD devices                                              | | 
  | |                    -*-  Common interface to block layer for MTD 'translation layers'                          | | 
  | |                    <*>  Caching block device access to MTD devices
 File systems  --->
[*] Miscellaneous filesystems  --->
<*>  yaffs2 file system support                                                            | | 
  | |                    -*-    512 byte / page devices                                                            | | 
  | |                    [ ]      Use older-style on-NAND data format with pageStatus byte                          | | 
  | |                    [ ]        Lets yaffs do its own ECC                                                      | | 
  | |                    -*-    2048 byte (or larger) / page devices                                                | | 
  | |                    [*]      Autoselect yaffs2 format                                                          | | 
  | |                    [ ]      Disable yaffs from doing ECC on tags by default                                  | | 
  | |                    [ ]    Force chunk erase check                                                            | | 
  | |                    [ ]    Empty lost and found on boot                                                        | | 
  | |                    [ ]    Disable yaffs2 block refreshing                                                    | | 
  | |                    [ ]    Disable yaffs2 background processing                                                | | 
  | |                    [*]    Enable yaffs2 xattr support
 
 
第四步:編譯
fs/yaffs2/yaffs_vfs.c:438: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c:439: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c:443: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c:445: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c:478: error: unknown field 'write_super' specified in initializer  (在fs.h中的struct super_operations中添加 void (*write_super) (struct super_block *); )
fs/yaffs2/yaffs_vfs.c:478: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_evict_inode':
fs/yaffs2/yaffs_vfs.c:873: error: implicit declaration of function 'end_writeback'                                          (此函數改為了clear_inode)
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_do_sync_fs':
fs/yaffs2/yaffs_vfs.c:2203: error: 'struct super_block' has no member named 's_dirt'                            (新版中去掉了這個函數,你可以選擇去掉,當然我選著了定義此函數)
fs/yaffs2/yaffs_vfs.c:2214: error: 'struct super_block' has no member named 's_dirt'              在fs.h的struct super_block中添加unsigned char  s_dirt;
fs/yaffs2/yaffs_vfs.c:2216: error: 'struct super_block' has no member named 's_dirt'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_put_super':
fs/yaffs2/yaffs_vfs.c:2506: error: 'struct mtd_info' has no member named 'sync'                      添加下劃線
fs/yaffs2/yaffs_vfs.c:2507: error: 'struct mtd_info' has no member named 'sync'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_touch_super':
fs/yaffs2/yaffs_vfs.c:2523: error: 'struct super_block' has no member named 's_dirt'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_internal_read_super':
fs/yaffs2/yaffs_vfs.c:2699: error: 'struct mtd_info' has no member named 'erase'
fs/yaffs2/yaffs_vfs.c:2700: error: 'struct mtd_info' has no member named 'read'
fs/yaffs2/yaffs_vfs.c:2701: error: 'struct mtd_info' has no member named 'write'
fs/yaffs2/yaffs_vfs.c:2702: error: 'struct mtd_info' has no member named 'read_oob'
fs/yaffs2/yaffs_vfs.c:2703: error: 'struct mtd_info' has no member named 'write_oob'
fs/yaffs2/yaffs_vfs.c:2704: error: 'struct mtd_info' has no member named 'block_isbad'
fs/yaffs2/yaffs_vfs.c:2705: error: 'struct mtd_info' has no member named 'block_markbad'
fs/yaffs2/yaffs_vfs.c:2729: error: 'struct mtd_info' has no member named 'erase'
fs/yaffs2/yaffs_vfs.c:2730: error: 'struct mtd_info' has no member named 'block_isbad'
fs/yaffs2/yaffs_vfs.c:2731: error: 'struct mtd_info' has no member named 'block_markbad'
fs/yaffs2/yaffs_vfs.c:2731: error: 'struct mtd_info' has no member named 'read'
fs/yaffs2/yaffs_vfs.c:2731: error: 'struct mtd_info' has no member named 'write'
fs/yaffs2/yaffs_vfs.c:2733: error: 'struct mtd_info' has no member named 'read_oob'
fs/yaffs2/yaffs_vfs.c:2733: error: 'struct mtd_info' has no member named 'write_oob'
fs/yaffs2/yaffs_vfs.c:2754: error: 'struct mtd_info' has no member named 'erase'
fs/yaffs2/yaffs_vfs.c:2754: error: 'struct mtd_info' has no member named 'read'
fs/yaffs2/yaffs_vfs.c:2754: error: 'struct mtd_info' has no member named 'write'
fs/yaffs2/yaffs_vfs.c:2756: error: 'struct mtd_info' has no member named 'read_oob'
fs/yaffs2/yaffs_vfs.c:2756: error: 'struct mtd_info' has no member named 'write_oob'                  (上面都添加下劃線_)
fs/yaffs2/yaffs_vfs.c:2946: error: implicit declaration of function 'd_alloc_root'                                (此函數改為d_make_root)
fs/yaffs2/yaffs_vfs.c:2946: warning: assignment makes pointer from integer without a cast
fs/yaffs2/yaffs_vfs.c:2955: error: 'struct super_block' has no member named 's_dirt'
make[2]: *** [fs/yaffs2/yaffs_vfs.o] 錯誤 1
make[1]: *** [fs/yaffs2] 錯誤 2
make: *** [fs] 錯誤 2
其他錯一般都是添加下劃線即可!
第五步:燒寫
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
Freeing init memory: 156K

Copyright © Linux教程網 All Rights Reserved