build.sh 635 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. echo "Creating disk image..."
  3. bximage -q -func=create -hd=30M hd30M.img
  4. echo "Compiling..."
  5. nasm -I boot/include/ -o boot/mbr.bin boot/mbr.S
  6. nasm -I boot/include/ -o boot/loader.bin boot/loader.S
  7. echo "Installing to disk image..."
  8. echo " 0. Writing mbr to disk..."
  9. dd if=boot/mbr.bin of=hd30M.img bs=512 count=1 conv=notrunc
  10. echo " 1. Writing loader to disk..."
  11. dd if=boot/loader.bin of=hd30M.img bs=512 count=4 seek=2 conv=notrunc
  12. # echo " 2. Writing kernel to disk..."
  13. # TODO: Add code to write the kernel to the disk image
  14. echo "Disk image created successfully."
  15. # echo "Now starting bochs ..."
  16. # bochs -f bochsrc.txt