存储器映射显示出比实际可用更多的RAM [英] Memory map shows more RAM than physically available

查看:265
本文介绍了存储器映射显示出比实际可用更多的RAM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个小的x86内核。我访问和试图读取存储器映射,GRUB提供了在多引导头。我有一个英特尔酷睿i3的CPU和RAM的4吉布。这台机器上运行时,我读了以下存储器映射:

  --base Address-- --Length-- --Type--0x0000000000000000 0x000000000009d000为0x1
0x000000000009d000 0x0000000000003000 0X2
0x00000000000e0000 0x0000000000020000 0X2
0x0000000000100000 0x00000000bb53f000为0x1
0x00000000bb63f000 0x0000000000080000 0X2
0x00000000bb6bf000 0x0000000000100000为0x4
0x00000000bb7bf000 0x0000000000040000 0x3中
0x00000000bb7ff000 0x0000000000001000为0x1
0x00000000bb800000 0x0000000004800000 0X2
0x00000000e0000000 0x0000000010000000 0X2
0x00000000feb00000 0x0000000000004000 0X2
0x00000000fec00000 0x0000000000001000 0X2
0x00000000fed10000 0x0000000000004000 0X2
0x00000000fed18000 0x0000000000002000 0X2
0x00000000fed1b000 0x0000000000005000 0X2
0x00000000fee00000 0x0000000000001000 0X2
0x00000000ffe80000 0x0000000000180000 0X2
0x0000000100000000 0x0000000038000000为0x1

当我起来总可用内存方面,我得到...

为0x1(可选) - 3893.8 MIB

这似乎正确的,留下最后200ish MIB保留用于其它设备。
唯一的问题是总的其他存储器类型:

0X2,0x3中,为0x4 - 331.5 MIB

把我的内存总量为4225.3 MIB或略超过4.1吉布,这使我对我的问题:


  1. 为什么我总金额超过的RAM 4GiB我只安装了4GiB什么时候?


  2. 为什么在内存映射0x0000000100000000最后的基地址?随着RAM只有4GiB,32位应该是解决这一切所需的最高地址大小。我误解的东西在这里?



解决方案

的几点思考:


  • 地址空间!=物理内存的大小。

  • 的酷睿i3支持64位两种,或者用36bit的32位PAE模式的虚拟地址空间(可选的,内核支持)。如果你确实有在启动32位系统的可用RAM 4GiB,PAE必须启用。如何检查: http://serverfault.com/q/247080

  • AFAIR,这些范围可以重叠并以任何顺序出现,以便排序和重新输入到最受限类型或范围分裂是必需的。

  • 这最后的基地址 0x0000000100000000 为> = 2 ^ 32。这通常是因为硬件,ROM映像和其他特殊范围的(所有?)的电脑被分配低于2 ^ 32。因此,需要无论PAE或长模式访问范围起始于或高于2 ^ 32主存储器

编辑:

在这里寻找更多详情: http://wiki.osdev.org/Detecting_Memory_%28x86% 29

编辑2:

今天,我偶然发现了一个的Sysinternals工具,这说明以下为我的EFI系统的物理范围​​的映射,而改变任何相关的设置。正如人们所看到的,64GiB主内存在 0x100000000 映射,就在2 ^ 32:

I am working on a small x86 kernel. I am accessing and attempting to read the memory map that GRUB provides in the multiboot header. I have an Intel i3 cpu and 4 GiB of RAM. While running on this machine, I am reading the following memory map:

 --Base Address--          --Length--      --Type--

0x0000000000000000     0x000000000009d000     0x1
0x000000000009d000     0x0000000000003000     0x2
0x00000000000e0000     0x0000000000020000     0x2
0x0000000000100000     0x00000000bb53f000     0x1
0x00000000bb63f000     0x0000000000080000     0x2
0x00000000bb6bf000     0x0000000000100000     0x4
0x00000000bb7bf000     0x0000000000040000     0x3
0x00000000bb7ff000     0x0000000000001000     0x1
0x00000000bb800000     0x0000000004800000     0x2
0x00000000e0000000     0x0000000010000000     0x2
0x00000000feb00000     0x0000000000004000     0x2
0x00000000fec00000     0x0000000000001000     0x2
0x00000000fed10000     0x0000000000004000     0x2
0x00000000fed18000     0x0000000000002000     0x2
0x00000000fed1b000     0x0000000000005000     0x2
0x00000000fee00000     0x0000000000001000     0x2
0x00000000ffe80000     0x0000000000180000     0x2
0x0000000100000000     0x0000000038000000     0x1

When I total up the available memory areas, I get...

0x1 (Available) - 3893.8 MiB

Which seems about right, leaving the last 200ish MiB reserved for other devices. The only problem is the total of the other memory types:

0x2, 0x3, 0x4 - 331.5 MiB

Putting my total amount of RAM at 4225.3 MiB or a little over 4.1 GiB, which leads me to my questions:

  1. Why am I totaling more than 4GiB of RAM when I only have 4GiB installed?

  2. Why is the last base address in the memory map 0x0000000100000000? With only 4GiB of RAM, 32 bits should be the max address size needed to address all of it. Am I misunderstanding something here?

解决方案

Some thoughts:

  • Address space != physical memory size.
  • An i3 supports virtual address spaces in either 64bit, or 32bit mode with 36bit PAE (optional, with kernel support). If you actually have 4GiB of RAM available in the booted 32bit system, PAE must be enabled. How to check: http://serverfault.com/q/247080
  • AFAIR, those ranges could overlap and appear in any order, so that ordering and re-typing to the most restricted type or range splitting is required.
  • That last base address 0x0000000100000000 is >= 2^32. This is usually done, because hardware, ROM images and other special ranges are allocated below 2^32 in (all?) PCs. Thus, either PAE or long mode is required to access main memory ranges starting at or above 2^32.

Edit:

Look here for more details: http://wiki.osdev.org/Detecting_Memory_%28x86%29

Edit 2:

Today, I stumbled upon a Sysinternals tool, which shows following physical range mapping for my EFI System, without any related setting altered. As one can see, all of 64GiB main memory is mapped at 0x100000000, right at 2^32:

这篇关于存储器映射显示出比实际可用更多的RAM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