Specifications

A Minimal PowerPCª Boot Sequence for 25
Executing Compiled C Programs
Source Files
cont1:
lwzx r5,0,r4
stwx r5,0,r3
lwzx r8,0,r3
cmp 0,0,r8,r5
bne error
addi r4,r4,4
addi r3,r3,4
cmp 0,0,r3,r7
ble cont1
// This clear_bss code can be removed if youÕre sure you never
// depend on unitialized data being 0.
clear_bss:
addis r4,0,_bss_start@h
ori r4,r4,_bss_start@l
addis r7,0,_bss_end@h
ori r7,r7,_bss_end@l
addis r5,0,0x0000
cont2:
stwx r5,0,r4
addi r4,r4,4
cmp 0,0,r4,r7
ble cont2
sync
// return from relocate_image
blr
//---------------------------------------------------------------------------
// Function: setup_bats
//
// Here is the code that handles setting up the BAT registers.
// IBAT0L and such must be defined in the header file
//
// The MMU should be turned off before this code is run and
// re-enabled afterward
//---------------------------------------------------------------------------