Page 1 of 1

where and how to put stage1 and stage2 on single floppy?

Posted: Fri Oct 01, 2010 7:38 am
by raynesax
Hello Sir,
I'm a beginner in OS development.I've read your tutorials on bootloader.Now i want to know that where(and how) to put my stage1 and stage2 of bootloader on floppy.Also i don't own a floppy drive.I'm using Ubuntu 10.04(Linux).Please help...

Re: where and how to put stage1 and stage2 on single floppy?

Posted: Fri Oct 01, 2010 1:43 pm
by pathos
raynesax wrote:Hello Sir,
I'm a beginner in OS development.I've read your tutorials on bootloader.Now i want to know that where(and how) to put my stage1 and stage2 of bootloader on floppy.Also i don't own a floppy drive.I'm using Ubuntu 10.04(Linux).Please help...
Hopefully someone else can come along and help you (I can't =(, sorry), but until then, check this out: http://wiki.osdev.org/Loopback_Device#Creating_an_image. It may do what you need.

Re: where and how to put stage1 and stage2 on single floppy?

Posted: Mon Nov 22, 2010 12:13 pm
by xilvium
Hello Raynesax,

I myself also use linux and I use this code to put my bootloader on a floppy:

Code: Select all

dd if=boot.bin bs=512 of=/dev/fd0
I DO have a floppy drive thats what this code is aimed for!
But you could create a empty floppy image and mount it and then write to it :)

Here's a little example (Taken from James Molloy's website)
You need /sbin in your $PATH for losetup to work!

Code: Select all

sudo losetup /dev/loop0 floppy.img
sudo mount /dev/loop0 /mnt
sudo cp src/kernel /mnt/kernel
sudo umount /dev/loop0
sudo losetup -d /dev/loop0
This script is ofcourse for his tutorial series but with the code I gave you earlier you could write them together and work that way :)
Hope I was of any help!