简体   繁体   中英

OS Development - booting from floppy drive using qemu

I have been reading BrokenThorn's OS development tutorial and am at the part of creating and loading the second stage bootloader. The tutorial is for Windows, but I am doing this in Linux(Ubuntu 13.04).

This is what I have done:

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

Thus I have the floppy image with the first stage bootloader. On starting that using qemu, it works fine.

However, after I create the second stage bootloader, (if I am correct)I would have to mount the floppy.img and copy stage 2 on to the mounted filesystem. In such a case, how can one boot a mounted floppy using qemu ? Is it even possible ? If not, how do I work with the second stage bootloader.

Please forgive me for any stupid assumption/question as I am new with this.

Where is your problem? You mount the image:

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

Copy the stage2:

cp stage2.bin /mnt/floppy

Unmount it:

umount /mnt/floppy

And launch it with QEMU:

qemu -fda ~/Documents/floppy.img

Voilà!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM