问题求教:内核启动时卡在Freeing init memory:

aliershian 2010-02-22 12:16:29
处理器s3c2410
加载了UBOOT 1.1.6,内核是2.6.22
启动信息如下:
Starting kernel ...
Uncompressing Linux............................................................................... done, booting the kernel.
Linux version 2.6.22.6 (alier@alier-laptop) (gcc version 3.4.5) #18 Mon Feb 22 10:30:40 CST 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177
Machine: SMDK2410
noinitrd console=ttySAC0 root=/dev/mtdblock2 rootfstype=yaffs init=/bin/shMemory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists. Total pages: 16256
Kernel command line: noinitrd console=ttySAC0 root=/dev/mtdblock2 rootfstype=yaffs init=/bin/sh
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 62336KB available (2200K code, 265K data, 108K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2410: Initialising architecture
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
yaffs Feb 22 2010 10:27:57 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
BAST NOR-Flash Driver, (c) 2004 Simtec Electronics
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand s3c2410-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
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 !!
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00200000 : "Kernel"
0x00200000-0x00a00000 : "JFFS-2"
0x00a00000-0x04000000 : "YAFFS"
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-i2c s3c2410-i2c: slave address 0x10
s3c2410-i2c s3c2410-i2c: bus frequency set to 390 KHz
s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 108K
open console......
open console done.
Execute_command:/bin/sh
Run before execute

/bin/sh是网上有人建议的,也卡住了
而正常的init=/linuxrc时也是卡在这里。
网上说要打开NWFPE math emulation等选项,我一一打开了,但仍然是卡在这里,
Run before execute是我自己加的调试信息,在执行execute_command之前,可见就是在执行linuxrc的时候卡住了。

求解……
...全文
1810 26 打赏 收藏 转发到动态 举报
写回复
用AI写文章
26 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tinghua_M 2011-11-15
  • 打赏
  • 举报
回复
文件系统是不是有问题啊
aliershian 2010-02-26
  • 打赏
  • 举报
回复
引用 21 楼 armed 的回复:
检查一下内核有没有开启浮点模拟,估计你的文件系统是需要浮点的,摘出其中的一个动态库,比如/lib/libc-2.8.so,然后在PC机上这样检查:

arm-linux-readelf -h libc-2.8.so

在输出的Flags中如果没有Software FP,就可以证实了。

输出的FLAGS里有这一项。而且之前我也打开了内核的浮点支持。
aliershian 2010-02-26
  • 打赏
  • 举报
回复
引用 21 楼 armed 的回复:
检查一下内核有没有开启浮点模拟,估计你的文件系统是需要浮点的,摘出其中的一个动态库,比如/lib/libc-2.8.so,然后在PC机上这样检查:

arm-linux-readelf -h libc-2.8.so

在输出的Flags中如果没有Software FP,就可以证实了。

浮点支持我打开了……
armed 2010-02-26
  • 打赏
  • 举报
回复
检查一下内核有没有开启浮点模拟,估计你的文件系统是需要浮点的,摘出其中的一个动态库,比如/lib/libc-2.8.so,然后在PC机上这样检查:

arm-linux-readelf -h libc-2.8.so

在输出的Flags中如果没有Software FP,就可以证实了。
aliershian 2010-02-26
  • 打赏
  • 举报
回复
引用 24 楼 armed 的回复:
内核提供了两种浮点模拟,一种是FPE,一种是VFP,和你的根文件系统不匹配也是不行的。

那该如何选择呢?
我都选上了……
armed 2010-02-26
  • 打赏
  • 举报
回复
内核提供了两种浮点模拟,一种是FPE,一种是VFP,和你的根文件系统不匹配也是不行的。
aliershian 2010-02-25
  • 打赏
  • 举报
回复
文件系统是用busybox做的。
aliershian 2010-02-25
  • 打赏
  • 举报
回复
这个这个……还有朋友能来说一说看法么?
我简单的把问题和前面的都总结一下,
文件系统是YAFFS
内核启动的时候卡在了Freeing init memory:103K这一句上
printk标出了是执行execute_command这一句,也就是执行/linuxrc的时候卡住了
在rcS中加ECHO发现rcS并没有被执行,console也没有问题,
而将文件系统改为JFFS2,烧入第二分区(mtdblock 1)的时候能够正常运行并进入SHELL
因此问题可能出在YAFFS文件系统上,请各位再发表发表意见,
因为27号回学校,我26号结贴,
谢谢各位了!!
KimenWu 2010-02-24
  • 打赏
  • 举报
回复
可能不是卡住了,是串口没有输出了。机器应该正常启动完毕
aliershian 2010-02-24
  • 打赏
  • 举报
回复
引用 12 楼 duiguang 的回复:
恩....flash有坏块很正常吧.但是我不理解nand_update_bbt: Out of memory
**>> Block 1634 retired 是什么原因.Google了挺多也没找到答案.
我今天在开发板提供的最原始的文件系统上添加我的应用程序,大小比原先少了10M左右吧,居然神奇的能够重启了....不知道和这文件系统的大小有没有关系....
我现在还在测试..

呵呵...突然发现...在百问网那边的帖子也是楼主你的~那边的帖子都没人回答哦~

确实可能是因为太大了,10MB……
之前我在查别的问题的时候好像也见过,并且它也不是提示Out of memory了么。
不过有坏块是个大问题,我记得UBOOT烧写的时候是能够认出坏块并屏蔽的……
aliershian 2010-02-24
  • 打赏
  • 举报
回复
引用 12 楼 duiguang 的回复:
恩....flash有坏块很正常吧.但是我不理解nand_update_bbt: Out of memory
**>> Block 1634 retired 是什么原因.Google了挺多也没找到答案.
我今天在开发板提供的最原始的文件系统上添加我的应用程序,大小比原先少了10M左右吧,居然神奇的能够重启了....不知道和这文件系统的大小有没有关系....
我现在还在测试..

呵呵...突然发现...在百问网那边的帖子也是楼主你的~那边的帖子都没人回答哦~


是啊是啊,毕竟我是跟着韦东山那本书学的,有了问题自然想到了他书中说的那个讨论论坛,不过确实没人回答诶。
aliershian 2010-02-24
  • 打赏
  • 举报
回复
启动脚本只有简单的
mount -a 这么一句
我在启动脚本前加入了一句echo "Into rcS"
结果发现没能显示,可见启动脚本没有被执行。
波特率的问题,改了,依然无效。
我将文件系统烧成了JFFS2拷进去后发现能用,可以进到CONSOLE,但有个问题是它似乎没有登录上去,只显示了一个#作为提示符,但一些命令,比如mount、ls什么的都是可用的,是我哪些步骤没做么?
天亮后说晚安 2010-02-24
  • 打赏
  • 举报
回复
引用 4 楼 lsshao 的回复:
从调试语句上看,内核已经正确完成,开始运行启动脚本。
如果启动脚本出错信息没有重新定向,应该直接输出到标准输出上;只要没有重定向到/dev/null,日志可以体现。
如果不是每一次都会出现上述问题,硬件问题的可能性比较大。

启动脚本贴出来看看
duiguang 2010-02-24
  • 打赏
  • 举报
回复
恩....flash有坏块很正常吧.但是我不理解nand_update_bbt: Out of memory
**>> Block 1634 retired 是什么原因.Google了挺多也没找到答案.
我今天在开发板提供的最原始的文件系统上添加我的应用程序,大小比原先少了10M左右吧,居然神奇的能够重启了....不知道和这文件系统的大小有没有关系....
我现在还在测试..

呵呵...突然发现...在百问网那边的帖子也是楼主你的~那边的帖子都没人回答哦~
aliershian 2010-02-24
  • 打赏
  • 举报
回复
引用 17 楼 lihualoveyou 的回复:
可能不是卡住了,是串口没有输出了。机器应该正常启动完毕

我觉得不像是串口问题……因为如果串口有问题的话,之前在sys_open的时候就应该有警告了。
试了试将文件系统用jffs2格式重做了,结果发现能用,启动起来了
aliershian 2010-02-23
  • 打赏
  • 举报
回复
block 3590 is bad
block 3655 is bad
block 3858 is bad

这是有坏块啊~
duiguang 2010-02-23
  • 打赏
  • 举报
回复
不知道楼主的问题解决了没有.
我也遇到了与楼主一样的问题,但是我是第2次启动的时候发生的.
第一次用nfs进入系统,挂载nand flash,把文件系统解压到nand flash上,然后从nand flash启动.能正常进入系统.
之后按下重启或者断电重上就卡在Freeing init memory: 164K了
部分调试信息为:

Switched to high resolution mode on CPU 0
IP-Config: Complete:
device=eth0, addr=192.168.1.2, mask=255.255.255.0, gw=192.168.1.1,
host=192, domain=, nis-domain=168.1.2,
bootserver=192.168.1.39, rootserver=192.168.1.39, rootpath=
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
block 3590 is bad
block 3655 is bad
block 3858 is bad
nand_update_bbt: Out of memory
**>> Block 1634 retired
VFS: Mounted root (yaffs2 filesystem).
Freeing init memory: 164K

请教各位大侠啦~

内核的代码我还没研究过,感到奇怪的是,第一次能正常启动,而第二次就卡在这了~
Wenxy1 2010-02-22
  • 打赏
  • 举报
回复
可能是你的rcS脚本有问题,检查它。
deep_pro 2010-02-22
  • 打赏
  • 举报
回复
你现在连console都没有得到
怎么可能看日志
aliershian 2010-02-22
  • 打赏
  • 举报
回复
引用 7 楼 steptodream 的回复:
日志一般都在/var/log下
你这种情况应该着重看/var/log/messages  /var/log/boot.log /var/log/dmesg 等


……这个是让我难办的事情了……我做移植的机器网卡坏了,一直都是在用串口干活,看不到文件系统里面……或者说,我不会用串口来查看文件系统……
谁能教教我么?
加载更多回复(6)

4,436

社区成员

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

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