Creating and writing to hd and fd images
Creating and writing to hd and fd images
Hi! Does anybody know how I can write and format a disk image created with the bochs disk image creation tool?
Re:Creating and writing to hd and fd images
That depends on what you mean to write to it, but assuming you mean to copy a boot image into the disk image's sector 0, any raw-writing utility should do the trick; some debuggers will do this as well. Under Windows, you can use the DOS DEBUG utility, or any of several tools such as RawWrite or partcopy; I find partcopy to be the most useful, but it's a matter of personal preference. Under Unix and Linux, you can use the dd(1) utility for this. See this thread for more details.
Re:Creating and writing to hd and fd images
But how do you write to a non-physical disk with debug? I know how to do it with real floppys, but with an image?
Re:Creating and writing to hd and fd images
I managed to use partcopy to take my test machine's 850MB hard disk and make an image file of it that just ran on bochs first time.
Very nice, although I had a bit of trouble getting the drive size perfectly correct. Win2k said that is was 815MB when it was 814MB (formatted capacity).
srg
Very nice, although I had a bit of trouble getting the drive size perfectly correct. Win2k said that is was 815MB when it was 814MB (formatted capacity).
srg
Re:Creating and writing to hd and fd images
Do you mean a hard disk image?
Bochs needs to have a hard disk image which contains both MBR and the partitions.
You need to have 2 separated files, the MBR part and the partition.
First of all, create the disk image with bximage.
The fdisk it and set a partition, set the partition type flags and save it to the image.
Then you have to separate the MBR part and the partition. MBR is AFAIK 63 sectors long.
To separate them you can use "dd if=image.bin of=mbr.bin count=63" to create the MBR image and then "dd if=image.bin of=partition.bin skip=63" to create the partition.
Format the partition file with your file system tools (i.e. mke2fs partition.bin).
Now you can mount the partition.bin and copy the files on it.
You need to re-create the disk image to run it on bochs. Type "cat mbr.bin partition.bin > image.bin" et voil?, the image is ready.
Bochs needs to have a hard disk image which contains both MBR and the partitions.
You need to have 2 separated files, the MBR part and the partition.
First of all, create the disk image with bximage.
The fdisk it and set a partition, set the partition type flags and save it to the image.
Then you have to separate the MBR part and the partition. MBR is AFAIK 63 sectors long.
To separate them you can use "dd if=image.bin of=mbr.bin count=63" to create the MBR image and then "dd if=image.bin of=partition.bin skip=63" to create the partition.
Format the partition file with your file system tools (i.e. mke2fs partition.bin).
Now you can mount the partition.bin and copy the files on it.
You need to re-create the disk image to run it on bochs. Type "cat mbr.bin partition.bin > image.bin" et voil?, the image is ready.
Re:Creating and writing to hd and fd images
Thanks. But I am using windows xp, because linux doesn't support my wireless card(I have used linux, though, throug a lan-connection wih my notebook.)And, for the beginnig I want to edit a floppy-image.
Re:Creating and writing to hd and fd images
;D Sorry.And, for the beginnig I want to edit a floppy-image.
I don't know how to do this on Window$. :-\
Re:Creating and writing to hd and fd images
Not entirely true, the MBR is 1 sector, but it's used to begin on the next track, so it's going to take (depending on your logical HD geo)64*63 = 4032 sectors .MBR is AFAIK 63 sectors long.
And not 63 sectors as you claim.
Re:Creating and writing to hd and fd images
Actually, the MBR is only 1 sector (512 bytes) is size. The rest of that region before the first partition wasn't used. Well, saying that, things like EZ-Drive or Ontrack Disk Manager, known as Dynamic Drive Overlay software and some viruses used it (a bit of a loophole!).Neur0m'ancer wrote: Do you mean a hard disk image?
Bochs needs to have a hard disk image which contains both MBR and the partitions.
You need to have 2 separated files, the MBR part and the partition.
First of all, create the disk image with bximage.
The fdisk it and set a partition, set the partition type flags and save it to the image.
Then you have to separate the MBR part and the partition. MBR is AFAIK 63 sectors long.
To separate them you can use "dd if=image.bin of=mbr.bin count=63" to create the MBR image and then "dd if=image.bin of=partition.bin skip=63" to create the partition.
Format the partition file with your file system tools (i.e. mke2fs partition.bin).
Now you can mount the partition.bin and copy the files on it.
You need to re-create the disk image to run it on bochs. Type "cat mbr.bin partition.bin > image.bin" et voil?, the image is ready.
hope this helps!
srg
Re:Creating and writing to hd and fd images
Use Winimagenewguy wrote: Thanks. But I am using windows xp, because linux doesn't support my wireless card(I have used linux, though, throug a lan-connection wih my notebook.)And, for the beginnig I want to edit a floppy-image.
Just search on google and you'll find it ;D
Re:Creating and writing to hd and fd images
Thank you very much! WinImage is great! Thanks for posting y'all.