Mercurial > lcfOS
comparison experiments/qemu_vexpress_a9/startup.s @ 406:b1daa462ee17
Made kernel run again
author | Windel Bouwman |
---|---|
date | Fri, 20 Feb 2015 14:25:35 +0100 |
parents | 34ac19044b8a |
children |
comparison
equal
deleted
inserted
replaced
405:f381cea07fec | 406:b1daa462ee17 |
---|---|
5 _Reset: | 5 _Reset: |
6 | 6 |
7 _start: | 7 _start: |
8 LDR sp, =stack_top | 8 LDR sp, =stack_top |
9 | 9 |
10 ldr r2, =0x10009000 | 10 ldr r2, =0x10009000 |
11 | 11 mov r1, #'1' |
12 mov r1, #'1' | 12 str r1, [r2] |
13 str r1, [r2] | |
14 | 13 |
15 // Load TTBR0 and TTBR1 | 14 // Load TTBR0 and TTBR1 |
16 ldr r0, =kernel_table0 | 15 ldr r0, =kernel_table0 |
17 mcr p15, 0, r0, c2, c0, 1 | 16 mcr p15, 0, r0, c2, c0, 1 |
18 mcr p15, 0, r0, c2, c0, 0 | 17 mcr p15, 0, r0, c2, c0, 0 |
19 | 18 |
20 // Domain 0: | 19 // Domain 0: |
21 mov r0, #3 | 20 mov r0, #3 |
22 mcr p15, 0, r0, c3, c0, 0 | 21 mcr p15, 0, r0, c3, c0, 0 |
23 | 22 |
40 Maybe the kernel is loaded at 0x60000000, so we need to map that to first | 39 Maybe the kernel is loaded at 0x60000000, so we need to map that to first |
41 megabyte also... | 40 megabyte also... |
42 */ | 41 */ |
43 | 42 |
44 kernel_table0: | 43 kernel_table0: |
45 .long 0x00000000 + 0x402 // 0x00000000 # ; Identity map first 1 MB | 44 .long 0x00000402 // 0x00000000 # ; Identity map first 1 MB |
46 .long 0x10000000 + 0x402 // 0x00100000 # ; second mb mapping to peripherals | 45 .long 0x10000402 // 0x00100000 # ; second mb mapping to peripherals |
47 | |
48 .rept 0x600 - 2 | 46 .rept 0x600 - 2 |
49 .long 0x0 | 47 .long 0x0 |
50 .endr | 48 .endr |
51 .long 0x00000402 // 0x60000000 maps 1 MB to first MB | 49 .long 0x00000402 // 0x60000000 maps 1 MB to first MB |
52 .rept 0x1000 - 0x601 | 50 .rept 0x1000 - 0x601 |