關於6410開發板Linux記憶體位址0Xc0008000的由來

來源:互聯網
上載者:User

查看6410資料手冊可以看到,記憶體開始地址應該是0x50000000,而實際在real6410開發板使用過程中U-boot載入Linux核心都是載入到0xC0008000處開始運行,我猜測(還沒有看代碼來驗證猜測)這個是因為Linux啟動核心的地址為0xC0008000,而U-boot為了和Linux保持一致,故對記憶體也做了映射,方便使用者使用。下面先以核心2.6.28為例來先來看一下Linux中這個記憶體位址的由來。 首先看啟動代碼代碼arch/arm/kernel/head.S 29 #define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET)//定義虛擬記憶體首地址 30 #define KERNEL_RAM_PADDR (PHYS_OFFSET + TEXT_OFFSET)//定義實際實體記憶體地址 PAGE_OFFSET的出處 代碼arch/arm/include/asm/memory.c 27 #ifdef CONFIG_MMU 28 29 /* 30 * PAGE_OFFSET - the virtual address of the start of the kernel image 31 * TASK_SIZE - the maximum size of a user space task. 32 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area 33 */ 34 #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) 代碼include/linux/autoconf.h #define CONFIG_PAGE_OFFSET 0xc0000000 PHYS_OFFSET 的出處 代碼 arch/arm/mach-s3c6400/include/mach/memory.h //與6400平台相關的記憶體設定 #define PHYS_OFFSET UL(0x50000000) TEXT_OFFSET的定義在arch/arm/Makefile中,這個值是核心所在位置的實際位移量,具體對這個值的說明看檔案arch/arm/kernel/head.S。 38 /* 39 * swapper_pg_dir is the virtual address of the initial page table. 40 * We place the page tables 16K below KERNEL_RAM_ADDR. Therefore, we must 41 * make sure that KERNEL_RAM_ADDR is correctly set. Currently, we expect 42 * the least significant 16 bits to be 0x8000, but we could probably 43 * relax this restriction to KERNEL_RAM_ADDR >= PAGE_OFFSET + 0x4000. 44 */ 也就是說,從地址KERNEL_RAM_VADDR 開始的至少0x4000用來存放核心頁表,而存放核心頁表的空間值建議是0x8000。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.