加载内核映象的问题
我编译完成uClinux内核后用skyeye模拟加载映象提示如下,该如何解决Kernel panic: No init found.Try passing init= option to kernel.
加载过程如下
(SkyEye) load
Loading section .init, size 0xa000 vma 0x1000000
Loading section .text, size 0xd48e0 vma 0x100a000
Loading section .data, size 0x9b20 vma 0x10e0000
Start address 0x1000000
Transfer rate: 7610368 bits/sec.
(SkyEye) run
Starting program: /root/uClinux-dist/linux-2.4.x/linux
Linux version 2.4.24-uc0 (root@zjc) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #2 二 1月 4 09:25:36 CST 2005
Processor: Atmel AT91M40xxx revision 0
Architecture: EB01
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 15.82 BogoMIPS
Memory: 4MB = 4MB total
Memory: 2968KB available (850K code, 180K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Atmel USART driver version 0.99
ttyS0 at 0xfffd0000 (irq = 2) is a builtin Atmel APB USART
ttyS1 at 0xfffcc000 (irq = 3) is a builtin Atmel APB USART
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 1400000-1402FFF (RO)
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (romfs filesystem) readonly.
Kernel panic: No init found.Try passing init= option to kernel. (1)先检查所用的skyeye.conf中是否有file=./romfs.img
(2)所用的romfs.img是否是你自己做的
为了找到原因,建议采用如下步骤:
(1)到http://gro.clinux.org/projects/skyeye
下载
skyeye-binary-testutils-1.0.7.tar.bz2
(2)使用自己编译的内核,采用skyeye-binary-testutils-1.0.7/at91下所带的romfs,看看能否成功 是我编译的romfs.img有问题,我按照你的提示自己编译的linux+boot.rom(系统自带)可以.
可是我是按照make menuconfig->GDB:uCLIBC->make dep;make linux->make romfs;make image一步一步来的,错在哪呢 贴一下使用自己做的romfs时,运行
(SkyEye)target sim
的提示信息吧 cd skyeye.conf所在路径
ln -s uClinux-dist所在路径/uClinux-dist/images/romfs.img romfs.img
修改skyeye.conf
mem_bank: map=M, type=RW, addr=0x01400000, size=00400000,file=./romfs.img # skyeye linux-2.4.x/linux
***************************************************************
**** ****
**** SkyEyeSimulator Ver 0.7.7 withGDB 5.3 Interface ****
**** ****
***************************************************************
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.Type "show warranty" for details.
This SkyEye was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
(SkyEye) target sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x813d3fc
SKYEYE: use arm7100 mmu ops
Loaded ROM images/romfs.img
Connected to the simulator.
(SkyEye)
应该没什么问题吧,skyeye.conf内容如下(在uClinux-dist目录下)
cpu: arm7tdmi
mach: at91
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R,addr=0x01400000, size=0x00400000, file=images/romfs.img
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000 请检查romfs.img中是否有init?
步骤如下:
mkdir tmp
mount images/romfs.img tmp -o loop
ls tmp/bin/
看看是否存在init ls tmp/bin/目录是空的,是不是内核编译不成功,解决的方法只有重新编译内核或者换一个uclinux tar包 如果采用的是默认配置选项,编译的出来的romfs.img会含有init,不知道你是否做了修改,
确认在选择文件系统要包含的文件时选择了init选项,我使用的是uClinux-dist-20030522
另外的一个办法就是将所需文件从skyeye-binary-testutils-1.0.7/at91下所带的romfs中
拷贝到你的文件系统镜像文件中。 谢谢你的帮助
页:
[1]