From a7fb48922dee006339747d128d83fafbe9dfe79a Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 23 Apr 2017 20:38:39 +0200 Subject: fresh import because of huge documents checked in by accident --- src/Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Makefile (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..ed04a72 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,29 @@ +CC := gcc + +all: image.bin + +image.bin: boot.bin kernel.bin + cat boot.bin kernel.bin > image.bin + truncate -s 1536 image.bin + +boot.bin: boot.asm gdt.asm stage1_functions.asm stage2_functions.asm switch_mode.asm + nasm boot.asm -f bin -o boot.bin + +kernel.bin: kernel.o + ld -o kernel.bin -Ttext 0x8000 kernel.o -m elf_i386 --oformat binary + +kernel.o: kernel.c + $(CC) -m32 -ffreestanding -c -o kernel.o kernel.c + +clean: + -rm -f boot.bin kernel.bin image.bin *.o + +run-qemu: image.bin + qemu-system-i386 -m 16 -drive "file=image.bin,if=ide,format=raw" + +run-bochs: + bochs -q 'boot:floppy' 'floppya: 1_44=image.bin, status=inserted' + + +functions.o: functions.c + gcc -m32 -ffreestanding -c -o functions.o functions.c -- cgit v1.2.3-54-g00ecf