-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathboot.S
More file actions
40 lines (33 loc) · 670 Bytes
/
boot.S
File metadata and controls
40 lines (33 loc) · 670 Bytes
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
35
36
37
38
39
40
// Place in the boot section
.section ".text.boot"
// Life starts here
.globl _start
// r15 -> should begin execution at 0x8000.
// r0 -> 0x00000000
// r1 -> 0x00000C42
// r2 -> 0x00000100 - start of ATAGS
// preserve these registers as argument for the kernel
_start:
// Set up the stack.
mov sp, #0x8000
// Zero the bss.
ldr r4, =__bss_start
ldr r9, =__bss_end
mov r5, #0
mov r6, #0
mov r7, #0
mov r8, #0
1:
// Clear four words at a time
stmia r4!, {r5-r8}
// If we are still below bss_end, loop.
cmp r4, r9
blo 1b
// Call the kernel
mov fp, #0
ldr r3, =main
blx r3
// Halt if the mainline returns
halt:
wfe
b halt