Create floppy Image in linux

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mar-rih

Create floppy Image in linux

Post by mar-rih »

could any one help me, how can i make disk image and display its contents in Linux please.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Create floppy Image in linux

Post by Pype.Clicker »

sure.

http://www.osdev.org/osfaq2/index.php/D ... er%20Linux

You may also check out the "bximage" tool that can create an empty image for a hard disk of a given size (and should tell you what CHS setup you should give to bochs to use it)
mar-rih

Re:Create floppy Image in linux

Post by mar-rih »

could i display the content of image in linux ? and how can i do it ?

than you
zyp

Re:Create floppy Image in linux

Post by zyp »

Floppy image? You can mount it as a loop-back device.

Code: Select all

mkdir foo
mount foo.img foo -o loop
mar-rih

Re:Create floppy Image in linux

Post by mar-rih »

Thanx...

i would to know how can i make an image for my kernel.bin and deal with image from bochs as floppy drive.

i did that in windows by partcopy or by Winimage, but in linux i could't...

could any one help me please.?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Create floppy Image in linux

Post by Pype.Clicker »

Am i correctly assuming that you want your kernel.bin to be a file on a FAT-12 formatted floppy ?

The detailed steps are in the FAQ (url above). The core idea of disk images on linux is that something called loop device can let you use a file as if it was a disk device. If you want to operate on a floppy image, you just set a loop device on that image and then you mount the floppy (such as you would have mounted any regular floppy) to make it appear in the file system.

Once those steps are performed,

Code: Select all

mkdir /mnt/myfloppy/kernel
cp kernel.bin /mnt/myfloppy/kernel
works just fine.

If you're using GRUB, you can pick up the "ready-for-use" GRUB image as a base, mount it and add your file.

If you're completely depressed by not achieving these stuff, you still can save your soul with a real floppy:

Code: Select all

** insert real GRUB floppy **
mount /mnt/floppy
cp kernel.bin /mnt/floppy
umount /mnt/floppy
cat /dev/fd0 >floppy.img
but that will be desesperately sloooow way to go.


You may also like to check "mtools": http://mtools.linux.lu/mtools.html#SEC4
mar-rih

Re:Create floppy Image in linux

Post by mar-rih »

thanx very much Clicker

i did this steps, and when i started the Boches by image that i create, the bochs did't boot from the image that contain Grub loader and my Kernel.bin.

it show this message from bochs monitor :"Booting from floppy"

and repeat it very much.

the bochs debuger disply the message :" unamped device for DL =80"

i thought that the broplem is for the floppy delay, is't that ?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Create floppy Image in linux

Post by Pype.Clicker »

mar-rih wrote: thanx very much Clicker
You're welcome. Btw, my nickname is "Pype". "Clicker" is the project (but the board didn't accept handles of less than 8 chars or something alike, so ...)
the bochs debuger disply the message :" unamped device for DL =80"

i thought that the broplem is for the floppy delay, is't that ?
No. DL is the register that contains the ID of the boot device after the POST. and "0x80" is the value for primary master HDD ... So my guess is that you forgot to tell BOCHS it should boot on "A:" device. So it's trying hard to boot on a virtual disk that's not even there ...
Post Reply