Creating a virtual floppy to boot from on GNU/Linux
Posted: Tue Jul 22, 2014 10:26 pm
So I've been following a tutorial (http://www.brokenthorn.com/Resources/OSDev6.html) to get into OS development. I've learned quite a lot, but the tutorial has a major shortcoming: it's made for Windows only! I know that the tutorial is possible to do from Linux, and up until the point I am at I have been able to figure out what to do, but now I have a problem. I need to create a virtual floppy disk that I can boot into using QEMU. It's worked fine with a single file (using:
). Once I added a second file, however, it stopped working. I tried using the same dd command (the second one in shown here) with STAGE2.SYS (output of boot2.asm), though this did not work. I could see that the second file was not there by hexediting boot.img. It seemed to boot just fine, but no error messages were displayed. Nothing was printed out. Here is the pastebin of the full code:
boot1.asm: http://pastebin.com/NBJidft6
boot2.asm: http://pastebin.com/mY9FBDwF
Code: Select all
$ nasm boot1.asm -o boot.bin
$ dd if=/dev/zero of=boot.img bs=512 count=2880
$ dd status=noxfer conv=notrunc if=boot1.bin of=boot.img
$ qemu -fda boot.img
boot1.asm: http://pastebin.com/NBJidft6
boot2.asm: http://pastebin.com/mY9FBDwF