主题 : Kernel panic! 复制链接 | 浏览器收藏 | 打印
看看嵌得进去不?
级别: 新手上路
UID: 24678
精华: 0
发帖: 15
金钱: 75 两
威望: 15 点
综合积分: 30 分
注册时间: 2010-07-12
最后登录: 2012-04-12
楼主  发表于: 2010-08-05 11:54

 Kernel panic!

...
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 96K
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
详见附件new: new.zip (4 K) 下载次数:6 )。



    check 根文件系统是否正确(提示说无法打开console,你根文件系统dev目录下有无此设备文件?)。
    check /linuxrc这个文件是否存在。
    check /linuxrc这个文件是否正确(应该是链接到/bin/busybox的吧?)
    check /linuxrc读写权限(包括其链接目标的读写权限)

我全部检查过了。
/linuxrc 存在。
lrwxrwxrwx 1 root root   11 2010-07-26 17:48 linuxrc -> bin/busybox
如上所示,它是链接到bin/busybox的。
-rwxrwxrwt 1 root root 1870460 2010-07-26 17:48 busybox
busybox本身也存在, 这两点都是自动完成的(我的意思是说make install自动生成的)。

console 文件及null文件都存在
crwxrwxrwt 1 root root 5, 1 2010-07-26 16:39 console
crwxrwxrwt 1 root root 1, 3 2010-07-26 16:39 null
我把整个目录都chmod -R 1777 * 了。


开发板信息

    开发板:友善之臂(FriendlyARM) QQ2440v3 (s3c2440, K9F1208U0B)
    bootloader: vivi 0.1.4 (用arm-linux-gcc 2.95.3编译)
    kernel: 2.6.25.6 (用arm-linux-gcc 4.3.2编译)
    根文件系统格式yaffs2(用友善之臂的mkyaffs2image制作).

    nand启动, nand 分区(64M)
    vivi            :       0x00000000      0x00040000      0
    param           :       0x00040000      0x00010000      0
    kernel          :       0x00050000      0x00200000      0
    root            :       0x00250000      0x03dac000      0

    vivi 启动参数
    mach_type               :       0000016a                  362 (vivi中写死,与内核mach_types中定义一至)
    media_type              :       00000003                    3
    boot_mem_base           :       30000000            805306368
    boot_delay              :       01000000             16777216
    Linux command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0 mem=64M


文件系统信息
文件列表 见附件files: files.zip (3 K) 下载次数:2
/etc/fstab 附件fstab: fstab.zip (1 K) 下载次数:1
/etc/inittab 见附件inittab: inittab.zip (1 K) 下载次数:2
/etc/init.d/rcS 见附件rcS rcS.zip (1 K) 下载次数:1

源代码修改
vivi的修改附件vivi-0.1.4.diff: vivi-0.1.4.diff.zip (2 K) 下载次数:0 , 我没有找到官方原版,针对的是网上能找到的最普遍的一个版本
kernel的修改见附件linux-2.6.25.6_arch_arm.diff: linux-2.6.25.6_arch_arm.diff.zip (1 K) 下载次数:0 , 针对这:http://qq2440-linux.googlecode.com/files/linux-2.6.25.6-20081004.diff.gz patch 了后的源代码的修改,只记得改了arm目录
files2: files2.zip (2 K) 下载次数:0 为在dev下添加了mtdblock[0-3]设备节点
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-08-05 12:16
看起来文件系统已经挂载成功了,否则你会看到“Warning: unable to open an initial console.”
问题似乎出在文件系统的可执行档或者共享库上,看看这个帖子里的分析方法?
http://www.aiothome.net/read.php?tid-6643.html
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
看看嵌得进去不?
级别: 新手上路
UID: 24678
精华: 0
发帖: 15
金钱: 75 两
威望: 15 点
综合积分: 30 分
注册时间: 2010-07-12
最后登录: 2012-04-12
2楼  发表于: 2010-08-05 12:35

 回 1楼(kasim) 的帖子

测试中。
看看嵌得进去不?
级别: 新手上路
UID: 24678
精华: 0
发帖: 15
金钱: 75 两
威望: 15 点
综合积分: 30 分
注册时间: 2010-07-12
最后登录: 2012-04-12
3楼  发表于: 2010-08-05 13:19

 Re:回 1楼(kasim) 的帖子

参考这http://www.aiothome.net/read.php?tid-6643.html 采用静态编译(不小得用对参数没)
hello.c内容如下
复制代码
  1. #include <stdio.h>
  2. int main(void) {
  3.     printf("hello, FriendlyARM!\n");
  4.     sleep(9999);
  5. }

编译命令及参数:
复制代码
  1. arm-linux-gcc -static -static-libgcc -o hello hello.c

编完后文件有500+K
然后把hello复制为sbin/init
重新制作根文件系统镜像用WINDOWS下的DNW烧写。
再次启动,保存打印信息到文件,,经windows的FC比较和之前一样
复制代码
  1. Comparing files new and HELLO
  2. FC: no differences encountered

请问下一步我要做啥?
[ 此帖被qinghao在2010-08-05 13:32重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2010-08-05 15:46
然后把hello复制为sbin/init

你原来的内核命令行上指定init=/linuxrc, 一个指向/bin/busybox的链接, 现在替换了/sbin/init, 这样和原先有什么区别?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
看看嵌得进去不?
级别: 新手上路
UID: 24678
精华: 0
发帖: 15
金钱: 75 两
威望: 15 点
综合积分: 30 分
注册时间: 2010-07-12
最后登录: 2012-04-12
5楼  发表于: 2010-08-05 16:53

 回 4楼(kasim) 的帖子

不好意思,刚刚看书去了。。才看到你的回复。。。

经过修改用hello复制为/linuxrc

这次kernel panic消息不打印了,在Freeing init memory: 96K后就卡住 !
[ 此帖被qinghao在2010-08-05 17:44重新编辑 ]
看看嵌得进去不?
级别: 新手上路
UID: 24678
精华: 0
发帖: 15
金钱: 75 两
威望: 15 点
综合积分: 30 分
注册时间: 2010-07-12
最后登录: 2012-04-12
6楼  发表于: 2010-08-10 18:42
读内核代码找原恩中。。。