aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-28 18:09:09 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-28 18:09:09 +0100
commitf7ddd1a356f58298d703b11e862d3d6127e67080 (patch)
tree92f681646a569dfbcdc8a4df277ee48da4e46868 /Makefile
parent6321cd922cb665ca5bfb9bc2025701b07c076894 (diff)
downloadrpi-MMU-example-f7ddd1a356f58298d703b11e862d3d6127e67080.tar.gz
rpi-MMU-example-f7ddd1a356f58298d703b11e862d3d6127e67080.zip
rewrite the stage 1 of bootloader in a more compact and (mostly) load-addr-independent way
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 92d200f..29efa86 100644
--- a/Makefile
+++ b/Makefile
@@ -25,8 +25,14 @@ PL_0_test.elf : PL0_test.o uart.o
kernel.elf : boot.o kernel.o uart.o demo_functionality.o paging.o interrupt_vector.o interrupts.o ramfs_embeddable.o ramfs.o
arm-none-eabi-gcc -T linker.ld -o $@ $(ELFFLAGS) $^
-loader.elf : boot.o loader_stage1.o loader_stage2.o uart.o
- arm-none-eabi-gcc -T loader_linker.ld -o $@ $(ELFFLAGS) $^
+loader_stage2.elf : loader_stage2.o uart.o
+ arm-none-eabi-gcc -T loader_stage2_linker.ld -o $@ $(ELFFLAGS) $^
+
+loader_stage1.o : loader_stage1.S loader_stage2.img
+ arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
+
+loader.elf : loader_stage1.o
+ arm-none-eabi-gcc -T loader_stage1_linker.ld -o $@ $(ELFFLAGS) $^
loader.img : loader.elf
arm-none-eabi-objcopy $^ -O binary $@
@@ -36,7 +42,7 @@ loader.img : loader.elf
qemu-elf : kernel.elf
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
-qemu-bin : loader.elf kernel.img pipe_image
+qemu-bin : loader.img kernel.img pipe_image
./pipe_image --stdout | qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $<
run-on-rpi : kernel.img pipe_image