Page 1 of 1
Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 4:01 pm
by CodeCat
I'm trying to figure out how to mount a Bochs HD image as a real drive in Windows. I've tried Filedisk, but when I mount the FreeDOS image on the Bochs site Windows just says the drive isn't formatted. After some messing around with the image, I discovered that apparently Filedisk deals only with images of a single partition, rather than entire drives like Bochs does. Does anyone know a way around this? (And yes, it has to be a hard drive image, can't be a floppy)
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 5:52 pm
by Kieran
Well, try and use a USB pen drive, write the image using WinImage. Then you can boot FreeDOS from the USB device if your BIOS supports it.
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 5:59 pm
by CodeCat
Well, I'm using a GRUB boot floppy image as a boot loader, which should then load my kernel from the disc image and run it. That's the idea anyway, cause I didn't get that far yet because I'm trying to figure out how to get the kernel into the image to begin with (that's what I was hoping to use Filedisk for).
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 6:07 pm
by Kieran
Ok, if you have a copy of Linux or a Linux Live CD you can put grub on the hard disk and move file to and fro whenever you require.
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 6:15 pm
by CodeCat
But that's not the problem, really. GRUB loads from the floppy image from within Bochs, and that works fine. I can tell it to run the kernel from the root directory of /dev/hda1, which would simply be a partition on another image file. The issue is here that I can't easily get my kernel into that image file with Filedisk. The only kind of images Bochs supports are images of complete drives (i.e. with an MBR, partition table and all), while Filedisk can only handle images of one partition (with no MBR, i.e. the first sector is the FAT bootsector). What I need to know is whether there is a way to somehow extract the partition from a Bochs-style image so that Filedisk can handle it. Then I could just mount that partition image with Filedisk, copy the kernel file into it with the basic Windows explorer, write the partition image back into the Bochs drive image, and then boot.
I could write a program to do that no problem, but I just wanted to know if there is an easier way to do it.
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 6:16 pm
by Kieran
Have you tried WinImage?
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 6:21 pm
by CodeCat
Not yet, I'm kinda trying to avoid non-free software. But if it does the trick then I might use it.
Re: Mounting a HD image as a real drive in Windows
Posted: Fri Oct 03, 2008 6:23 pm
by Kieran
OK, hope you find a solution or someone else can help.
Re: Mounting a HD image as a real drive in Windows
Posted: Sat Oct 04, 2008 2:58 am
by ru2aqare
If you have Total Commander, you could use this plugin:
here. It has both x86 and x64 drivers. Otherwise, FileDisk64 has worked for me. I haven't tried it though for Bochs images, and it has serious multi-user issues.
Re: Mounting a HD image as a real drive in Windows
Posted: Sat Oct 04, 2008 2:44 pm
by Brynet-Inc
Re: Mounting a HD image as a real drive in Windows
Posted: Sun Oct 05, 2008 5:22 am
by clange
Hi
You could try VDK.
http://chitchat.at.infoseek.co.jp/vmware/vdk.html. It handles VMware images and Bochs can use those too.
VMware image is a text file describing it and one or more data files. Example: test.vmdk (descr.) and test-s001.vmdk (data). When using VDK reference the description file and when using Bochs reference the data file. I don't think this will work with more than 1 data file though. I am doing it like this with 1 data file.
Hope it helps
Christian Lange
Re: Mounting a HD image as a real drive in Windows
Posted: Sun Oct 05, 2008 6:16 am
by CodeCat
I decided to write my own utility to solve the problem anyway, as a matter of practice. I've attached it to the post. It's in source form only, but it uses nothing but standard C++ so compiling shouldn't be a problem. Hope it turns out to be useful for others as well. It certainly works for me.