Subversion Repositories HelenOS-historic

Rev

Rev 1166 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1166 Rev 1395
Line 104... Line 104...
104
jump_to_kernel:
104
jump_to_kernel:
105
	
105
	
106
	# r3 = bootinfo (pa)
106
	# r3 = bootinfo (pa)
107
	# r4 = bootinfo_size
107
	# r4 = bootinfo_size
108
	# r5 = trans (pa)
108
	# r5 = trans (pa)
109
	# r6 = kernel size
109
	# r6 = bytes to copy
110
	# r7 = framebuffer (pa)
-
 
111
	# r8 = real_mode (pa)
110
	# r7 = real_mode (pa)
112
	
111
	
-
 
112
	# disable interrupts
-
 
113
	
-
 
114
	mfmsr r31
-
 
115
	rlwinm r31, r31, 0, 17, 15
-
 
116
	mtmsr r31
-
 
117
	
-
 
118
	# set real_mode meeting point address
-
 
119
	
113
	mtspr srr0, r8
120
	mtspr srr0, r7
114
	
121
	
115
	# jumps to real_mode
122
	# jumps to real_mode
116
	
123
	
117
	mfmsr r31
124
	mfmsr r31
118
	lis r30, ~0@h
125
	lis r30, ~0@h
Line 122... Line 129...
122
	
129
	
123
	sync
130
	sync
124
	isync
131
	isync
125
	rfid
132
	rfid
126
 
133
 
127
.section REALMODE
134
.section REALMODE, "ax"
128
.align PAGE_WIDTH
135
.align PAGE_WIDTH
129
.global real_mode
136
.global real_mode
130
 
137
 
131
real_mode:
138
real_mode:
132
	
139
	
133
	# copy kernel to proper location
140
	# copy kernel to proper location
134
	#
141
	#
135
	# r5 = trans (pa)
142
	# r5 = trans (pa)
136
	# r6 = kernel size
143
	# r6 = bytes to copy
137
	# r7 = framebuffer (pa)
-
 
138
	
144
	
139
	li r31, PAGE_SIZE >> 2
145
	li r31, PAGE_SIZE >> 2
140
	li r30, 0
146
	li r30, 0
141
	
147
	
142
	page_copy:
148
	page_copy:
Line 166... Line 172...
166
		addi r5, r5, 4
172
		addi r5, r5, 4
167
		b page_copy
173
		b page_copy
168
	
174
	
169
	copy_end:
175
	copy_end:
170
	
176
	
171
	# invalidate segment registers
177
	# initially fill segment registers
172
 
178
 
173
	li r31, 16
179
	li r31, 16
174
	mtctr r31
180
	mtctr r31
175
	li r31, 0
181
	li r31, 0
176
	li r30, 0
182
	li r30, 0x2000
177
 
183
 
178
	seg_fill:
184
	seg_fill:
179
	
185
	
180
		mtsrin r30, r31
186
		mtsrin r30, r31
-
 
187
		addi r30, r30, 0x111
181
		addis r31, r31, 0x1000    # move to next SR
188
		addis r31, r31, 0x1000    # move to next SR
182
		
189
		
183
		bdnz seg_fill
190
		bdnz seg_fill
184
	
191
	
185
	# invalidate block address translation registers
-
 
186
	
-
 
187
	mtspr ibat0u, r30
-
 
188
	mtspr ibat0l, r30
-
 
189
	
-
 
190
	mtspr ibat1u, r30
-
 
191
	mtspr ibat1l, r30
-
 
192
	
-
 
193
	mtspr ibat2u, r30
-
 
194
	mtspr ibat2l, r30
-
 
195
	
-
 
196
	mtspr ibat3u, r30
-
 
197
	mtspr ibat3l, r30
-
 
198
	
-
 
199
	mtspr dbat0u, r30
-
 
200
	mtspr dbat0l, r30
-
 
201
	
-
 
202
	mtspr dbat1u, r30
-
 
203
	mtspr dbat1l, r30
-
 
204
	
-
 
205
	mtspr dbat2u, r30
-
 
206
	mtspr dbat2l, r30
-
 
207
	
-
 
208
	mtspr dbat3u, r30
-
 
209
	mtspr dbat3l, r30
-
 
210
	
-
 
211
	# create identity mapping
-
 
212
	
-
 
213
	# FIXME: map exactly the size of RAM
-
 
214
	
-
 
215
	lis r31, 0x8000
-
 
216
	ori r31, r31, 0x0ffe
-
 
217
	
-
 
218
	lis r30, 0x0000
-
 
219
	ori r30, r30, 0x0002
-
 
220
	
-
 
221
	mtspr ibat0u, r31
-
 
222
	mtspr ibat0l, r30
-
 
223
	
-
 
224
	mtspr dbat0u, r31
-
 
225
	mtspr dbat0l, r30
-
 
226
	
-
 
227
	# FIXME: temporal framebuffer mapping
-
 
228
	
-
 
229
	lis r31, 0xf000
-
 
230
	ori r31, r31, 0x0ffe
-
 
231
	
-
 
232
	mr r30, r7
-
 
233
	ori r30, r30, 0x0002
-
 
234
	
-
 
235
	mtspr dbat1u, r31
-
 
236
	mtspr dbat1l, r30
-
 
237
	
-
 
238
	tlbia
192
	tlbia
-
 
193
	tlbsync
239
	
194
	
240
	# start the kernel
195
	# start the kernel
241
	#
196
	#
242
	# r3 = bootinfo (pa)
197
	# r3 = bootinfo (pa)
243
	
198