用户第一个进程运行失败崩溃?求救

leiyun121 2010-10-19 10:16:50
我在mips上移植2.6.30的内核,在启动的最后崩溃,不知道问题出在哪里,请帮我帮我分析一下:
Warning: unable to open an initial console.
will run_init_process(/sbin/init)... //这一句我自己在内核添加的(说明执行busybox时失败,但busybox肯定是好的)
Reserved instruction in kernel code[#1]:
Cpu 0
$ 0 : 00000000 00010000 00000001 20000000
$ 4 : 83818000 00010000 7fcb79c0 10006750
$ 8 : 3000fc01 ffffffff 0000002e 00000000
$12 : 00000000 44161a23 83819b98 00000000
$16 : 00000002 7fcb79b4 83819f30 00000002
$20 : 7fcb79b4 1000c360 00000000 00514840
$24 : 00000010 005a5c40
$28 : 83818000 83819f08 00514918 8011467c
Hi : 00000000
Lo : 00000000
epc : 8010224c _init_fpu+0x2c/0x80
Not tainted
ra : 8011467c do_cpu+0x308/0x3b4
Status: 3000fc03 KERNEL EXL IE
Cause : 10000028
PrId : 00004200 (Godson1)
Modules linked in:
Process init (pid: 1, threadinfo=83818000, task=83817b38, tls=00000000)
Stack : 00000002 7fcb79b4 7fcb79c0 00000002 00000002 7fcb79b4 7fcb79c0 00000002
7fcb79b4 801005c0 00000000 00000000 00000000 00000000 00000000 00000000
00000000 1000fc00 fe3c0000 00000000 00000000 7fcb79b4 7fcb79c0 10006750
02061e02 00000004 0000002e 00000000 00000000 44161a23 83819b98 00000000
00000002 7fcb79b4 7fcb79c0 00000002 7fcb79b4 1000c360 00000000 00514840
...
Call Trace:
[<8010224c>] _init_fpu+0x2c/0x80
[<8011467c>] do_cpu+0x308/0x3b4
[<801005c0>] ret_from_exception+0x0/0x24


Code: 24090000 44c9f800 2409ffff <44a90000> 44a91000 44a92000 44a93000 44a94000 44a95000
Disabling lock debugging due to kernel taint
Kernel panic - not syncing: Attempted to kill init!
...全文
1034 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
火箭猫 2011-03-02
  • 打赏
  • 举报
回复
[<8010224c>] _init_fpu+0x2c/0x80
[<8011467c>] do_cpu+0x308/0x3b4
[<801005c0>] ret_from_exception+0x0/0x24

deep_pro 2010-10-20
  • 打赏
  • 举报
回复
这个我就不清楚了
试试copy yaffs镜像吧
leiyun121 2010-10-20
  • 打赏
  • 举报
回复
恩,是用可以用的内核,用U盘启动内核,并用U盘加载文件系统,启动后在U盘文件系统中格式化nandflash,然后再挂载分区,copy根文件系统(目录,不是镜像)到nand文件系统分区中
deep_pro 2010-10-20
  • 打赏
  • 举报
回复
我是先把nandflash用mkyaffs格式化后,在把根文件系统目录复制进去的,没有制作yaffs镜像文件。
------------------
那就是说你已经有一个其他的能用的根文件系统了,在那里面执行的mkyaffs格式化?
leiyun121 2010-10-20
  • 打赏
  • 举报
回复
嘿嘿,不小气,和前面比就那些不一样。我是先把nandflash用mkyaffs格式化后,在把根文件系统目录复制进去的,没有制作yaffs镜像文件。下面是完整的信息:
Boot Args: 8, 0xa3f7fd80, 0xa3f7fda4
prom_init_cmdline: /dev/fs/ext2 root=/dev/mtdblock2 init=/linuxrc console=ttyS0,115200 rootfstype=yaffs rw console=ttyS0,115200
memsize: 64M
calculating r4koff... cpupll 192 192000000
000ea600(960000)
CPU frequency 192.00 MHz
Linux version 2.6.30.2-erasoc (root@leiyun.localdomain) (gcc version 3.4.6) #218 Wed Oct 20 14:39:03 CST 2010
CPU revision is: 00004200 (Godson1)
FPU revision is: 00000501
(PRId 00004200) @ 192MHZ
Determined physical RAM map:
memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: /dev/fs/ext2 root=/dev/mtdblock2 init=/linuxrc console=ttyS0,115200 rootfstype=yaffs rw console=ttyS0,115200
Primary instruction cache 8kB, VIPT, 2-way, linesize 32 bytes.
Primary data cache 8kB, 2-way, VIPT, no aliases, linesize 32 bytes
will early_irq_init()<6>NR_IRQS:128
will init_IRQ()ly arch_init_irq() start
ly arch_init_irq() end
end init_IRQ()PID hash table entries: 256 (order: 8, 1024 bytes)
plat_timer_setup()
calculating r4koff... 000ea600(960000)
CPU frequency 192.00 MHz
Console: colour dummy device 80x25
console [ttyS0] enabled
ly lockdep_info() start!
ly lockdep_info() end!
ly locking_selftest() end!
ly locking_selftext() end!
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 59968k/65536k available (2782k kernel code, 5500k reserved, 851k data, 164k init, 0k highmem)
ly mem_init() end!
ly enable_debug_pagealloc() end!
ly cpu_hotplug_init() end!
ly kmem_cache_init() end!
ly kmemtrace_init() end!
ly debug_objects_mem_init() end!
ly idr_init_cache() end!
ly setup_per_cpu_pageset() end!
ly numa_policy_init() end!
Calibrating delay loop... <6>hello leiyun ... lpj=1048576
127.79 BogoMIPS (lpj=638976)
ly calibrate_delay() end!
ly pidmap_init() end!
ly pgtable_cache_init() end!
ly prio_tree_init() end!
ly anon_vma_init() end!
ly thread_info_cache_init() end!
ly cred_init() end!
ly fork_init() end!
ly proc_caches_init() end!
ly buffer_init() end!
ly key_init() end!
ly security_init() end!
Mount-cache hash table entries: 512
ly vfs_caches_init() end!
ly radix_tree_init() end!
ly signals_init() end!
ly page_writeback_init() end!
ly cgroup_init() end!
ly cpuset_init() end!
ly taskstats_init_early() end!
ly delayacct_init() end!
ly check_bugs() end!
ly acpi_early_init() end!
ly ftrace_init() end!
kernel_thread(kernel_init)...start
kernel_thread(kernel_init)...end
numa_default_policy()...
kernel_thread(kthreadd)...
find_task_by_pid_ns...
find_task_by_pid_ns...
init_idle_bootup_task...
rcu_scheduler_starting...
preempt_enable_no_resched
net_namespace: 668 bytes
NET: Registered protocol family 16
registering PCI controller with io_map_base unset
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
hub_events...1
hub_events...2
usbcore: registered new device driver usb
pci 0000:00:0f.0: PME# supported from D1 D2 D3hot
pci 0000:00:0f.0: PME# disabled
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
yaffs Oct 19 2010 01:50:55 Installing.
msgmni has been set to 117
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
ttyS0: detected caps 00001100 should be 00000100
serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
ttyS1: detected caps 00001100 should be 00000100
serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
brd: module loaded
usbcore: registered new interface driver ub
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
Driver 'sd' needs updating - please use bus_type methods
e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
8139too Fast Ethernet driver 0.9.28
eth0: RealTek RTL8139 at 0xb4000000, 00:40:f4:1f:41:02, IRQ 51
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
nand_scan_tail()...2
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000100000 : "loader"
0x000000100000-0x000000600000 : "kernel"
0x000000600000-0x000004000000 : "file system"
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing unused kernel memory: 164k freed
free_initmem()...end
unlock_kernel()...end
mark_rodata()...end
default_policy()...end
will sys_open console...
open console...end
sys_dup(0)...1
sys_dup(0)...2
will ramdisk_execute_command()...
will execute_command()...
will run_init_process(execute_command)...
save exit: isCheckpointed 0 //文件系统退出
schedule...
preempt_disable...//再没任何反应
deep_pro 2010-10-19
  • 打赏
  • 举报
回复
你又不沾全,真小气

还有,你的yaffs镜像从哪来的?
leiyun121 2010-10-19
  • 打赏
  • 举报
回复
多谢大虾,原因找到了,确实是fpu的问题,在arch/mips/kernel/r4k_switch.S或r4k_fpu.S中有如下定义:
#ifdef CONFIG_CPU_MIPS32
mtc1 t1, $f0
mtc1 t1, $f1
mtc1 t1, $f2
mtc1 t1, $f3
mtc1 t1, $f4
mtc1 t1, $f5
mtc1 t1, $f6
mtc1 t1, $f7
mtc1 t1, $f8
mtc1 t1, $f9
mtc1 t1, $f10
mtc1 t1, $f11
mtc1 t1, $f12
mtc1 t1, $f13
mtc1 t1, $f14
mtc1 t1, $f15
mtc1 t1, $f16
mtc1 t1, $f17
mtc1 t1, $f18
mtc1 t1, $f19
mtc1 t1, $f20
mtc1 t1, $f21
mtc1 t1, $f22
mtc1 t1, $f23
mtc1 t1, $f24
mtc1 t1, $f25
mtc1 t1, $f26
mtc1 t1, $f27
mtc1 t1, $f28
mtc1 t1, $f29
mtc1 t1, $f30
mtc1 t1, $f31

CONFIG_CPU_MIPS32这个配置我没加上去。
但是又有新的问题:在执行init进程时,yaffs文件系统自动退出!
信息如下:
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing unused kernel memory: 164k freed
free_initmem()...end
unlock_kernel()...end
mark_rodata()...end
default_policy()...end
will sys_open console...
open console...end
sys_dup(0)...1
sys_dup(0)...2
will ramdisk_execute_command()...
will execute_command()...
will run_init_process(execute_command)...
save exit: isCheckpointed 0 //yaffs文件系统umount
schedule...
preempt_disable...


打yaffs文件系统补丁的时候,文件系统版本不行。。。还是?
deep_pro 2010-10-19
  • 打赏
  • 举报
回复
就是不知道lz到底有没有一个曾经能正常运行的根文件系统,现在你这个yaffs镜像使用的根文件系统从哪来的
deep_pro 2010-10-19
  • 打赏
  • 举报
回复
此外我看到 内核调用栈在调用_init_fpu 挂掉
所以,留意你的根文件系统和工具链 与fpu相关的特性
deep_pro 2010-10-19
  • 打赏
  • 举报
回复
Freeing unused kernel memory: 164k freed
之后那么多调试信息不会都是lz加的吧

其实没有必要,到了这一步,几乎不可能是内核的问题了,只能是你根文件系统镜像和内核启动参数的问题
Kernel command line: /dev/fs/ext2 root=/dev/mtdblock2 console=ttyS0,115200
显然不完整,/dev/fs/ext2多余
建议改为
root=/dev/mtdblock2 console=ttyS0,115200 rootfstype=yaffs rw console=ttyS0,115200 init=/linuxrc

要再不行,自己检查你的yaffs 镜像,或者先用别的根文件系统如nfs把根文件系统调通了再制作yaffs 镜像
leiyun121 2010-10-19
  • 打赏
  • 举报
回复
console已经打开成功了,是驱动的问题,已经解决。但运行初始化进程还是崩溃,下面是完成的启动信息:
Boot Args: 3, 0xa3f7fd90, 0xa3f7fda0
prom_init_cmdline: /dev/fs/ext2 root=/dev/mtdblock2
memsize: 64M
calculating r4koff... cpupll 192 192000000
000ea600(960000)
CPU frequency 192.00 MHz
Linux version 2.6.30.2-erasoc (root@leiyun.localdomain) (gcc version 3.4.6) #209 Mon Oct 18 23:46:11 CST 2010
CPU revision is: 00004200 (Godson1)
FPU revision is: 00000501
(PRId 00004200) @ 192MHZ
Determined physical RAM map:
memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: /dev/fs/ext2 root=/dev/mtdblock2 console=ttyS0,115200
Primary instruction cache 8kB, VIPT, 2-way, linesize 32 bytes.
Primary data cache 8kB, 2-way, VIPT, no aliases, linesize 32 bytes
will early_irq_init()<6>NR_IRQS:128
will init_IRQ()ly arch_init_irq() start
ly arch_init_irq() end
end init_IRQ()PID hash table entries: 256 (order: 8, 1024 bytes)
plat_timer_setup()
calculating r4koff... 000ea600(960000)
CPU frequency 192.00 MHz
Console: colour dummy device 80x25
console [ttyS0] enabled
ly lockdep_info() start!
ly lockdep_info() end!
ly locking_selftest() end!
ly locking_selftext() end!
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 59956k/65536k available (2785k kernel code, 5508k reserved, 856k data, 164k init, 0k highmem)
ly mem_init() end!
ly enable_debug_pagealloc() end!
ly cpu_hotplug_init() end!
ly kmem_cache_init() end!
ly kmemtrace_init() end!
ly debug_objects_mem_init() end!
ly idr_init_cache() end!
ly setup_per_cpu_pageset() end!
ly numa_policy_init() end!
Calibrating delay loop... <6>hello leiyun ... lpj=1048576
127.79 BogoMIPS (lpj=638976)
ly calibrate_delay() end!
ly pidmap_init() end!
ly pgtable_cache_init() end!
ly prio_tree_init() end!
ly anon_vma_init() end!
ly thread_info_cache_init() end!
ly cred_init() end!
ly fork_init() end!
ly proc_caches_init() end!
ly buffer_init() end!
ly key_init() end!
ly security_init() end!
Mount-cache hash table entries: 512
ly vfs_caches_init() end!
ly radix_tree_init() end!
ly signals_init() end!
ly page_writeback_init() end!
ly cgroup_init() end!
ly cpuset_init() end!
ly taskstats_init_early() end!
ly delayacct_init() end!
ly check_bugs() end!
ly acpi_early_init() end!
ly ftrace_init() end!
kernel_thread(kernel_init)...start
kernel_thread(kernel_init)...end
numa_default_policy()...
kernel_thread(kthreadd)...
find_task_by_pid_ns...
find_task_by_pid_ns...
init_idle_bootup_task...
rcu_scheduler_starting...
preempt_enable_no_resched
net_namespace: 668 bytes
NET: Registered protocol family 16
registering PCI controller with io_map_base unset
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pci 0000:00:0f.0: PME# supported from D1 D2 D3hot
pci 0000:00:0f.0: PME# disabled
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
yaffs Oct 14 2010 23:19:41 Installing.
msgmni has been set to 117
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Success adding erasoc_ts_cdev!
From Erasoc touch screen driver GPIO_Ads7843_INIT
Erasoc touch screen be initiated by GPIO model!

From Erasoc Touch Screen ------> IRQ: 50 is OK!
erasoc-ts touch screen driver initialized successfully!
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
ttyS0: detected caps 00001100 should be 00000100
serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
ttyS1: detected caps 00001100 should be 00000100
serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
brd: module loaded
usbcore: registered new interface driver ub
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
Driver 'sd' needs updating - please use bus_type methods
e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
8139too Fast Ethernet driver 0.9.28
eth0: RealTek RTL8139 at 0xb4000000, 00:40:f4:1f:41:02, IRQ 51
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
nand_scan_tail()...2
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000100000 : "loader"
0x000000100000-0x000000600000 : "kernel"
0x000000600000-0x000004000000 : "file system"
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 164k freed
free_initmem()...end
unlock_kernel()...end
mark_rodata()...end
default_policy()...end
will sys_open console...
open console...end
sys_dup(0)...1
sys_dup(0)...2
will ramdisk_execute_command()...
will execute_command()...
will run_init_process(/sbin/init)...
Reserved instruction in kernel code[#1]:
Cpu 0
$ 0 : 00000000 00010000 00000001 20000000
$ 4 : 83818000 00010000 7fc5ed80 10006750
$ 8 : 3000fc01 ffffffff 0000002e 00000000
$12 : 00000000 e294c307 83819b98 00000000
$16 : 00000002 7fc5ed74 83819f30 00000002
$20 : 7fc5ed74 1000c360 00000000 00514840
$24 : 00000010 005a5c40
$28 : 83818000 83819f08 00514918 8011465c
Hi : 00000000
Lo : 00000000
epc : 8010224c _init_fpu+0x2c/0x80
Not tainted
ra : 8011465c do_cpu+0x308/0x3b4
Status: 3000fc03 KERNEL EXL IE
Cause : 10000028
PrId : 00004200 (Godson1)
Modules linked in:
Process init (pid: 1, threadinfo=83818000, task=83817b38, tls=00000000)
Stack : 00000002 7fc5ed74 7fc5ed80 00000002 00000002 7fc5ed74 7fc5ed80 00000002
7fc5ed74 801005c0 00000000 00000000 00000000 00000000 00000000 00000000
00000000 1000fc00 fe3c0000 00000000 00000000 7fc5ed74 7fc5ed80 10006750
02061e02 00000004 0000002e 00000000 00000000 e294c307 83819b98 00000000
00000002 7fc5ed74 7fc5ed80 00000002 7fc5ed74 1000c360 00000000 00514840
...
Call Trace:
[<8010224c>] _init_fpu+0x2c/0x80
[<8011465c>] do_cpu+0x308/0x3b4
[<801005c0>] ret_from_exception+0x0/0x24


Code: 24090000 44c9f800 2409ffff <44a90000> 44a91000 44a92000 44a93000 44a94000 44a95000
Disabling lock debugging due to kernel taint
Kernel panic - not syncing: Attempted to kill init!

我在内核中加了一些调试打印信息,还没去掉。。。

deep_pro 2010-10-19
  • 打赏
  • 举报
回复
干嘛这么小气 把全部的启动信息都沾过来
dfysy 2010-10-19
  • 打赏
  • 举报
回复
"Warning: unable to open an initial console." 需要在/dev/下面创建console设备

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