From 50742d6dc7ff563e8283f6b3e2aab08e3970c0fa Mon Sep 17 00:00:00 2001 From: Joursoir Date: Fri, 27 Aug 2021 17:54:05 +0000 Subject: x86/boot: add makefile --- arch/x86/boot/Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 arch/x86/boot/Makefile diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile new file mode 100644 index 0000000..0501ab3 --- /dev/null +++ b/arch/x86/boot/Makefile @@ -0,0 +1,27 @@ +# If you want run this makefile immediately, then set environment +# variables (CC, LD, AS, OBJDUMP) to path of your cross-compiler. +# +# The best way to compile bootsect.bin is to run the corresponding +# target in the main Makefile, which is in the root of the +# project (.../path/to/os/Makefile) + +BOOTBIN = bootsect.bin + +.PHONY: all objdump clean + +all: $(BOOTBIN) + +$(BOOTBIN): bootsect.o + $(CC) -T linker.ld -o $(BOOTBIN) \ + -ffreestanding -nostdlib \ + $^ -lgcc + +bootsect.o: bootsect.s + $(AS) $< -o $@ + +objdump: + $(OBJDUMP) -D -m i386 -b binary \ + --adjust-vma=0x7c00 -Maddr16,data16 $(BOOTBIN) + +clean: + rm -rf bootsect.o $(BOOTBIN) -- cgit v1.2.3-18-g5258