1 KERNEL_BASE = 0x80000000
4 interrupt_vector_table:
7 b SyscallHandler @ SWI instruction
16 ldr r0, =kernel_table0-KERNEL_BASE
17 mcr p15, 0, r0, c2, c0, 1 @ Set TTBR1 to r0
18 mcr p15, 0, r0, c2, c0, 0 @ Set TTBR0 to r0 too (for identity)
21 mcr p15, 0, r0, c2, c0, 2 @ Set TTCR to 1 (50/50 split)
24 mcr p15, 0, r0, c3, c0, 0 @ Set Domain 0 to Manager
26 mrc p15, 0, r0, c1, c0, 0
29 mcr p15, 0, r0, c1, c0, 0
31 ldr sp, =stack+0x10000 @ Set up stack
34 1: b 1b @ Infinite loop
38 .comm stack, 0x10000 @ ; 64KiB Stack
46 .long 0x00000002 @ Identity map the first 4 MiB
50 .long 0x00000002 @ Map first 4 MiB to 2GiB
54 .rept 0xF00 - 0x800 - 4
57 .long hwmap_table_0 + 0x000 - KERNEL_BASE + 1
58 .long hwmap_table_0 + 0x400 - KERNEL_BASE + 1
59 .long hwmap_table_0 + 0x800 - KERNEL_BASE + 1
60 .long hwmap_table_0 + 0xC00 - KERNEL_BASE + 1
61 .rept 0xFF8 - 0xF00 - 4
64 .long kernel_table1_map + 0x000 - KERNEL_BASE + 1
65 .long kernel_table1_map + 0x400 - KERNEL_BASE + 1
66 .long kernel_table1_map + 0x800 - KERNEL_BASE + 1
67 .long kernel_table1_map + 0xC00 - KERNEL_BASE + 1
68 .long kernel_table0 - KERNEL_BASE + 2 @ Sure it maps too much, but fuck that
69 .rept 0x1000 - 0xFF8 - 5
73 .globl kernel_table1_map
78 .long hwmap_table_0 - KERNEL_BASE + (1 << 4) + 3
79 .rept 0xFF8/4 - 0xF00/4 - 1
82 .long kernel_table1_map - KERNEL_BASE + (1 << 4) + 3
88 .long 0x10009000 + (1 << 4) + 3 @ UART0