Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239290
  • 博文数量: 32
  • 博客积分: 557
  • 博客等级: 中士
  • 技术积分: 431
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-20 23:05
文章分类

全部博文(32)

文章存档

2015年(4)

2014年(2)

2012年(4)

2011年(22)

分类: LINUX

2011-05-06 23:26:07

移植完成的Linux系统,只能识别到16M的内存,而实际大小为64M。
Memory: 16MB = 16MB total
Memory: 11840k/11840k available, 4544k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc1800000 - 0xe0000000   ( 488 MB)
    lowmem  : 0xc0000000 - 0xc1000000   (  16 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0027000   ( 124 kB)
      .text : 0xc0027000 - 0xc03c4000   (3700 kB)
      .data : 0xc03e4000 - 0xc040d200   ( 165 kB)

修改bootloader启动参数为:
bootargs=noinitrd root=/dev/mtdblock3 rw rootfstype=cramfs init=/linuxrc mem=64M
无效。

wangjianchangdx 2011-05-06 23:45
内核是怎么知道硬件系统内存的大小的?

wangjianchangdx 2011-05-07 00:07

wangjianchangdx 2011-05-07 23:44
U-boot给kernel传参数和kernel读取参数—struct tag
http://blogold.chinaunix.net/u3/90973/showart_1925725.html

wangjianchangdx 2011-05-08 10:26
__atags_pointer defined in arch/arm/kernel/setup.c,
and initialized in arch/arm/kernel/head-common.S by __mmap_switched using the paramter passed by bootloader.

Kernel读取U-boot传递的相关参数

wangjianchangdx 2011-05-08 10:32
问题:通过U-Boot传递的启动参数“失常”
调试发现__atags_pointer为0,系统启动时打印的“Kernel command line: noinitrd console=tty0,115200 console=ttySAC0,115200 root=/dev/mtdblock3 rw”信息,完全来自于内核中配置的boot options.
问题的原因可能出在u-boot的配置上

wangjianchangdx 2011-05-08 21:32
经对启动参数代码的调试,发现U-Boot传递给Linux Kernel的__atags_pointer为空,说明是u-boot没有传参到Linux Kernel。
修改u-boot mini2440.h中的配置文件,添加:
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_CMDLINE_TAG
启动参数识别成功:
noinitrd root=/dev/mtdblock3 rw console=ttySAC0,115200 init=/linuxrc mem=64M

阅读(3876) | 评论(8) | 转发(0) |
0

上一篇:Linux内核移植

下一篇:ARM Linux Boot Sequence

给主人留下些什么吧!~~

wangjianchangdx2011-11-20 01:29:02

狼之鹏: 我也有类似的问题,请问你是怎么解决的?.....
请参看回复信息

狼之鹏2011-11-19 23:33:20

我也有类似的问题,请问你是怎么解决的?

wangjianchangdx2011-05-08 21:32:26

经对启动参数代码的调试,发现U-Boot传递给Linux Kernel的__atags_pointer为空,说明是u-boot没有传参到Linux Kernel。
修改u-boot mini2440.h中的配置文件,添加:
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_CMDLINE_TAG
启动参数识别成功:
noinitrd root=/dev/mtdblock3 rw console=ttySAC0,115200 init=/linuxrc mem=64M

wangjianchangdx2011-05-08 10:26:05

__atags_pointer defined in arch/arm/kernel/setup.c,
and initialized in arch/arm/kernel/head-common.S by __mmap_switched using the paramter passed by bootloader.

Kernel读取U-boot传递的相关参数
http://www.nishizawa23.com/

wangjianchangdx2011-05-07 23:44:39

U-boot给kernel传参数和kernel读取参数—struct tag
http://blogold.chinaunix.net/u3/90973/showart_1925725.html