From 0589f230c45e13a92fa903e14a645aa58a78df25 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 8 Jul 2014 17:45:50 +0200 Subject: minor improvements of the Makefile --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 872c4e3..c759cce 100644 --- a/Makefile +++ b/Makefile @@ -5,36 +5,50 @@ # # ##################### +#TODO: use implicit rules !! +#lets use the size of a 1.44 floppy for a start for our boot img IMAGE_SIZE=1474560 +#final image all: FoolOS.img +#assembling of final image FoolOS.img: mbr.bin kernel.bin fill.bin cat $^ | head -c $(IMAGE_SIZE) > $@ +#some data just to fill up to the target image_size fill.bin: boot/fill.asm nasm -f bin $^ -o $@ +#this is the MASTER BOOT RECORD, where our bootloader lives mbr.bin: boot/mbr.asm nasm -f bin $^ -o $@ kernel_entry.o: boot/kernel_entry.asm nasm -f elf $^ -o $@ + kernel.o: kernel/kernel.c kernel/console.h gcc -ffreestanding -m32 -o $@ -c $< -fno-asynchronous-unwind-tables -O0 console.o: kernel/console.c kernel/console.h gcc -ffreestanding -m32 -o $@ -c $< -fno-asynchronous-unwind-tables -O0 + + kernel.bin: kernel_entry.o kernel.o console.o ld -o $@ -Ttext 0x1000 --oformat binary -melf_i386 $^ -O0 -dump: + +# dump from vbox +dump: FoolOS.img vboxmanage debugvm FoolOs dumpguestcore --filename dump.elf xxd dump.elf > dump.xxd +run: FoolOS.img + bochs + clean: -rm *.bin *.o *.img dump.elf dump.xxd -- cgit v1.2.3