内核启动信息如下:
#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:
[<c0035270>] (dump_backtrace+0x0/0x10c) from [<c033a844>] (dump_stack+0x18/0x1c)
r7:00000000 r6:c04920b0 r5:c0491840 r4:c04581a0
[<c033a82c>] (dump_stack+0x0/0x1c) from [<c033a894>] (panic+0x4c/0x134)
[<c033a848>] (panic+0x0/0x134) from [<c00305a4>] (init_post+0xec/0x178)
r3:00000000 r2:c387ee00 r1:c04c7000 r0:c03ea91c
[<c00304b8>] (init_post+0x0/0x178) from [<c00084c4>] (kernel_init+0xf4/0x124)
r5:c0020380 r4:c0020380
[<c00083d0>] (kernel_init+0x0/0x124) from [<c004d1a4>] (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便成功的启动了。