最开始的想法就是, 先找一个3.0上的mips架构下的config档, 然后对比2.6.29上的config档的差异, 将差异弥补即可.
找了下configs的文件, 选了bcm63xx的defconfig.3.根文件系统, 采用2.6.29中已经编译好的mdev.cpio, porting结束后, 跑vmlinux.bin会发现在加载跟文件系统的时候, 死机在populate_rootfs里面.
[ 4.554000] Unhandled kernel unaligned access[#1]:
[ 4.554000] Cpu 0
[ 4.554000] $ 0 : 00000000 00000000 00010000 81f69f16
[ 4.554000] $ 4 : 00000001 81c18acc 00000002 81f69f2a
[ 4.554000] $ 8 : 00010000 8051991c 00000001 0000000a
[ 4.554000] $12 : 000000cd 00000005 00000000 20b91340
[ 4.554000] $16 : 80540000 80400000 00002850 000007d0
[ 4.554000] $20 : 80540000 80540000 80540000 00000007
[ 4.554000] $24 : 00000000 00000000
[ 4.554000] $28 : 81c16000 81c17e20 00000030 8019d984
[ 4.554000] Hi : 0000bf68
[ 4.554000] Lo : 00000005
[ 4.554000] epc : 801a00dc fget+0x70/0xd8
[ 4.554000] Not tainted
[ 4.554000] ra : 8019d984 sys_fchown+0x24/0x84
[ 4.554000] Status: 11005003 KERNEL EXL IE
[ 4.554000] Cause : 00800010
[ 4.554000] BadVA : 81f69f2a
[ 4.554000] PrId : 00019655 (MIPS 24Kc)
[ 4.554000] Modules linked in:
[ 4.554000] Process swapper (pid: 1, threadinfo=81c16000, task=81c14888, tls=00000000)
[ 4.554000] Stack : 00000030 8010b76c 30303030 80540000 80400000 80540000 80400000 80540000
[ 4.554000] 804a0000 8051dfec 53e3561b 81caf696 803fe0e8 0000013c 00000000 00000000
[ 4.554000] 0000000a 8051d6f8 81cae8f0 000009d8 81caf628 00008000 80540000 8051d46c
[ 4.554000] 80546000 81ca8000 8051d2c4 8052b4d4 00008000 81c89580 00000000 00000000
[ 4.554000] 80546000 81ca8000 8051d2c4 8052b4d4 00008000 8052b788 00000000 8042f860
[ 4.554000] ...
[ 4.554000] Call Trace:
[ 4.554000] [<801a00dc>] fget+0x70/0xd8
[ 4.554000] [<8019d984>] sys_fchown+0x24/0x84
[ 4.554000] [<8051dfec>] do_name+0x148/0x31c
[ 4.554000] [<8051d46c>] flush_buffer+0xcc/0x124
[ 4.554000] [<8052b788>] gunzip+0x2ac/0x390
[ 4.554000] [<8051da30>] unpack_to_rootfs+0x1d8/0x364
[ 4.554000] [<8051e598>] populate_rootfs+0x20/0xb8
[ 4.554000] [<8010e31c>] do_one_initcall+0xfc/0x1d8
[ 4.554000] [<8051c314>] kernel_init+0xa8/0x140
[ 4.554000] [<80114d8c>] kernel_thread_helper+0x10/0x18
[ 4.554000]
[ 4.554000]
[ 4.554000] Code: 00481024 1040000a 00000000 <c0e50000> 14a40005 00000000 00c00821 e0e10000 1020fffa
[ 4.554000] Disabling lock debugging due to kernel taint
[ 4.754000] Unhandled kernel unaligned access[#2]:
[ 4.754000] Cpu 0
[ 4.754000] $ 0 : 00000000 00000000 00000001 81c18af4
[ 4.754000] $ 4 : 81f69f2a 81c18ac4 00000000 00000000
[ 4.754000] $ 8 : 0000000a 00000001 00000001 0000000a
[ 4.754000] $12 : 000000cd 00000005 00000000 21055e80
[ 4.754000] $16 : 00000000 81f69f16 81c18ac4 00000000
[ 4.754000] $20 : 81c18acc 00010000 8051991c 00000007
[ 4.754000] $24 : 00000000 00000000
[ 4.754000] $28 : 81c16000 81c17c58 00000030 8019cdb0
[ 4.754000] Hi : 0000d2f0
[ 4.754000] Lo : 00000005
[ 4.754000] epc : 801a07e4 fput+0x40/0x29c
[ 4.754000] Tainted: G D
[ 4.754000] ra : 8019cdb0 filp_close+0x7c/0x98
[ 4.754000] Status: 11005003 KERNEL EXL IE
[ 4.754000] Cause : 00800010
[ 4.754000] BadVA : 81f69f2a
[ 4.754000] PrId : 00019655 (MIPS 24Kc)
[ 4.754000] Modules linked in:
[ 4.754000] Process swapper (pid: 1, threadinfo=81c16000, task=81c14888, tls=00000000)
[ 4.754000] Stack : 00000000 00000000 3b9aca00 8013400c 81c16000 81c17c90 00000000 81f69f16
[ 4.754000] 81c18ac4 00000000 81c18acc 00010000 8051991c 8019cdb0 00000000 00000000
[ 4.754000] 00000001 00000080 81c18ac4 00000001 00000000 801356c8 0000000a 00000001
[ 4.754000] 0000000b 81c17d70 0000000b 81c17d70 81c14888 00000000 80540000 80540000
[ 4.754000] 00000001 80137340 80540000 80540000 80540000 00000007 00000000 00000000
[ 4.754000] ...
[ 4.754000] Call Trace:
[ 4.754000] [<801a07e4>] fput+0x40/0x29c
[ 4.754000] [<8019cdb0>] filp_close+0x7c/0x98
[ 4.754000] [<801356c8>] put_files_struct+0x134/0x1c4
[ 4.754000] [<80137340>] do_exit+0x23c/0x62c
[ 4.754000] [<80119210>] nmi_exception_handler+0x0/0x34
[ 4.754000]
[ 4.754000]
[ 4.754000] Code: 7c420400 10400008 00000000 <c0830000> 2462ffff e0820000 1040fffc 2462ffff 0806820a
[ 4.928000] Fixing recursive fault but reboot is needed!
特此记录.
最后, 提醒一下, 在3.0.72的kernel中, android\configs目录下有个android-recommended.cfg, 可以再检查下最后生成的.config和它的差异. 看看有木有漏掉重要的cfg.
MIPS 平台 Android 移植过程记录2_kernel升级 (2.6.29.4 -> 3.0.72)
原文:http://blog.csdn.net/jackjones_008/article/details/42029163