Changes

801 bytes added ,  05:49, 31 August 2019
Line 125: Line 125:  
Next, it initializes the MMU with a basic identity mapping for Kernel + KernelLdr.
 
Next, it initializes the MMU with a basic identity mapping for Kernel + KernelLdr.
 
<pre>
 
<pre>
// TODO: Fill this out with pseudocode.
+
    // Set page table region
 +
    page_table_region = ini1_end_address;
 +
    page_table_region_size = 0x200000;
 +
    g_InitialPageAllocator.Initialize(page_table_region);
 +
 
 +
    // Initialize new page table, eventually ends up in TTBR1_EL1.
 +
    KInitialPageTable ttbr1_page_table(&g_InitialPageAllocator);
 +
 
 +
    // Setup MMU with initial identity mapping.
 +
    KernelLdr_MapInitialIdentityMapping(&ttbr1_page_table, kernel_base, rw_end_offset, page_table_region, page_table_region_size, &g_InitialPageAllocator);
 
</pre>
 
</pre>
   Line 165: Line 174:  
<pre>
 
<pre>
 
     return final_virtual_kernel_base - original_kernel_base;
 
     return final_virtual_kernel_base - original_kernel_base;
 +
</pre>
 +
 +
== KernelLdr_MapInitialIdentityMapping ==
 +
 +
Signature is like
 +
 +
    void KernelLdr_MapInitialIdentityMapping(KInitialPageTable *ttbr1_page_table, uintptr_t kernel_base, uintptr_t kernel_size, uintptr_t page_tables_base, uintptr_t page_tables_size, InitialPageAllocator *allocator);
 +
 +
<pre>
 +
// TODO: Fill this out with pseudocode.
 
</pre>
 
</pre>