Explorar o código

add: build.sh and clean.sh

runningwater hai 11 meses
pai
achega
5f2df661cb
Modificáronse 3 ficheiros con 23 adicións e 0 borrados
  1. 20 0
      build.sh
  2. 3 0
      clean.sh
  3. BIN=BIN
      hd30M.img

+ 20 - 0
build.sh

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+echo "Creating disk image..."
+bximage -q -func=create -hd=30M hd30M.img
+
+echo "Compiling..."
+nasm -I boot/include/ -o boot/mbr.bin boot/mbr.S
+nasm -I boot/include/ -o boot/loader.bin boot/loader.S
+
+echo "Installing to disk image..."
+echo " 0. Writing mbr to disk..."
+dd if=boot/mbr.bin of=hd30M.img bs=512 count=1 conv=notrunc
+echo " 1. Writing loader to disk..."
+dd if=boot/loader.bin of=hd30M.img bs=512 count=4 seek=2 conv=notrunc
+# echo " 2. Writing kernel to disk..."
+# TODO: Add code to write the kernel to the disk image
+echo "Disk image created successfully."
+
+# echo "Now starting bochs ..."
+# bochs -f bochsrc.txt

+ 3 - 0
clean.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+rm -rf bochsout.txt hd30M.img *.bin boot/*.bin

BIN=BIN
hd30M.img