summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-04-23 20:38:39 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-04-23 20:38:39 +0200
commita7fb48922dee006339747d128d83fafbe9dfe79a (patch)
tree1059f98f582a83dfeb25aa72fb6bdc2598a66dc3 /src/Makefile
downloadabaos-a7fb48922dee006339747d128d83fafbe9dfe79a.tar.gz
abaos-a7fb48922dee006339747d128d83fafbe9dfe79a.tar.bz2
fresh import because of huge documents checked in by accident
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile29
1 files changed, 29 insertions, 0 deletions
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