Kernel panic - not syncing: Attempted to kill init!

本文记录了解决使用ELDK4.1编译的内核加载ELDK4.2编译的根文件系统时遇到的Kernel Panic问题的过程。通过调整内核编译配置中的EABI选项,成功实现了不同版本内核与根文件系统的兼容。
问题:

使用ELDK4.1版本编译的内核加载ELDK4.2编译的根文件系统root422以NFS方式启动遇到错误信息:

IP-Config: Complete:
     device=eth0, addr=192.168.1.244, mask=255.255.255.0, gw=255.255.255.255,
     host=192.168.1.244, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=192.168.1.200, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.200
eth0: link up (10/Half)
eth0: link down
eth0: link up (10/Half)
Looking up port of RPC 100005/1 on 192.168.1.200
VFS: Mounted root (nfs filesystem) on device 0:12.
Freeing init memory: 124K
Kernel panic - not syncing: Attempted to kill init!

解决:

而这个问题在用ELDK4.1作为交叉编译工具链编译得到根文件系统root400时没有出现,

从网上查到这篇文章http://blog.chinaunix.net/uid-12461657-id-2975953.html

说这是内核编译时EABI的选项没有选中所导致的。


想起来,用ELDK4.1编译时,当将内核中的EABI选项选中,编译时会提示错误;

查了下ELDK4.1和ELDK4.2的区别,从ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/eldk/4.2/arm-linux-x86/distribution/README.html

中知道从ELDK4.2版本起开始支持EABI。

所以,ELDK4.1编译内核选中EABI时,自然会出现编译错误。


在menuconfig中选中EABI选项:

Kernel Features  --->
            [*] Use the ARM EABI to compile the kernel                  
            [*]   Allow old ABI binaries to run with this kernel (EXPERIMENTA)

使用ELDK4.2版本重新编译,将编译完的uImage烧写到NAND Flash中,重启目标板,能够进入shell界面了。


补充:

在U-Boot命令行模式,将根文件系统换成使用ELDK4.1版本编译生成的root400,照样可以通过NFS成功加载根文件系统,正常进入shell界面。

这应该是内核编译选项Allow old ABI binaries to run with this kernel (EXPERIMENTA)的作用。


为了验证是否确实是内核编译选项Allow old ABI binaries to run with this kernel (EXPERIMENTA)的作用,重新运行make menuconfig,将EABI的选项更改为:

Kernel Features  --->
            [*] Use the ARM EABI to compile the kernel                  
            [ ]   Allow old ABI binaries to run with this kernel (EXPERIMENTA)

编译,将编译完的uImage烧写到Flash中,重启目标板,发现内核在成功挂载根文件系统并释放初始化内存后,始终不能进入shell界面,虽然,console口还能响应键盘输入的回车键。

Looking up port of RPC 100005/1 on 192.168.1.200
VFS: Mounted root (nfs filesystem) on device 0:12.
Freeing init memory: 120K

停在此处始终不能进入shell界面。

也就是,不兼容OABI(Old Application Binary Interface)所造成的后果。


所以,安全期间,不管是多少版本的内核,为了兼容旧的版本的编译器编译出的根文件系统,一定要将
            [*] Use the ARM EABI to compile the kernel                  
            [*]   Allow old ABI binaries to run with this kernel (EXPERIMENTA)

同时选中。


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值