#!/bin/sh echo "Compiling..." nasm -I boot/include/ -o boot/mbr.bin boot/mbr.S nasm -I boot/include/ -o boot/loader.bin boot/loader.S nasm -f elf -o lib/kernel/print.o lib/kernel/print.S i386-elf-gcc -I ./lib/ -I lib/kernel/ -c -o kernel/main.o kernel/main.c i386-elf-ld -Ttext 0xc0001500 -e main -o kernel/kernel.bin kernel/main.o lib/kernel/print.o echo "Creating disk image..." bximage -q -func=create -hd=30M hd30M.img 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..." dd if=kernel/kernel.bin of=hd30M.img bs=512 count=200 seek=9 conv=notrunc echo "Disk image created successfully." # echo "Now starting bochs ..." # bochs -f bochsrc.txt