• Please review our updated Terms and Rules here

Imaging XT-IDE CF card to use in emulation.....

prime

Experienced Member
Joined
Sep 20, 2009
Messages
153
Location
Coventry, UK
Hi all,

So here's the setup I have a 5150 PC with a WD MFM controller in it, attached to this is a 20MB hard disk. This all works fine but I wanted to take a dump of the hard disk for backup / emulation purposes. The machine is running PC-DOS 4.

So I installed an XT CF lite rev 2, jumpered so it's BIOS was at D800 rather than C800 so both it and the WD's ROMs would be recognised. This worked and I was able to boot into DOS, then FDISK / FORMAT a 32MB CF card.
I formatted the CF card /s so that it was bootable and used XCOPY to copy the contents of the MFM to the CF, it did this without problems. I then removed the MFM card and checked that the CF card was bootable, it booted and I was able to run a couple of programs from the CF card (though I suck at Battle Chess :) ).

Now I have then taken the CF card and plugged it into an Athlon 64 powered Shuttle PC, which I use for retro transfers. This machine has several OSes installed including SuSE Linux and PC-DOS 7. The CF card seems to be recognized under DOS as D: and again I can read the CF and run stuff off it. Now booting into Linux to take an image of the card, again I can mount the DOS filesystem under Linux and am able to access the files on it though obviously I can't run any of them directly.

So now I take a raw image of the CF card with dd if=/dev/sdb of=card_image.dsk again this all works fine. I verified that the image is good with the loop device, using losetup and mounting the dos partition from the image.

However when I copy the image to my Windows 10 PC, to use under MESS (using it's machine type pcega with the XT-IDE in one of the slots), the machine starts but refuses to boot with 'missing operating system', oddly if I boot the machine from a floppy image and try accessing the CF image, again it seems to be OK and I can run programs successfully off the image.

Anyone have any clues as to what is going on here?

Cheers.

Phill.
 
The "Missing Operating System" error is a classic sign of a incompatible drive geometry, It can often happen when for example, Setting up / Partitioning / Formatting a CF card on one PC and then moving that CF card to another PC, The CF card will work in the original PC it was setup in but not boot in another PC.
 
Make sure that you're using the same version of XTIDE Universal BIOS in MESS as in your 5150.
 
I'll be honest, I've had WAY more luck with SD to IDE than Compact Flash. The cards are cheaper and more readily available as well. You can get as little at 16MB if you need. I think the only downside is that SD has a more limited maximum write but I've never had one go bad. (Knock on wood.)
 
I'll be honest, I've had WAY more luck with SD to IDE than Compact Flash. The cards are cheaper and more readily available as well. You can get as little at 16MB if you need. I think the only downside is that SD has a more limited maximum write but I've never had one go bad. (Knock on wood.)

Ditto. I have a substantial pile of CF cards that I've tested in my homemade XT-CF cards and only about a third of them reliably pass a disk torture test. (This includes none of the ones I've tried over 512MB in capacity. I'd be pretty ticked off if I'd actually paid for them.) On the other hand I've had, so far, absolutely perfect luck with those cheap little 44 pin laptop IDE to SD adapters. They're based on the same chip as a common CF to SD adapter, and I'm guessing that's why they seem to have perfect 8-bit transfer mode support.

That said, I don't think that has anything to do with the OP's problem, I second it's probably a geometry issue. I haven't tried MESS, but I have succeeded, mostly, in doing what the OP is doing with Bochs. (Bochs is sort of useless if you're wanting to emulate a DOS game or whatever accurately, however.) It's been a long time since I messed with MAME, but I vaguely wonder if it might work better if you used the "chdman" program to create a .CHD that has embedded geometry information; the question is what values you'd need to enter for that operation. Maybe running something like Check-it or Norton Utilities on the 5150 would be able to tell you what DOS thinks it looks like and you could try those?

(For instance, Check-it's hard disk diagnostic tells me the CHS values for my SD card in an XTCF is "1024,255,63". Obviously that's going to be a lot different for a 32MB card.)
 
To follow up a little,

I got the image working in the end, once I dumped the CF with Linux , I then ran it through chdman, with the actual physical Cylinders, Heads and Sectors that the card reported. That way XT-IDE on the emulated machine read exactly the same geometry from the CHD as it would get from the actual CF card and translated accordingly.

One curiosity I did find is that I have a 1GB CF in my Compaq Portable II, I also tried imaging that with Linux, and found I had problems if I plugged the CF card into a CF->IDE converter on the Linux machine's IDE bus, Linux got completely the wrong geometry and got itself confused resulting in it not being able to read the filesystems correctly. Oddly it worked under PC-DOS 7 on the same machine, but that would be going through the BIOS which would use the same translation as XT-IDE.

Plugging the CF into an external USB reader, took the BIOS out of the equation as far as Linux was concerned, so it had to probe the drive when it was inserted, this it did and got the geometry / translation right so was able to make a good image and read the dos filesystems without problems.

Never tried a SD->IDE interface, though I use SD cards on some of my other Retro machines (Acorn Atom, Dragon 32/64, Tandy CoCo etc).


Cheers.

Phill.
 
For what it's worth, I've had success imaging the 2gb CF card from my 5160 under Windows, and getting PCem to boot from the image.
May not be relevant to your case, but others might find this useful... my steps are:

  • Mount the card as a Windows drive by plugging it into a USB card reader
  • In a command prompt (as administrator), run "dd --list" (needs dd for windows)
  • Identify the correct block device associated with the drive. This shouldn't be the drive letter, and not the "\\.\Volume" or a "\\.\Device\<NUMBER>" either, but rather something like "\\?\Device\Harddisk2\Partition0".
    (If you pick the wrong source here, you'll get fun stuff like the loose partition without the MBR, or just the MBR itself repeated a bunch of times)
  • Dump it - I set the blocksize to 16k and specify the expected block count just in case, so my command line looks like:
    dd if=\\?\Device\Harddisk2\Partition0 of=CFcard.img bs=16k count=125055 --progress
  • When that's done, you can try to verify the result, e.g. open it in WinImage and see if it asks you for a partition to read (if it reads the contents *without* asking you first, you've done something wrong)
  • In PCem, as Krille mentioned: make sure you're using the same XUB version you normally have in your machine with the CF
  • Add the image to your PCem machine as an IDE hard drive, and plug in the right CHS values yourself. Again, just in case (the emulator's guess isn't always correct).
 
Back
Top