OS development - boot from floppy disk using qemu

I read the BrokenThorn OS development tutorial and am creating and loading the second stage bootloader. The tutorial is for Windows, but I do it on Linux (Ubuntu 13.04).

This is what I did:

  • Created floppy.img file under ~/Documents/floppy using the mkfs.vfat
  • Compiled using boot.asm file with nasm giving me boot.bin
  • Then I dd if=boot.bin of=~/Documents/floppy/floppy.img bs=512 count=1 following command: dd if=boot.bin of=~/Documents/floppy/floppy.img bs=512 count=1

Thus, I have a floppy disk image with the first stage bootloader. When launched using qemu, it works fine.

However, after I create the second stage bootloader (if I'm right), I would have to install floppy.img and copy stage 2 to the mounted file system. In this case, how can I boot a mounted diskette using qemu? Is it possible? If not, how do I work with the second stage bootloader.

Please forgive me for any stupid suggestion / question as I am new to this.

+6
source share
1 answer

Where is your problem? You set the image:

 mount -oloop ~/Documents/floppy.img /mnt/floppy 

Copy stage2:

 cp stage2.bin /mnt/floppy 

Disable it:

 umount /mnt/floppy 

And run it with QEMU:

 qemu -fda ~/Documents/floppy.img 

Voila!

+2
source

Source: https://habr.com/ru/post/958019/


All Articles