diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-10-11 11:59:59 +0200 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-10-11 11:59:59 +0200 |
commit | 23e6ba8ef9f9967e0c15c6245fd92cdd5f60fc55 (patch) | |
tree | e7c51792a025b1d9a71eba5aa0a85128515b43d4 /Makefile | |
parent | 50814e0cbd58590a7e367b604afa8c06271a273a (diff) | |
download | rpi-MMU-example-23e6ba8ef9f9967e0c15c6245fd92cdd5f60fc55.tar.gz rpi-MMU-example-23e6ba8ef9f9967e0c15c6245fd92cdd5f60fc55.zip |
add initial bootloader work
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -17,13 +17,37 @@ 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 uart.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-system-arm -m 256 -M raspi2 -serial stdio -kernel $^ +qemu-loader : loader.img + qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^ + clean : - -rm kernel7.img kernel.elf boot.o kernel.o uart.o + -rm *.img *.elf *.o .PHONY: all qemu-elf qemu-bin clean |