内核进入文件系统时,挂住了!

挖掘机 2011-01-19 07:37:49
各位大侠:
我遇到这么个问题。
我编译了一个小系统,文件系统用的是squashfs3.0, 内核是linux2.6.21.5。烧入flash,启动后,在
“Freeing unused kernel memory: 100k freed”会停下来,执行不下去了。
如果重启,系统又顺利启动了。
我反复重启了几次,会有若干次在 “Freeing unused kernel memory: 100k freed”停住的现象。
但我在代码里添加调试语句编译,烧到flash上,有时候没问题,有时候就有问题,很奇怪。
现在我不知道该如何是好,没有方向了。请大家帮我出出主意,谢谢。
以下是内核启动的信息。

Code Address: 0x80010000, Entry Address: 0x8034f000
Decompression OK!
Entry at 0x8034f000
Closing network.
Disabling Switch ports.
Flushing Receive Buffers...
0 buffers found.
Closing DMA Channels.
Starting program at 0x8034f000
Linux version 2.6.21.5 (chenxi@localhost.localdomain) (gcc version 4.2.3) #7 Tue Nov 30 00:06:00 CST 2010
HS Serial flash device: name MX25L128, id 0xc218 size 16384KB
96328avng_613 prom init
CPU revision is: 0002a075
Determined physical RAM map:
memory: 03f00000 @ 00000000 (usable)
On node 0 totalpages: 16128
DMA zone: 32 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 4064 pages, LIFO batch:0
Normal zone: 94 pages used for memmap
Normal zone: 11938 pages, LIFO batch:1
Built 1 zonelists. Total pages: 16002
Kernel command line: root=31:0 ro noinitrd console=ttyS0,115200
brcm mips: enabling icache and dcache...
Primary instruction cache 32kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 32kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (21 instructions).
Synthesized TLB load handler fastpath (33 instructions).
Synthesized TLB store handler fastpath (33 instructions).
Synthesized TLB modify handler fastpath (32 instructions).
PID hash table entries: 256 (order: 8, 1024 bytes)
Using 160.000 MHz high precision timer.
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Allocating memory for DSP module core and initialization code
Allocated DSP module memory - CORE=0x0 SIZE=0, INIT=0x0 SIZE=0
Memory: 60316k/64512k available (2454k kernel code, 4180k reserved, 865k data, 100k init, 0k highmem)
KLOB Pool 1 Initialized: 1048576 bytes <0x80c00000 ... 0x80d00000>
Calibrating delay loop... 318.46 BogoMIPS (lpj=159232)
Mount-cache hash table entries: 512
wait instruction: enabled
NET: Registered protocol family 16
Total Flash size: 16384K with 256 sectors
File system address: 0xb85e0100
registering PCI controller with io_map_base unset
registering PCI controller with io_map_base unset
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Bridge: 0000:01:00.0
IO window: disabled.
MEM window: 10f00000-10ffffff
PREFETCH window: disabled.
PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
PCI: Setting latency timer of device 0000:01:00.0 to 64
BLOG v2.1 Initialized
NET: Registered protocol family 8
NET: Registered protocol family 20
Time: MIPS clocksource has been installed.
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
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
NTFS driver 2.1.28 [Flags: R/O].
JFFS2 version 2.2. (C) 2001-2006 Red Hat, Inc.
fuse init (API version 7.8)
io scheduler noop registered (default)
PPP generic driver version 2.4.2
NET: Registered protocol family 24
bcm963xx_mtd driver v1.0
Registered device mtd[BCM63XX AuxFS] dev[1] Flash[0x8033f4a4,4194304]
PCI: Enabling device 0000:00:0a.0 (0000 -> 0002)
PCI: Setting latency timer of device 0000:00:0a.0 to 64
ehci_hcd 0000:00:0a.0: EHCI Host Controller
ehci_hcd 0000:00:0a.0: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:0a.0: irq 50, io mem 0x10002500
ehci_hcd 0000:00:0a.0: USB f.f started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
PCI: Enabling device 0000:00:09.0 (0000 -> 0002)
PCI: Setting latency timer of device 0000:00:09.0 to 64
ohci_hcd 0000:00:09.0: OHCI Host Controller
ohci_hcd 0000:00:09.0: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:09.0: irq 49, io mem 0x10002600
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
brcmboard: brcm_board_init entry
SES: Button Interrupt 0x1 is enabled
SES: LED GPIO 0x8009 is enabled
Serial: BCM63XX driver $Revision: 3.00 $
ttyS0 at MMIO 0xb0000100 (irq = 36) is a BCM63XX
ttyS1 at MMIO 0xb0000120 (irq = 47) is a BCM63XX
Mirror/redirect action on
u32 classifier
input device check on
Actions configured
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 10
6WIND/LSIIT IPv6 multicast forwarding 0.1 plus PIM-SM/SSM with *BSD API
NET: Registered protocol family 17
NET: Registered protocol family 15
Initializing MCPD Module
Ebtables v2.0 registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 100k freed
...全文
1169 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
merrymood2003 2011-03-08
  • 打赏
  • 举报
