Page 1 of 1
Create floppy Image in linux
Posted: Sun Jul 03, 2005 7:06 am
by mar-rih
could any one help me, how can i make disk image and display its contents in Linux please.
Re:Create floppy Image in linux
Posted: Sun Jul 03, 2005 3:06 pm
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)
Re:Create floppy Image in linux
Posted: Mon Jul 04, 2005 10:38 am
by mar-rih
could i display the content of image in linux ? and how can i do it ?
than you
Re:Create floppy Image in linux
Posted: Mon Jul 04, 2005 11:39 am
by zyp
Floppy image? You can mount it as a loop-back device.
Code: Select all
mkdir foo
mount foo.img foo -o loop
Re:Create floppy Image in linux
Posted: Mon Jul 04, 2005 4:48 pm
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.?
Re:Create floppy Image in linux
Posted: Tue Jul 05, 2005 2:49 am
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
Re:Create floppy Image in linux
Posted: Wed Jul 06, 2005 11:15 am
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 ?
Re:Create floppy Image in linux
Posted: Wed Jul 06, 2005 12:44 pm
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 ...