aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2019-10-15 15:44:41 +0200
committervetch <vetch97@gmail.com>2019-10-15 15:44:41 +0200
commite20129720adb334f46e329bfbe7090ee7188caac (patch)
tree4a8fab2da509d5e870ddbf64cf6521c110b7e0cf /Makefile
parent8de2ff74293a583fbf4cd9a87a8bf29c0c93d5a8 (diff)
parent0921cc609a1b411d2b6769a327fa11a675ac3d3a (diff)
downloadrpi-MMU-example-e20129720adb334f46e329bfbe7090ee7188caac.tar.gz
rpi-MMU-example-e20129720adb334f46e329bfbe7090ee7188caac.zip
Merge branch 'bob' into alice
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 29 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c296d1c..67aa3e0 100644
--- a/Makefile
+++ b/Makefile
@@ -17,13 +17,40 @@ kernel.elf : boot.o kernel.o uart.o
kernel7.img : kernel.elf
arm-none-eabi-objcopy $^ -O binary $@
+loader_stage2.o : loader_stage2.c
+ arm-none-eabi-gcc $(CFLAGS) -c $^ -o $@
+
+loader_stage2.elf : loader_stage2.o uart.o
+ arm-none-eabi-gcc -T loader_stage2.ld -o $@ -ffreestanding -O2 -nostdlib $^ -lgcc
+
+loader_stage2.img : loader_stage2.elf
+ arm-none-eabi-objcopy $^ -O binary $@
+
+loader_stage2_embeddable.o : loader_stage2.img
+ arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm --rename-section .data=.rodata $^ $@
+
+loader_stage1.o : loader_stage1.c
+ arm-none-eabi-gcc $(CFLAGS) -c $^ -o $@
+
+loader.elf : boot.o loader_stage1.o loader_stage2_embeddable.o
+ arm-none-eabi-gcc -T loader_stage1.ld -o $@ -ffreestanding -O2 -nostdlib $^ -lgcc
+
+loader.img : loader.elf
+ arm-none-eabi-objcopy $^ -O binary $@
+
qemu-elf : kernel.elf
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
-qemu-bin : kernel7.img
+qemu-bin : loader.img kernel7.img pipe_image
+ ./pipe_image | qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $<
+
+qemu-loader : loader.img
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
+pipe_image : pipe_image.c
+ gcc -Wall -std=gnu99 -O3 $^ -o $@
+
clean :
- -rm kernel7.img kernel.elf boot.o kernel.o uart.o
+ -rm *.img *.elf *.o pipe_image
.PHONY: all qemu-elf qemu-bin clean