回复
同样问题,求解答
windman521 2011-01-25
  • 打赏
  • 举报
回复
Memory: 60316k/64512k available (2454k kernel code, 4180k reserved, 865k data, 100k init, 0k highmem)

可以看出来高端内存已经没有了。
你是不是设置过内存分区??
挖掘机 2011-01-21
  • 打赏
  • 举报
回复
Freeing unused kernel memory: 100k freed
这句话是有的
iguest 2011-01-20
  • 打赏
  • 举报
回复
看log file system已经mount上了。
lgch123456 2011-01-20
  • 打赏
  • 举报
回复
还可能是你的内存硬件问题。。
leeyiqun 2011-01-20
  • 打赏
  • 举报
回复
估计是你开发板的 ram 内存空间不够用了。当系统可以正常启动后,输入命令 free 看看还剩下有多少没有用到的内存空间,像我这里一样
[~]free
total used free shared buffers
Mem: 62704 59820 2884 0 760
Swap: 0 0 0
Total: 62704 59820 2884
我有62M多的内存,已经用了59M多的空间,剩下2M多的内存空间了。
leeyiqun 2011-01-20
  • 打赏
  • 举报
回复
正常启动的时候有没有这一句呢?
挖掘机 2011-01-20
  • 打赏
  • 举报
回复
Freeing unused kernel memory: 100k freed
这句话是有的,系统打印完这句话后,就挂住了。
我也一直在分析调试,就是不清楚处理这种问题的关键在哪里。
leeyiqun 2011-01-20
  • 打赏
  • 举报
回复
你正常启动后的内核启动信息有没有“Freeing unused kernel memory: 100k freed”这一句呢?
如果没有的话,我分析有可能是你内核在启动的时候,加载驱动可能有些地方申请了很大的一块内存,导致到了Mounted root 文件系统的时候内存不够了。
但是当内存足够的时候,加载文件系统成功后,前面申请的内存也可能释放出来了,所以这时你用 free 命令看到的是还有很大的内存空间。

像这样的问题,我们没有看到具体情况,所以给你只能是一些分析和猜想,问题的解决还是需要你自己多多调试才行。
挖掘机 2011-01-20
  • 打赏
  • 举报
回复
连续重启两次后,系统起来了。我查了一下内存信息,如下:
MemTotal: 60432 kB
MemFree: 31100 kB
Buffers: 3532 kB
Cached: 11364 kB
SwapCached: 0 kB
Active: 6424 kB
Inactive: 10660 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 2212 kB
Mapped: 2624 kB
Slab: 3072 kB
SReclaimable: 456 kB
SUnreclaim: 2616 kB
PageTables: 252 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 30216 kB
Committed_AS: 5816 kB
VmallocTotal: 1032148 kB
VmallocUsed: 6776 kB
VmallocChunk: 1022716 kB
还是有相当多的空间。

关于是否是硬件问题,请问可能是哪方面的,什么原因引起的呢?


关于log file system,我这个小系统好像没用到.
jcwKyl 2011-01-19
  • 打赏
  • 举报
回复
爱莫能助了。如果还没有得到解决,你可以去国外的一些论坛上问一下,人气比较高。我常去的有linux questions和stack overflow这两个网站都非常好。
下面是linux questions的kernel forum:
http://www.linuxquestions.org/questions/linux-kernel-70/

持续关注中。。。

4,466

社区成员

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

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