0
|
1 #include "arm.h"
|
|
2 #include "memlayout.h"
|
|
3
|
|
4 .text
|
|
5 .code 32
|
|
6
|
|
7 .global _start
|
|
8
|
|
9 _start:
|
|
10 # clear the entry bss section, the svc stack, and kernel page table
|
|
11 LDR r1, =edata_entry
|
|
12 LDR r2, =end_entry
|
|
13 MOV r3, #0x00
|
|
14
|
|
15 1:
|
|
16 CMP r1, r2
|
13
|
17 # STMLTIA r1!, {r3}
|
|
18 STMIALT r1!, {r3}
|
0
|
19 BLT 1b
|
|
20
|
|
21 # initialize stack pointers for svc modes
|
|
22 MSR CPSR_cxsf, #(SVC_MODE|NO_INT)
|
|
23 LDR sp, =svc_stktop
|
|
24
|
|
25 BL start
|
|
26 B .
|
|
27
|
|
28 # during startup, kernel stack uses user address, now switch it to kernel addr
|
|
29 .global jump_stack
|
|
30 jump_stack:
|
|
31 MOV r0, sp
|
|
32 ADD r0, r0, #KERNBASE
|
|
33 MOV sp, r0
|
11
|
34 MOV pc, lr
|