2 Copyright C 2003, The AROS Development Team. All rights reserved.
5 Desc: Bootstrap code for AROS/PPC on PReP
10 This is the startup code for PReP (PowerPC Reference Platform) machines.
11 It may be loaded by Firmware into ram (at almost any possible location).
14 The older PReP machines have the DMA area limited to first 16MB of system
15 memory. Therefore it is reasonable, to place the kernel at the end of DMA
16 RAM. Both areas may be then easily separated.
18 Currently, the kernel should be located at 15th megabyte of RAM but it may
27 .type startup,@function
29 /* Update the Link Pointer by jumping to the next instruction */
30 /* this way we know exactly where the code is loaded */
36 .string "PPC Core 1.0"
39 1: mflr r20 /* Extract the laod address */
42 mr r30,r3 /* Residual/boot data */
43 mr r31,r5 /* OFW pointer */
49 /* Enable FPU and chose the 0xFFFxxxxx prefix for exception table */
56 lis r4,startup@h /* Calculate the size of kernel */
62 sub r21,r5,r4 /* r21 contains the size of kernel in words */
68 /* Is the required address same as the load address? */
73 addi r3,r20,-4 /* r3 contains the target - 4 */
74 addi r4,r4,-4 /* r4 contains the source - 4 */
75 mtctr r21 /* length of data to move */
80 /* Jump to the relocated code */
82 ori r5,r5,address_ok@l
91 Setup the stack pointer. It will start just a little bit before the
92 kernel. We may relocate it later.
94 I know this is a bit tricky hack, but I really want to avoid any .data
95 or .bss sections in kernel.
104 Oh my.... if it happend at all, that we have some .bbs data, I should clear
105 it now. Other possibility would be to halt the kernel, display the message
106 that the kernel is f**ked and restart ;)
123 /* Clear all BAT registers as we don't need any memory translation */
142 /* Setup the segment registers - Linear memory area 0x00000000 - 0xffffffff */
153 mr r3,r20 /* load address */
154 mr r4,r22 /* Real kernel address */
155 mr r5,r21 /* Size of kernel in words */
156 mr r6,r30 /* Residual/boot data */
157 mr r7,r31 /* OFW pointer */
158 mr r8,r29 /* Original MSR for OFW interface */
159 b cstart /* Jump to the C-part of kernel */
163 .type com1_putc,@function