Contents

  • 1 "Low"
    memory (< 1 MiB)

  • 2 "Upper"
    Memory (> 1 MiB)
  • 3 See
    Also
  • 3.1External
    Links

    这篇文章主要内容是计算机启动时,BIOS跳转到你的bootloader代码后的计算机的物理内存。

    1,“低”内存(<1M)

    x86计算机启动的时候进入实时模式,包括一个可用的BIOS。在CPU处于实时模式期间。IRQ0。时钟中断会反复的引发,用于启动的盘比方软盘,硬盘等都会引起中断,这就意味着,在CPU启动的过程,中断向量表(IVT)要被好好保存,由于它一直实用。

    其中断发生时,会跳到中断向量表中调用BIOS的对应程序去处理这个中断。

    bootloader也能够訪问BIOS的程序。这就意味着在bootloader执行期间要好好保存BIOS的两块内存空间,BDA和EBDA。并且每次BIOS发生时钟中断的时候。BIOS会更新BDA的一些数据。不要试图去存储不论什么数据到BDA。

    在全部的BIOS的功能已经被调用,你的操作系统已经被载入到内存里面,bootloader或者内核可能要永久的退出实时模式了。一般进入32位的保护模式。

    假设内核不再使用实时模式,開始的0x500字节能够被反复使用。可是常见的回到实时模式操作。就是处理视频显示模式的时候。

    当CPU处于保护模式的时候,系统管理模式在无形之中被激活,不能关闭,系统管理模式会使用EBDA的区域,多以EBDA不能被覆盖。

    注意:EBDA是变量区内存。对于不同的BIOS。假设它存在。它的地址低于0xa000。它保证小于128K个字节。

    通常是1K个字节。最大的一个其实才8K。

    你能够通过BIOS的12H的中断确定EBDA的大小,或者通过測试0x40e。这两个方法都能够获得EBDA的最低的位置。

    你的bootloader的代码最好载入到0x7c00-0x7dff这512b中。这段区域不能够被占用。知道运行进入了bootloader的第二阶段或者进入了你的内核。

    Overview

    start end size type description
    Low Memory (the first MiB)
    0x00000000 0x000003FF 1 KiB RAM - partially unusable (see above) Real Mode IVT (Interrupt Vector Table)
    0x00000400 0x000004FF 256 bytes RAM - partially unusable (see above) BDA (BIOS data area)
    0x00000500 0x00007BFF almost 30 KiB RAM (guaranteed free for use) Conventional memory
    0x00007C00 (typical location) 0x00007DFF 512 bytes RAM - partially unusable (see above) Your OS BootSector
    0x00007E00 0x0007FFFF 480.5 KiB RAM (guaranteed free for use) Conventional memory
    0x00080000 0x0009FBFF approximately 120 KiB, depending on EBDA size RAM (free for use, if it exists) Conventional memory
    0x0009FC00 (typical location) 0x0009FFFF 1 KiB RAM (unusable) EBDA (Extended BIOS Data Area)
    0x000A0000 0x000FFFFF 384 KiB various (unusable) Video memory, ROM Area

    BIOS Data Area (BDA)

    The BDA is only partially standardized, and almost all the values stored there are completely obsolete and uninteresting. The following is a partial list. See the External Links references below for more detail.

    address (size) description
    0x0400 (4 words) IO ports for COM1-COM4 serial (each address is 1 word, zero if none)
    0x0408 (3 words) IO ports for LPT1-LPT3 parallel (each address is 1 word, zero if none)
    0x040E (word) EBDA base address >> 4 (usually!)
    0x0410 (word) packed bit flags for detected hardware
    0x0417 (word) keyboard state flags
    0x041E (32 bytes) keyboard buffer
    0x0449 (byte) Display Mode
    0x044A (word) number of columns in text mode
    0x0463 (2 bytes, taken as a word) base IO port for video
    0x046C (word) # of IRQ0 timer ticks since boot
    0x0475 (byte) # of hard disk drives detected
    0x0480 (word) keyboard buffer start
    0x0482 (word) keyboard buffer end
    0x0497 (byte) last keyboard LED/Shift key state


    Extended BIOS Data Area (EBDA)

    You may see "maps" of the EBDA if you search the web. However, those maps are for the original IBM BIOS EBDA. They do not apply to any current EBDA, used by any current BIOS. The EBDA area is not standardized. It does contain
    data that your OS will need, but you must do a bytewise pattern search to find those tables. (See Plug-and-Play.)

    ROM Area

    start end size region/exception description
    Standard usage of the ROM Area
    0x000A0000 0x000BFFFF 128 KiB video RAM VGA display memory
    0x000C0000 0x000C7FFF 32 KiB (typically) ROM Video BIOS
    0x000C8000 0x000EFFFF 160 KiB (typically) ROMs and unusable space Mapped hardware & Misc.
    0x000F0000 0x000FFFFF 64 KiB ROM Motherboard BIOS


    2,“高内存”(>1M)

    >1M的内存区域并没有规范的,非常好的定义。或者说不连续。区域包含内存映射硬件,设备驱动能够訪问的; ACPI表。初始化代码非常可能会读取的,然后能够被又一次利用;32位计算机的硬件能够被扩展为4G。

    使用BIOS的中断INT
    15h, EAX=0xE820
    能够获得可靠的高内存映射表。

    start end size region/exception description
    High Memory
    0x00100000 0x00EFFFFF 0x00E00000 (14 MiB) RAM -- free for use (if it exists) Extended memory 1, 2
    0x00F00000 0x00FFFFFF 0x00100000 (1 MiB) Possible memory mapped hardware ISA Memory Hole 15-16MB 3
    0x01000000  ????

    ?

    ?

    ??

     ?

    ?

    ??

    ?

    ??? (whatever exists)

    RAM -- free for use More Extended memory 1
    0xC0000000 (sometimes, depends on motherboard and devices) 0xFFFFFFFF 0x40000000 (1 GiB) various (typically reserved for memory mapped devices) Memory mapped PCI devices, PnP NVRAM?, IO APIC/s, local APIC/s, BIOS, ...
    0x0000000100000000 (possible memory above 4 GiB)  ???

    ?

    ?

    ?????

    ?????

    ?

     ??

    ?

    ??

    ??

    ?

    ????

    ???? (whatever exists)

    RAM -- free for use (PAE/64bit) More Extended memory 1
     ?

    ????

    ?????

    ????

    ??

     ???

    ?

    ?????

    ?

    ??

    ????

     ????

    ?

    ????

    ????

    ???

    Possible memory mapped hardware Potentially usable for memory mapped PCI devices in modern hardware (but typically not, due to backward compatibility)

    1: Different computers have different amounts of RAM, therefore the amount of extended memory you might find will vary and may be anything from "none" (e.g. an old 80386 system) to "lots".

    2: Free for use except that your bootloader (ie. GRUB) may have loaded your "modules" here, and you don't want to overwrite those.能够任意使用包含了。你的bootloader如GRUB,非常可能调入你的模块在这里,所以你不想覆盖它。

    3: The "ISA Memory Hole" (from 0x00F00000 to 0x00FFFFFF) was used for memory mapped ISA devices (e.g. video cards). Modern computers have no need for this hole, but some chipsets still support it (as an optional feature)
    and some motherboards may still allow it to be enabled with BIOS options, so it may exist in a modern computers with no ISA devices.

