This time, I decided I was going to use GRUB.
The only file to be loaded as the "kernel" (as this "kernel" is for testing) is an assembly file called "boot.s" that contains the necessary code to print a '0' to the screen and hang.
I assemble and "link" the file using a gcc cross compiler to produce a binary file "test.bin".
To setup my flash drive for the booting, I followed these instructions in the wiki, "https://wiki.osdev.org/GRUB_2#USB_instructions", but instead of "/media/YourLabel", I used my own mount point "/mnt/temp".
I then created the file "/mnt/temp/boot/grub/grub.cfg",
Code: Select all
menuentry "Test OS" {
multiboot /boot/test.bin
boot
}
I booted from this flash drive in qemu with the command (/dev/sdb is the flash drive I installed GRUB to),
Code: Select all
sudo qemu-system-x86_64 -hda /dev/sdb
Code: Select all
GRUB _
(Sorry if I'm being a total n00b. I have little experience with booting OSs on physical machines.)