- Implement beginnings of Ramdisk Port Driver. Planning compatibility with ISO, SDI...
[reactos.git] / reactos / boot / freeldr / freeldr / arch / arm / boot.s
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/freeldr/arch/arm/boot.s
5 * PURPOSE: Implements the entry point for ARM machines
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 .title "ARM FreeLDR Entry Point"
10 .include "ntoskrnl/include/internal/arm/kxarm.h"
11 .include "ntoskrnl/include/internal/arm/ksarm.h"
12
13 .section startup
14 NESTED_ENTRY _start
15 PROLOG_END _start
16
17 //
18 // C entrypoint
19 //
20 ldr lr, L_ArmInit
21
22 //
23 // Turn off FIQs and IRQs
24 // FreeLDR runs without interrupts, and without paging, just like on x86
25 //
26 mrs r1, cpsr
27 orr r1, r1, #CPSR_IRQ_DISABLE | CPSR_FIQ_DISABLE
28 msr cpsr, r1
29
30 //
31 // Turn off caches and the MMU
32 //
33 mrc p15, 0, r1, c1, c0, 0
34 bic r1, r1, #C1_DCACHE_CONTROL
35 bic r1, r1, #C1_ICACHE_CONTROL
36 bic r1, r1, #C1_MMU_CONTROL
37 mcr p15, 0, r1, c1, c0, 0
38
39 //
40 // Flush everything away
41 //
42 mov r1, #0
43 mcr p15, 0, r1, c7, c7, 0
44
45 //
46 // Okay, now give us a stack
47 //
48 ldr sp, L_BootStackEnd
49
50 //
51 // Go ahead and call the C initialization code
52 // r0 contains the ARM_BOARD_CONFIGURATION_DATA structure
53 //
54 bx lr
55 ENTRY_END _start
56
57 L_BootStackEnd:
58 .long BootStackEnd
59
60 L_ArmInit:
61 .long ArmInit
62
63 .align 4
64 .global BootStack
65 BootStack:
66 .space 0x4000
67 BootStackEnd:
68 .long 0
69
70 .section pagedata
71 .global TranslationTableStart
72 TranslationTableStart:
73
74 .global ArmTranslationTable
75 ArmTranslationTable:
76 .space 0x4000 // 0x00000000->0xFFFFFFFF
77
78 .global BootTranslationTable
79 BootTranslationTable:
80 .space 0x0400 // 0x00000000->0x800FFFFF
81 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
82 .space 0x0400 // 0x00100000->0x801FFFFF
83 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
84 .space 0x0400 // 0x00200000->0x802FFFFF
85 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
86 .space 0x0400 // 0x00300000->0x803FFFFF
87 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
88 .space 0x0400 // 0x00400000->0x804FFFFF
89 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
90 .space 0x0400 // 0x00500000->0x805FFFFF
91 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
92 .space 0x0400 // 0x00600000->0x806FFFFF
93 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
94 .space 0x0400 // 0x00700000->0x807FFFFF
95 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
96
97 .global KernelTranslationTable
98 KernelTranslationTable:
99 .space 0x0400 // 0x00800000->0x808FFFFF
100 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
101 .space 0x0400 // 0x00900000->0x809FFFFF
102 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
103 .space 0x0400 // 0x00A00000->0x80AFFFFF
104 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
105 .space 0x0400 // 0x00B00000->0x80BFFFFF
106 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
107 .space 0x0400 // 0x00C00000->0x80CFFFFF
108 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
109 .space 0x0400 // 0x00D00000->0x80DFFFFF
110 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
111
112 .global FlatMapTranslationTable
113 FlatMapTranslationTable:
114 .space 0x0400 // 0xYYYYYYYY->0xC00FFFFF
115 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
116 .space 0x0400 // 0xYYYYYYYY->0xC01FFFFF
117 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
118 .space 0x0400 // 0xYYYYYYYY->0xC02FFFFF
119 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
120 .space 0x0400 // 0xYYYYYYYY->0xC03FFFFF
121 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
122 .space 0x0400 // 0xYYYYYYYY->0xC04FFFFF
123 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
124 .space 0x0400 // 0xYYYYYYYY->0xC05FFFFF
125 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
126 .space 0x0400 // 0xYYYYYYYY->0xC06FFFFF
127 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
128 .space 0x0400 // 0xYYYYYYYY->0xC07FFFFF
129 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
130 .space 0x0400 // 0xYYYYYYYY->0xC08FFFFF
131 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
132 .space 0x0400 // 0xYYYYYYYY->0xC09FFFFF
133 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
134 .space 0x0400 // 0xYYYYYYYY->0xC0AFFFFF
135 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
136 .space 0x0400 // 0xYYYYYYYY->0xC0BFFFFF
137 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
138 .space 0x0400 // 0xYYYYYYYY->0xC0CFFFFF
139 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
140 .space 0x0400 // 0xYYYYYYYY->0xC0DFFFFF
141 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
142 .space 0x0400 // 0xYYYYYYYY->0xC0EFFFFF
143 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
144 .space 0x0400 // 0xYYYYYYYY->0xC0FFFFFF
145 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
146
147 .global MasterTranslationTable
148 MasterTranslationTable:
149 .space 0x0400 // 0xYYYYYYYY->0xC10FFFFF
150 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
151
152 .global HyperSpaceTranslationTable
153 HyperSpaceTranslationTable:
154 .space 0x0400 // 0xYYYYYYYY->0xC10FFFFF
155 .space 0x0C00 // PADDING FOR 4KB GRANULARITY
156
157 .global TranslationTableEnd
158 TranslationTableEnd: