//boot/trunk/arch/ppc32/loader/main.c |
---|
30,6 → 30,9 |
#include "printf.h" |
#include "ofw.h" |
#define KERNEL_LOAD_ADDRESS 0x800000 |
#define KERNEL_SIZE _binary_____________kernel_kernel_bin_size |
static void halt(void) |
{ |
while (1); |
37,9 → 40,9 |
void bootstrap(void) |
{ |
printf("\nHelenOS PPC Bootloader\nKernel size %d, load address %L\n", kernel_size, kernel_load_address); |
printf("\nHelenOS PPC Bootloader\nKernel size %d, load address %L\n", KERNEL_SIZE, KERNEL_LOAD_ADDRESS); |
void *addr = ofw_claim((void *) kernel_load_address, kernel_size, 1); |
void *addr = ofw_claim((void *) KERNEL_LOAD_ADDRESS, KERNEL_SIZE, 1); |
if (addr == NULL) { |
printf("Error: Unable to claim memory"); |
halt(); |
//boot/trunk/arch/ppc32/loader/main.h |
---|
29,8 → 29,8 |
#ifndef __MAIN_H__ |
#define __MAIN_H__ |
extern unsigned int kernel_size; |
extern void *kernel_load_address; |
extern unsigned int _binary_____________kernel_kernel_bin_size; |
extern void *_binary_____________kernel_kernel_bin_start; |
extern void bootstrap(void); |
#endif |
//boot/trunk/arch/ppc32/loader/Makefile |
---|
47,6 → 47,7 |
endif |
CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 |
DEFS = |
SOURCES = \ |
main.c \ |
56,12 → 57,24 |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
loader.bin: $(OBJECTS) |
$(LD) -no-check-sections -N -T _link.ld $(OBJECTS) -o $@ |
.PHONY: all clean depend |
all: ../image.boot |
-include Makefile.depend |
../image.boot: depend $(OBJECTS) kernel.o |
$(LD) -no-check-sections -N -T _link.ld $(OBJECTS) kernel.o -o $@ |
depend: |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f $(OBJECTS) loader.bin |
-rm -f $(OBJECTS) ../image.boot kernel.o Makefile.depend |
kernel.o: $(KERNEL) |
$(OBJCOPY) -I binary -O elf32-powerpc -B powerpc $(KERNEL) $@ |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |