這是內核自帶的文檔,講解ARM芯片的內存是如何佈局的!比較簡單,對於初學者能夠看一下!但要想深刻理解Linux內存管理,建議仍是找幾本好書看看,如深刻理解Linux虛擬內存,嵌入系統分析,Linux內核分析及程序設計等; linux
Kernel Memory Layout on ARM Linux 架構
Linux在ARM平臺上的內存佈局 app
Russell King <rmk@arm.linux.org.uk>
November 17, 2005 (2.6.15) ide
This document describes the virtual memory layout which the Linux kernel uses for ARM processors. It indicates which regions are free for platforms to use, and which are used by generic code. 函數
本文檔描述了Linux內核在ARM處理器上的虛擬內存佈局。說明了哪些區域是給ARM平臺使用的,哪些區域是通用代碼使用的。 佈局
The ARM CPU is capable of addressing a maximum of 4GB virtual memory space, and this must be shared between user space processes, the kernel, and hardware devices. this
ARM系列的CPU最大有4GB的虛擬內存空間尋址能力,但它必須用戶空間,內存以及硬件設備共享地址空間。 spa
As the ARM architecture matures, it becomes necessary to reserve certain regions of VM space for use for new facilities; therefore this document may reserve more VM space over time. 設計
在ARM架構成熟的同時,它也開始須要在VM空間保留明確的區域,讓用戶使用更簡單,所以,隨着時間的流逝,本文檔可能保留了更多的VM空間。 指針
Start(開始地址) End(結束地址) Use(使用說明)
--------------------------------------------------------------------------
ffff8000 ffffffff copy_user_page / clear_user_page use. For SA11xx and Xscale, this is used to setup a minicache mapping.
copy_user_page/clear_user_page使用,對於SA11XX和Xscal,它用於設置機器映射。
ffff1000 ffff7fff Reserved.
Platforms must not use this address range. 保留,ARM平臺必定不使用這個區間。
ffff0000 ffff0fff CPU vector page. CPU向量表
The CPU vectors are mapped here if the CPU supports vector relocation (control register V bit.)
若是CPU支持向量重定向(控制寄存器的V位),則CPU向量被映射到這裏。
ffc00000 fffeffff DMA memory mapping region. Memory returned by the dma_alloc_xxx functions will be dynamically mapped here.
DMA內存映射區間。由dma_ammoc_xxx系列函數返回的內存會動態的映射到這裏。
ff000000 ffbfffff Reserved for future expansion of DMA mapping region.
保留,用於之後的DMA擴展映射區間。
VMALLOC_END feffffff Free for platform use, recommended. 建議平臺保留。
VMALLOC_END must be aligned to a 2MB boundary. VMALLOC_END必須在2MB的邊界上對齊。
VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. vmalloc
Memory returned by vmalloc/ioremap will be dynamically placed in this region. VMALLOC_START may be based upon the value of the high_memory variable.
vmalloc/ioremap 函數返回的內存會被動態的放到該區間。VMALLOC_START 可能的值可能會基於high_memory變量的值而有所不一樣。
PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region. 內核直接映射內存區間。
This maps the platforms RAM, and typically maps all platform RAM in a 1:1 relationship.
它映射平臺的RAM,一般全部的平臺都使用1:1的映射關係。
TASK_SIZE PAGE_OFFSET-1 Kernel module space Kernel modules inserted via insmod are
placed here using dynamic mappings.
內核模塊空間,內核模塊經過insmod命令加載,會動態的映射到這裏。
00001000 TASK_SIZE-1 User space mappings 用戶空間
Per-thread mappings are placed here via
the mmap() system call.每一個進程經過mmap系統調用的映射放到這裏。
00000000 00000fff CPU vector page / null pointer trap CPU向量表,NULL指針陷井
CPUs which do not support vector remapping place their vector page here. NULL pointer dereferences by both the kernel and user space are also caught via this mapping.
不支持向量重映射的CPU的向量表被映射到這裏。用戶空間和內核態的NULL指針引經過這個映射能夠被捕獲。
Please note that mappings which collide with the above areas may result
in a non-bootable kernel, or may cause the kernel to (eventually) panic
at run time.
請注意:一些與上面衝突的映射會致使內核沒法啓動,或者可能在運行時會產生(最終)內核panic !
Since future CPUs may impact the kernel mapping layout, user programs
must not access any memory which is not mapped inside their 0x0001000
to TASK_SIZE address range. If they wish to access these areas, they
must set up their own mappings using open() and mmap().
無論CPU特性會是否與內核的映射佈局衝突,用戶程序在內部沒有映射0x0001000到TASK_SIZE之間的地址空間時,必須不能訪問這裏面的內存。若是他們想這樣作,那麼他們必須經過open和mmap來建立本身的映射。