Remove the need to relocate freeldr. We now use it in-place as stored in
[reactos.git] / reactos / boot / freeldr / bootsect / ofwboot.s
1 .section .text
2
3 _start:
4 .long 0xe00000 + 12
5 .long 0
6 .long 0
7
8 .globl _begin
9 _begin:
10 sync
11 isync
12
13 lis %r1,stack@ha
14 addi %r1,%r1,stack@l
15 addi %r1,%r1,16384 - 0x10
16
17 /* Store ofw call addr */
18 mr %r21,%r5
19 lis %r10,0xe00000@ha
20 stw %r5,ofw_call_addr - _start@l(%r10)
21
22 lis %r3,0xe00000@ha
23 addi %r3,%r3,freeldr_banner - _start
24
25 bl ofw_print_string
26 bl ofw_print_eol
27 bl zero_registers
28
29 /* Zero CTR */
30 mtcr %r31
31
32 lis %r3,0xe17000@ha
33 addi %r3,%r3,0xe17000@l
34
35 mtlr %r3
36
37 lis %r3,call_ofw@ha
38 addi %r3,%r3,call_ofw - _start
39
40 b call_freeldr
41
42 zero_registers:
43 xor %r2,%r2,%r2
44 mr %r0,%r2
45 mr %r3,%r2
46
47 mr %r4,%r2
48 mr %r5,%r2
49 mr %r6,%r2
50 mr %r7,%r2
51
52 mr %r8,%r2
53 mr %r9,%r2
54 mr %r10,%r2
55 mr %r11,%r2
56
57 mr %r12,%r2
58 mr %r13,%r2
59 mr %r14,%r2
60 mr %r15,%r2
61
62 mr %r12,%r2
63 mr %r13,%r2
64 mr %r14,%r2
65 mr %r15,%r2
66
67 mr %r16,%r2
68 mr %r17,%r2
69 mr %r18,%r2
70 mr %r19,%r2
71
72 mr %r20,%r2
73 mr %r21,%r2
74 mr %r22,%r2
75 mr %r23,%r2
76
77 mr %r24,%r2
78 mr %r25,%r2
79 mr %r26,%r2
80 mr %r27,%r2
81
82 mr %r28,%r2
83 mr %r29,%r2
84 mr %r30,%r2
85 mr %r31,%r2
86
87 blr
88
89 .org 0x1000
90 freeldr_banner:
91 .ascii "ReactOS OpenFirmware Boot Program\r\n\0"
92
93 freeldr_halt:
94 .ascii "ReactOS OpenFirmware Boot Program Halting\r\n\0"
95
96 ofw_memory_size:
97 .long 0
98 .long 0
99 .long 0
100 .long 0
101
102 .org 0x2000
103 stack:
104 .space 0x4000
105