东莞zip code:Kernel panic - not syncing: No init found. Try passing init= option to kernel

来源:百度文库 编辑:偶看新闻 时间:2024/04/29 13:07:17
Kernel panic - not syncing: No init found. Try passing init= option to kernel.2010-11-18 16:04

内核启动信息如下:

#0: S3C24XX_UDA134X (UDA134X)
TCP cubic registered
NET: Registered protocol family 17
s3c2410-rtc s3c2410-rtc: setting system clock to 2008-09-06 14:18:22 UTC (1220710702)
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs: block 635 is marked bad
block 636 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:3.
Freeing init memory: 160K
Warning: unable to open an initial console.
Failed to execute /linuxrc.   Attempting defaults...
Kernel panic - not syncing: No init found.   Try passing init= option to kernel.
Backtrace:
[] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c)
r7:00000000 r6:c04920b0 r5:c0491840 r4:c04581a0
[] (dump_stack+0x0/0x1c) from [] (panic+0x4c/0x134)
[] (panic+0x0/0x134) from [] (init_post+0xec/0x178)
r3:00000000 r2:c387ee00 r1:c04c7000 r0:c03ea91c
[] (init_post+0x0/0x178) from [] (kernel_init+0xf4/0x124)
r5:c0020380 r4:c0020380
[] (kernel_init+0x0/0x124) from [] (do_exit+0x0/0x62c)
r7:00000000 r6:00000000
从上面可以看到内核挂载根文件系统出错,错误原因是找不到根文件系统的文件系统类型。

这是我不懂得根文件系统和root的关系下,犯的错。

因为我用u-boot烧写root时只是用简单的指令nand write 30000000 560000 3a9c000

这样一来只是将root的数据烧进去了而已,我却不知道内核挂载的不是这些数据,而是先有文件系统,然后再把root镜像文件放入kernel的文件系统里面,这样kernel才能找得到root里面的文件。

所以解决方法是带文件系统格式的烧写root 例如:nand write.yaffs 30000000 560000 3a9c000

这里要注意一点,nand write.yaffs 30000000 560000 3a9c000这句话的最后一个参数必须是512+16的整数倍,不然无法烧录。

按照这样的方法烧完后,kenel便成功的启动了。