blob: ae56387a6766311f92c3b6dbc58c677e292a9452 (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// armv7 mode
// Entry point for the kernel.
// r15 -> should begin execution at 0x8000.
// r0 -> 0x00000000
// r1 -> 0x00000C42
// r2 -> 0x00000100 - start of ATAGS
// preserve these registers as argument for kernel_main
.globl _boot // make entry point label global
_boot:
// Shut off extra cores
mrc p15, 0, r5, c0, c0, 5
and r5, r5, #3
cmp r5, #0
bne halt
// go to system mode
cps #0b11111
isb
// Setup the stack.
// It shall be directly below our kernel image
ldr r5, =__start
mov sp, r5
// Call kernel_main
ldr r3, =kernel_main
bx r3
// halt
halt:
wfe
b halt
|