aboutsummaryrefslogtreecommitdiffstats
path: root/make.sh
diff options
context:
space:
mode:
Diffstat (limited to 'make.sh')
-rw-r--r--make.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/make.sh b/make.sh
index e69de29..bbddce8 100644
--- a/make.sh
+++ b/make.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+AS_BOOT=nasm -fbin
+SRC_DIR=src
+DST_DIR=dst
+IMG_FILE=disk.iso
+
+clean()
+{
+ rm -f $IMG_FILE
+ rm -rf $DST_DIR
+}
+
+build()
+{
+ clean()
+ $AS_BOOT $SRC_DIR/boot/boot.stage1.asm -o $DST_DIR/s1_boot.bin
+}
+
+run()
+{
+ qemu-system-x86_64 -cdrom $IMG_FILE
+}
+
+debug()
+{
+ qemu-system-x86_64 -cdrom $IMG_FILE -S -s
+}
+case $1 in
+ "clean") clean ;;
+ "build") build ;;
+ "run") run ;;
+ "debug") debug ;;
+ *) echo "Use clean|build|run|debug" ;;
+esac