Subversion Repositories HelenOS-historic

Rev

Rev 1075 | Rev 1146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1075 Rev 1131
Line 106... Line 106...
106
	b 1b
106
	b 1b
107
 
107
 
108
 
108
 
109
jump_to_kernel:
109
jump_to_kernel:
110
	
110
	
111
	# r3 = memmap (pa)
111
	# r3 = bootinfo (pa)
-
 
112
	# r4 = bootinfo_size
112
	# r4 = trans (pa)
113
	# r5 = trans (pa)
113
	# r5 = kernel size
114
	# r6 = kernel size
114
	# r6 = real_mode (pa)
115
	# r7 = real_mode (pa)
115
	
116
	
116
	mtspr srr0, r6
117
	mtspr srr0, r7
117
	
118
	
118
	# jumps to real_mode
119
	# jumps to real_mode
119
	
120
	
120
	mfmsr r31
121
	mfmsr r31
121
	lis r30, ~0@h
122
	lis r30, ~0@h
Line 130... Line 131...
130
 
131
 
131
real_mode:
132
real_mode:
132
	
133
	
133
	# copy kernel to proper location
134
	# copy kernel to proper location
134
	#
135
	#
135
	# r4 = trans (pa)
136
	# r5 = trans (pa)
136
	# r5 = kernel size
137
	# r6 = kernel size
137
	
138
	
138
	li r31, PAGE_SIZE >> 2
139
	li r31, PAGE_SIZE >> 2
139
	li r30, 0
140
	li r30, 0
140
	
141
	
141
	page_copy:
142
	page_copy:
142
		
143
		
143
		cmpwi r5, 0
144
		cmpwi r6, 0
144
		beq copy_end
145
		beq copy_end
145
		
146
		
146
		# copy page
147
		# copy page
147
		
148
		
148
		mtctr r31
149
		mtctr r31
149
		lwz r29, 0(r4)
150
		lwz r29, 0(r5)
150
		
151
		
151
		copy_loop:
152
		copy_loop:
152
			
153
			
153
			lwz r28, 0(r29)
154
			lwz r28, 0(r29)
154
			stw r28, 0(r30)
155
			stw r28, 0(r30)
155
			
156
			
156
			addi r29, r29, 4
157
			addi r29, r29, 4
157
			addi r30, r30, 4
158
			addi r30, r30, 4
158
			subi r5, r5, 4
159
			subi r6, r6, 4
159
			
160
			
160
			cmpwi r5, 0
161
			cmpwi r6, 0
161
			beq copy_end
162
			beq copy_end
162
			
163
			
163
			bdnz copy_loop
164
			bdnz copy_loop
164
		
165
		
165
		addi r4, r4, 4
166
		addi r5, r5, 4
166
		b page_copy
167
		b page_copy
167
	
168
	
168
	copy_end:
169
	copy_end:
169
	
170
	
170
	# invalidate segment registers
171
	# invalidate segment registers
Line 236... Line 237...
236
	
237
	
237
	tlbia
238
	tlbia
238
	
239
	
239
	# start the kernel
240
	# start the kernel
240
	#
241
	#
241
	# r3 = memmap (pa)
242
	# r3 = bootinfo (pa)
242
	
243
	
243
	lis r31, KERNEL_START_ADDR@ha
244
	lis r31, KERNEL_START_ADDR@ha
244
	addi r31, r31, KERNEL_START_ADDR@l
245
	addi r31, r31, KERNEL_START_ADDR@l
245
	
246
	
246
	mtspr srr0, r31
247
	mtspr srr0, r31