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。

相关文章
相关标签/搜索