Mercurial > hg > CbC > CbC_xv6
comparison src/entry-osx.S @ 3:0bbeb1a284e2
fix entry asmcode
author | tobaru |
---|---|
date | Fri, 04 Aug 2017 20:53:15 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1:cc14476ac479 | 3:0bbeb1a284e2 |
---|---|
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 | |
17 STMIALT r1!, {r3} | |
18 BLT 1b | |
19 | |
20 # initialize stack pointers for svc modes | |
21 MSR CPSR_cxsf, #(SVC_MODE|NO_INT) | |
22 LDR sp, =svc_stktop | |
23 | |
24 BL start | |
25 B . | |
26 | |
27 # during startup, kernel stack uses user address, now switch it to kernel addr | |
28 .global jump_stack | |
29 jump_stack: | |
30 MOV r0, sp | |
31 ADD r0, r0, #KERNBASE | |
32 MOV sp, r0 | |
33 MOV pc, lr |