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)
23 @ mrc p15, 0, r0, c1, c0, 0
25 @ orr r0, r0, #1 << 23
26 @ mcr p15, 0, r0, c1, c0, 0
28 ldr sp, =stack+0x10000 @ Set up stack
31 1: b 1b @ Infinite loop
35 .comm stack, 0x10000 @ ; 64KiB Stack
43 .long 0x00000002 @ Identity map the first 4 MiB
47 .long 0x00000002 @ Identity map the first 4 MiB
51 .rept 0xF00 - 0x800 - 4
54 .long hwmap_table_0 + 0x000 - KERNEL_BASE + 1
55 .long hwmap_table_0 + 0x400 - KERNEL_BASE + 1
56 .long hwmap_table_0 + 0x800 - KERNEL_BASE + 1
57 .long hwmap_table_0 + 0xC00 - KERNEL_BASE + 1
58 .rept 0xFF8 - 0xF00 - 4
61 .long kernel_table1_map + 0x000 - KERNEL_BASE + 1
62 .long kernel_table1_map + 0x400 - KERNEL_BASE + 1
63 .long kernel_table1_map + 0x800 - KERNEL_BASE + 1
64 .long kernel_table1_map + 0xC00 - KERNEL_BASE + 1
65 .long kernel_table0 - KERNEL_BASE + 2 @ Sure it maps too much, but fuck that
66 .rept 0x1000 - 0xFF8 - 5
70 .globl kernel_table1_map
75 .long hwmap_table_0 - KERNEL_BASE + (1 << 4) + 3
76 .rept 0xFF8/4 - 0xF00/4 - 1
79 .long kernel_table1_map - KERNEL_BASE + (1 << 4) + 3
84 .long 0x16000000 + (1 << 4) + 3 @ Serial Port