summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 21 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 54aa45f..872c4e3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,12 @@
-# FoolOS Makefile
-#
-IMAGE_SIZE=4096
+ #####################
+ # #
+ # FoolOS Makefile #
+ # #
+ #####################
+
+
+IMAGE_SIZE=1474560
all: FoolOS.img
@@ -17,12 +22,20 @@ mbr.bin: boot/mbr.asm
kernel_entry.o: boot/kernel_entry.asm
nasm -f elf $^ -o $@
-kernel.o: kernel/kernel.c
- gcc -ffreestanding -m32 -o $@ -c $^ -fno-asynchronous-unwind-tables
+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:
+ vboxmanage debugvm FoolOs dumpguestcore --filename dump.elf
+ xxd dump.elf > dump.xxd
-kernel.bin: kernel_entry.o kernel.o
- ld -o $@ -Ttext 0x1000 --oformat binary -melf_i386 $^
clean:
- rm *.bin *.o *.img
+ -rm *.bin *.o *.img dump.elf dump.xxd
.PHONY: all clean