Chinaunix首页 | 论坛 | 博客
  • 博客访问: 354197
  • 博文数量: 77
  • 博客积分: 1447
  • 博客等级: 中尉
  • 技术积分: 885
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-21 21:48
文章分类

全部博文(77)

文章存档

2021年(2)

2020年(2)

2016年(3)

2015年(1)

2014年(4)

2013年(1)

2012年(23)

2011年(15)

2010年(26)

分类:

2010-04-22 16:46:42

我相让内核使用更多的内存空间,所以找到如下的方法,不过没有效果,也可能我没有搞对。

编译内核,指定用户态与内核态如何分配4G(32位最大可寻址的范围)的内存。请查看源码中arch/x86/Kconfig下的配置信息:
choice
        depends on EXPERIMENTAL
        prompt "Memory split" if EMBEDDED
        default VMSPLIT_3G
        depends on X86_32
        ---help---
          Select the desired split between kernel and user memory.

          If the address range available to the kernel is less than the
          physical memory installed, the remaining memory will be available
          as "high memory". Accessing high memory is a little more costly
          than low memory, as it needs to be mapped into the kernel first.
          Note that increasing the kernel address space limits the range
          available to user programs, making the address space there
          tighter.  Selecting anything other than the default 3G/1G split
          will also likely make your kernel incompatible with binary-only
          kernel modules.

          If you are not absolutely sure what you are doing, leave this
          option alone!

        config VMSPLIT_3G
                bool "3G/1G user/kernel split"
        config VMSPLIT_3G_OPT
                depends on !X86_PAE
                bool "3G/1G user/kernel split (for full 1G low memory)"
        config VMSPLIT_2G
                bool "2G/2G user/kernel split"
        config VMSPLIT_2G_OPT
                depends on !X86_PAE
                bool "2G/2G user/kernel split (for full 2G low memory)"
        config VMSPLIT_1G
                bool "1G/3G user/kernel split"
endchoice

config PAGE_OFFSET
        hex
        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0x80000000 if VMSPLIT_2G
        default 0x78000000 if VMSPLIT_2G_OPT
        default 0x40000000 if VMSPLIT_1G
        default 0xC0000000
        depends on X86_32


将default VMSPLIT_3G  修改为 default VMSPLIT_1G可以改为用户态最大可寻址的范围为1G而内核可寻址的范围为3G。我编译内核后没有效果。

后来我实在没办法了,来了个野蛮的做法修改 config PAGE_OFFSET那一段

config PAGE_OFFSET
        hex
        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0x80000000 if VMSPLIT_2G
        default 0x78000000 if VMSPLIT_2G_OPT
        default 0x40000000 if VMSPLIT_1G
        default 0x40000000     
        depends on X86_32

将  default  0xC0000000  改为 default 040000000  一切ok


阅读(2550) | 评论(1) | 转发(0) |
0

上一篇:kthread_run

下一篇:更新内核

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

安何2010-04-27 10:09:38