x86内存映射的更多相关文章

  1. 内存映射MMAP和DMA【转】

    转自:http://blog.csdn.net/zhoudengqing/article/details/41654293 版权声明:本文为博主原创文章,未经博主允许不得转载. 这一章介绍Linux内 ...

  2. 高端内存映射之kmap持久内核映射--Linux内存管理(二十)

    1 高端内存与内核映射 尽管vmalloc函数族可用于从高端内存域向内核映射页帧(这些在内核空间中通常是无法直接看到的), 但这并不是这些函数的实际用途. 重要的是强调以下事实 : 内核提供了其他函数 ...

  3. kmalloc分配物理内存与高端内存映射--Linux内存管理(十八)

    1 前景回顾 1.1 内核映射区 尽管vmalloc函数族可用于从高端内存域向内核映射页帧(这些在内核空间中通常是无法直接看到的), 但这并不是这些函数的实际用途. 重要的是强调以下事实 : 内核提供 ...

  4. linux中的 IO端口映射和IO内存映射

    参考自:http://blog.csdn.net/zyhorse2010/article/details/6590488 CPU地址空间 (一)地址的概念 1)物理地址:CPU地址总线传来的地址,由硬 ...

  5. 浅谈内存映射I/O(MMIO)与端口映射I/O(PMIO)的区别

    最近在看NVMeDirect和SPDK的源码,觉得有必要梳理一下MMIO和PMIO的区别.关于MMIO和PMIO,维基百科上是这么讲滴, Memory-mapped I/O (MMIO) and po ...

  6. LDD3 第15章 内存映射和DMA

    本章内容分为三个部分: 第一部分讲述了mmap系统调用的实现过程.将设备内存直接映射到用户进程的地址空间,尽管不是所有设备都需要,但是能显著的提高设备性能. 如何跨越边界直接访问用户空间的内存页,一些 ...

  7. 内存映射IO(MMIO)

    端口I/O 介绍: 一种I/O编址方式是端口映射I/O(port-mapped I/O), CPU使用专门的I/O指令对设备进行访问, 并把设备的地址称作端口号. 在执行其中的一条指令时,CPU使用地 ...

  8. 内存映射文件MemoryMappedFile使用

    参考资料: http://blog.csdn.net/bitfan/article/details/4438458 所谓内存映射文件,其实就是在内存中开辟出一块存放数据的专用区域,这区域往往与硬盘上特 ...

  9. JAVA NIO FileChannel 内存映射文件

      文件通道总是阻塞式的. 文件通道不能创建,只能通过(RandomAccessFile.FileInputStream.FileOutputStream)getChannel()获得,具有与File ...

