Page 1 of 1

Virtual floppy in Linux

Posted: Tue Sep 18, 2007 2:19 pm
by Joseph1337
Hello there

I`m trying to boot my little boot.bin in Bochs but I got a problem. My floppy doesn`t work so I was wondering if can I create a virtual floppy drive in linux and write to it in normal means(dd). Or sowewhow link /dev/fd0 to a created by my file that i can read/write data via dd and it acts like a normal floppy.
Thanks

Posted: Tue Sep 18, 2007 3:23 pm
by Combuster

Re: Virtual floppy in Linux

Posted: Tue Sep 18, 2007 3:58 pm
by pcmattman
Joseph1337 wrote:I`m trying to boot my little boot.bin in Bochs but I got a problem. My floppy doesn`t work so I was wondering if can I create a virtual floppy drive in linux and write to it in normal means(dd). Or sowewhow link /dev/fd0 to a created by my file that i can read/write data via dd and it acts like a normal floppy.
Thanks
If your boot.bin is a valid FAT12 bootsector you can insert it as the first sector of the floppy image and then mount your floppy (via the method that Combuster provided) and read/write to it using your host OS.

Yup that's easy

Posted: Sun Sep 30, 2007 12:24 am
by DeletedAccount
1) dd if=/dev/zero of=myos.img bs=1k count=1440
2) mkdosfs myos.img # mke2fs for ext2 etc ...
3) mount -o loop myos.img mydir


That's alll ...
When you are done ..

umount mydir