VirtualBox won't boot from my ISO image
Posted: Sun Nov 01, 2020 8:18 am
I am trying to compile my small kernel & bootloader into an ISO image with the following commands:
Running this ISO through VirtualBox, I get this error: FATAL: Could not read from the boot medium! System halted.
I don't think that my bootloader is the issue, since setting -b boot.bin instead of -b os.bin with mkisofs makes the bootloader ISO work, but I can't load my kernel code like that!
Note that I don't have a GCC cross compiler set-up, I'm working from Ubuntu.
Code: Select all
nasm boot.asm -f bin -o boot.bin -> Compile the bootloader
Code: Select all
gcc -ffreestanding -c kernel.c -o kernel.o -> Create an object file of the kernel
Code: Select all
ld -Ttext 0x1000 kernel.o -o kernel.bin --oformat binary -> Compile it into a binary
Code: Select all
cat boot.bin kernel.bin > os.bin -> Cat them together
Code: Select all
mkisofs -no-emul-boot -b os.bin -o os.iso opt -> Create the iso image
I don't think that my bootloader is the issue, since setting -b boot.bin instead of -b os.bin with mkisofs makes the bootloader ISO work, but I can't load my kernel code like that!
Note that I don't have a GCC cross compiler set-up, I'm working from Ubuntu.