Kernel Memory Layout on ARM Linux
這是內核自帶的文檔,講解ARM芯片的內存是如何布局的!比較簡單,對于初學者可以看一下!但要想深入理解Linux內存管理,建議還是找幾本好書看看,如深入理解Linux虛擬內存,嵌入系統分析,Linux內核分析及程序設計等;?
Kernel Memory Layout on ARM Linux
Linux在ARM平臺上的內存布局
? Russell King <rmk@arm.linux.org.uk>
?????? November 17, 2005 (2.6.15)
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.
ARM系列的CPU最大有4GB的虛擬內存空間尋址能力,但它必須用戶空間,內存以及硬件設備共享地址空間。
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來創建自己的映射。
轉載于:https://www.cnblogs.com/xmphoenix/p/3627024.html
總結
以上是生活随笔為你收集整理的Kernel Memory Layout on ARM Linux的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 浅谈面向对象开发原则:高内聚,低耦合
- 下一篇: ShowDoc 软件开发团队接口文档管理