# tashaboot # # build: make CROSS=aarch64-linux-gnu- # run: make run (qemu virt, semihosting, Image on the host) # # arm64 only. the architecture contract comes from the ARM ARM # (DDI 0487), the payload protocol from the kernel booting docs. CROSS ?= aarch64-linux-gnu- CC := $(CROSS)gcc LD := $(CROSS)ld OBJCOPY := $(CROSS)objcopy CFLAGS := -nostdlib -ffreestanding -mgeneral-regs-only \ -fno-builtin -fno-stack-protector -fno-pie -no-pie \ -Wall -Werror -O2 -DTB_ENABLE_MMU \ -Iinclude -Iarch/arm64/include LDFLAGS := -T arch/arm64/kernel/tashaboot.lds OBJS := arch/arm64/kernel/start.o \ arch/arm64/kernel/exceptions.o \ arch/arm64/kernel/halt.o \ arch/arm64/kernel/boot.o \ arch/arm64/lib/cache.o \ arch/arm64/lib/semihosting.o \ arch/arm64/lib/mmu.o \ arch/arm64/lib/psci.o \ arch/arm64/lib/system.o \ arch/arm64/lib/cache_va.o \ arch/arm64/lib/timer.o \ common/main.o common/console.o common/image.o common/load.o \ common/mmutest.o common/dtb_patch.o \ lib/printf.o lib/itoa.o lib/semihosting.o \ $(patsubst %.c,%.o,$(wildcard lib/string/*.c)) all: build/tashaboot.bin build/tashaboot.elf: $(OBJS) arch/arm64/kernel/tashaboot.lds mkdir -p build $(LD) $(LDFLAGS) -o $@ $(OBJS) build/tashaboot.bin: build/tashaboot.elf $(OBJCOPY) -O binary $< $@ %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< %.o: %.S $(CC) $(CFLAGS) -c -o $@ $< run: all qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -no-reboot \ -semihosting -kernel build/tashaboot.bin clean: rm -rf build $(OBJS) .PHONY: all run clean