Linux内存管理 - PAGE_OFFSET理解
PAGE_OFFSET 代表的是内核空间和用户空间对虚拟地址空间的划分,对不同的体系结构不同。比如在32位系统中3G-4G 属于内核使用的内存空间,所以PAGE_OFFSET=0xC0000000。在X86-64架构下是ffff880000000000。可以看到内核程序可以可以访问从PAGE_OFFSET 之后的内存,访问所有的信息(注意页的写保护)。

参考:https://www.kernel.org/doc/Documentation/x86/x86_64/mm.txt
Virtual memory map with 4 level page tables:

0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm
hole caused by [48:63] sign extension
ffff800000000000 - ffff87ffffffffff (=43 bits) guard hole, reserved for hypervisor
ffff880000000000 - ffffc7ffffffffff (=64 TB) direct mapping of all phys. memory
ffffc80000000000 - ffffc8ffffffffff (=40 bits) hole
ffffc90000000000 - ffffe8ffffffffff (=45 bits) vmalloc/ioremap space
ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole
ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB)
... unused hole ...
ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks
... unused hole ...
ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0
ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space
ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls
ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole

The direct mapping covers all memory in the system up to the highest
memory address (this means in some cases it can also include PCI memory
holes).

vmalloc space is lazily synchronized into the different PML4 pages of
the processes using the page fault handler, with init_level4_pgt as
reference.

Current X86-64 implementations only support 40 bits of address space,
but we support up to 46 bits. This expands into MBZ space in the page tables.

->trampoline_pgd:

We map EFI runtime services in the aforementioned PGD in the virtual
range of 64Gb (arbitrarily set, can be raised if needed)

0xffffffef00000000 - 0xffffffff00000000

-Andi Kleen, Jul 2004

更多相关文章

  1. Linux-2.6 所有版本内核源码下载
  2. linux3.1内核移植到S3C2416的过程和问题。
  3. linux 内核编译配置内核make menuconfig 出错解决方法
  4. Linux内核中实现生产者与消费者(避免无效唤醒)
  5. Linux2.6内核下键盘输入设备驱动的实现
  6. Linux内核构建系统之一
  7. 边学边干Linux内核指导(8)——进程调度
  8. Linux 2.6.x 内核模块加载错误 “Invalid module format” 解决
  9. Linux内核分析-9/进程的调度时机

随机推荐

  1. Android Scrollview
  2. android讲义2之输入界面
  3. Android EditText属性用法
  4. 关于GridView控件中设置大小的问题
  5. 关于android分辨率和使用iphone版切图
  6. Android中字体加粗
  7. Android Studio启动安卓虚拟机失败,附Andr
  8. Android按钮美化
  9. 安卓XML布局,相对布局的常用属性~
  10. android 自带的主题 theme 的使用