
} A "." section attribute is defined in the file arch / arm / kernel / Unsigned long _cpu_flush / * used by head.S * / Unsigned long _cpu_io_mmu_flags / * used by head.S * / Unsigned long _cpu_mm_mmu_flags / * used by head.S * / Where is this value assigned? Look down Mov pc, lr return from _create_page_tablesĭefine the processor-related information data structure in the arch / arm / include / asm / procinfo.h header file
KERNEL R4 OUTER SPACE CODE
Omit a piece of code in the middle, because conditional compilation is not established, which is equivalent to commenting out. Str r6, Write the descriptor to the corresponding page table location, the third page table descriptor is created Orr r6, r7, # (PHYS_OFFSET & 0xff000000) r6 = PA section base addr + flags Ldr r6, = (KERNEL_END-1) r4 = ttb base address r0 = retrieval value of kernel 1M descriptor in ttbĪdd r6, r4, r6, lsr # 18 r6 = used to identify the search address at the end of the kernel address space in ttbĪdd r3, r3, # 1 > 18 PAGE_OFFSET is defined as SDRAM start address 0x30000000 Str r3, ! take the upper 8 bits of the kernel space address (VA) and then 4 bits, adding up to the previous sentence, a total of 12 bits, "!" Write the address to r0 Orr r3, r7, r6, lsl # 20 flags + kernel base (PA) r3 = (r7) | ((r6) > 18 Take the upper 8 bits of the kernel space address (VA), the immediate value of arm can only be 8 bits Mov r6, pc, lsr # 20 start of kernel section r6 = 0x300
KERNEL R4 OUTER SPACE PC
* We get the segment base address through the current program count register PC value This is for the subsequent MMU startup, and then it will be removed and destroyed by the paging_init () function. * Next is to create a page table for the first 1MB of the direct mapping area of the kernel space. * counter to determine corresponding section base address. * Create identity mapping for first MB of kernel to Ldr r7, mm_mmuflags get the value of _cpu_mm_mmu_flags of proc_info_list and store it in r7, see the second note Each page table entry is 32 bits (4 bytes), so the page table occupies 4096 * 4 = 16k of memory space. * The page table divides the 4GB address space into several 1MB sections, so the page table contains 4096 page table entries (section entries). * Clear the 16K level 1 swapper page table

Macro pgtbl, rd, through this macro will set r4 (0x30004000) to the physical base address of the page table, r4 value has not changed in the future pgtbl is an assembly macro definition.


* r4 = physical page table address: r4 = the base address of the page table, the value of r4 is still assigned when the kernel self-decompresses: the starting address of the image after the kernel decompresses 0x30008000 * generally means mapping in the kernel code. * amount which are required to get the kernel running, which Temporary page table uses a segmented page tableĪnalyze the _create_page_tables assembly code of linux-2.6.30.4 / arch / arm / kernel / head.S: The process of converting MVA to PA using a first-level segment page tableĬode time is up The first paragraph of notes: the Map the first 1M of the kernel address space to the first 1M space of the SDRAM because the kernel startup parameters are stored thereĪRM920T's built-in MMU address conversion method: this suggestion to look at the ARM920T manual, after all, it is originalįirst-level descriptor format: This is mainly related to the first-level segmented page table descriptor The part of the code that directly maps the entire kernel address space to the SDRAMģ. The virtual address space in accordance with the "1: 1" peer mapped to the first 1M at the kernel imageĮffects: Before starting the MMU, you can only use the real address mode to runĢ. Mainly to complete the mapping relationships:ġ. Create a temporary page tables: the kernel starts early, stage page table mappings (1M size)
