mmu: Add initial implementation of identity mapping
This commit is contained in:
44
boot/start.S
44
boot/start.S
@ -9,9 +9,43 @@ interrupt_vector_table:
|
||||
b .
|
||||
|
||||
.comm stack, 0x10000 @ Reserve 64k stack in the BSS
|
||||
_start:
|
||||
.globl _start
|
||||
ldr sp, =stack+0x10000 @ Set up the stack
|
||||
bl main @ Jump to the main function
|
||||
.globl start
|
||||
|
||||
start:
|
||||
ldr r0, tt_base
|
||||
mcr p15, 0, r0, c2, c0, 0 /* TTBR0 */
|
||||
|
||||
/* Setup page table entries for the page table and kernel (domain 0) */
|
||||
ldr r0, tt_tt_addr
|
||||
ldr r1, tt_tt_val
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, kernel_tt_addr
|
||||
ldr r1, kernel_tt_val
|
||||
str r1, [r0]
|
||||
|
||||
/* Set access permissions for domain 0 to "Manager" */
|
||||
mov r0, #0x3
|
||||
mcr p15, 0, r0, c3, c0, 0 /* DACR */
|
||||
|
||||
/* Enable the MMU */
|
||||
mrc p15, 0, r0, c1, c0, 0 /* SCTLR */
|
||||
orr r0, r0, #0x1
|
||||
mcr p15, 0, r0, c1, c0, 0 /* SCTLR */
|
||||
|
||||
ldr sp, =stack+0x10000 @ Set up the stack
|
||||
bl main @ Jump to the main function
|
||||
|
||||
1:
|
||||
b 1b @ Halt
|
||||
b 1b @ Halt
|
||||
|
||||
tt_base:
|
||||
.word 0x80000000
|
||||
tt_tt_addr:
|
||||
.word 0x80002000
|
||||
tt_tt_val:
|
||||
.word 0x80000c02 /* ...c02 means read/write at any priviledge level, and that it's a section w/o PXN bit set */
|
||||
kernel_tt_addr:
|
||||
.word 0x80002004
|
||||
kernel_tt_val:
|
||||
.word 0x80100c02
|
||||
|
Reference in New Issue
Block a user