[譯]Kernel Memory Layout on ARM Linux

來源:互聯網
上載者:User

這是核心內建的文檔,講解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來建立自己的映射。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.