Linux內核移植常見錯誤及解決方法

下邊列舉幾類移植中常常遇到到一下額問題,以及問題發生到緣由和解決方法。


一、machine ID問題

machine ID問題跟CPU具體到型號相關,啓動時打印信息以下:linux

 

Uncompressing Linux...........................................................................done,booting the kernel.
Error:unrecoginized/unsupported machine ID(r1 = 0x000003oe)

Available machine support:

ID (hex) NAME
0000016a SMDK2440

please check you kernel config and/or bootloader.app

解決方法:可在U-boot中執行orm

param set mach_type 0x16aci

修改bootloader配置到machine ID或者經過去掉內核代碼中對應到machine ID。io

注:出現這個問題到主要緣由就算bootloader配置到機器ID和內核中配置到不一致,能夠修改bootloader到配置或者在內核配置中添加相應的ID。machine ID在到文件arch/arm/tools/mach_types裏console

 

2.串口無輸出編譯

啓動後打印以下信息:form

Uncompressing Linux...........................................................................done,booting the kernel.
而後就停住,無後續輸出了。
解決辦法:修改linux command line 中的console爲ttySAC0,這是由於2.6內核對串口命名到方式到變更,但不影響應用程序。

3.kernel panic 問題
內核崩潰問題,啓動後打印以下信息:
please append a crrect "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)配置

 

"內核驚慌"除了缺失文件系統外,還有幾個可能到緣由。file

devfs驅動未加載成功,在配置內核選項時選中:

[*] /proc file system support

[*] /dev file system support (OBSOLETE)

[*] Antomatically mount at boot

[*] Debug devfs

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

[ ] Relayfs file system support

devfs負責在/dev目錄下掛在全部設備節點,只有在devfs正確加載後,/dev/mtdblock2纔有效。

或是mtd驅動未加載成功。mtd驅動用來支持對Nand Flash,啓動時若是不能打印正確到分區信息則要從新配置;

0x000000000x00100000:    "bootloader"

0x001000000x00500000:    "kernel"

0x005000000x02d00000:    "filesystem"

 

四、啓動程序U-boot和內核中對於Nand Flash到分區必須一致,不然會提示找不到kernel鏡像文件,能夠在編譯時修改分區信息,也能夠在U-boot中用分區命令part。

相關文章
相關標籤/搜索