随机推荐

  1. jQuery选择器(内容过滤选择器)第四节

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...

  2. react-native多图选择、图片裁剪(支持ad/ios图片个数控制)

    扯淡: 目前关于rn比较知名并且封装好的图片选择控件很多,不过能同时支持多图片上传,个数控制兼容iOS/Ad的却寥寥无几,而今天介绍的这款框架可以实现:图片裁剪.最大图片个数限制.拍照.本地相册等功能 ...

  3. [转载] 使用 Twitter Storm 处理实时的大数据

    转载自http://www.ibm.com/developerworks/cn/opensource/os-twitterstorm/ 流式处理大数据简介 Storm 是一个开源的.大数据处理系统,与 ...

  4. tornado+WSGI+Apache

    1.原理 2.安装mod_wsgi http://pan.baidu.com/s/1sjsccWH configure的时候会找对应的python脚本,默认是/usr/bin/python 生成mod ...

  5. 基于BroadReceiver实现获取短信内容

    我朋友拜托我做一个能实现向指定号码发短信获取动态密码的一个小app,中间用到了基于监听系统通知的BroadReceiver 来实现获取有新短信并且获取新短信的内容.下面就是这个小app的实现监听部分的 ...

  6. JavaScript学习笔记(七)——函数的定义与调用

    在学习廖雪峰前辈的JavaScript教程中,遇到了一些需要注意的点,因此作为学习笔记列出来,提醒自己注意! 如果大家有需要,欢迎访问前辈的博客https://www.liaoxuefeng.com/ ...

  7. springboot(十六):使用Jenkins部署Spring Boot

    jenkins是devops神器,本篇文章介绍如何安装和使用jenkins部署Spring Boot项目 jenkins搭建 部署分为三个步骤: 第一步,jenkins安装 第二步,插件安装和配置 第 ...

  8. python 批量修改数字类的文件名

    今天碰到一个小问题,下载音频的时候,文件名的名字变成了数字,排序呢,是按照数字的大小往下排的. 想自己给它们重新起名字,但是又不打乱音频的顺序.好吧,那就自己写写代码吧. 思路就是遍历音频文件的数字文 ...

  9. openface 训练数据集

    训练深度网络模型OpenFace还不是运用faceNet的model作为训练模型,所以在准确性上比faceNet要低,如果你只是做一个简单的分类,建议你看看官网的demo3(http://cmusat ...

  10. ip地址与整数相互转换

    一.将ip地址转成long数值 将IP地址转化成整数的方法如下: 1.通过String的split方法按.分隔得到4个长度的数组 2.通过左移位操作(<<)给每一段的数字加权,第一段的权为 ...