• Please review our updated Terms and Rules here

Any good way to create a bootable DOS CF HDD on a LINUX box?

RetroGaming Roundup

Experienced Member
Joined
May 14, 2013
Messages
86
Long story short;

I have an XT class PC with an XT-IDE and a 512mb CF card. No good way at present to use real floppies or a gotek for a few reasons.

What I would like to do is format that CF card with DOS 5.0 as a bootable drive and if possible define a few partitions, and if possible drop files into them like a full DOS install and other programs.

I would like to think that by now we would have a linux program to do such a thing with a few tick boxes, but I can't seem to find one. Does such an app exist or even a reasonable process to pull this off?
 
There are sites that have boot floppy images available for download. What I would do in this situation is to set up some kind of PC emulator and have it boot from a diskette image. Using the emulator, make a bootable DOS volume, then dd the resulting volume image onto your CF card (or find a way for your emulator to write to the CF card directly).
 
The last time I did something like this I started with a DOS 6.22 virtual machine from Winworldpc and used a procedure along these lines:
1) use the dd command to create a blank 256m(or whatever the size of your physical media is) file: dd status=progress if=/dev/zero of=./dos622.img bs=1024k count=256
2) Mount the blank image file as a hard drive in the virtualization software
3) Format the blank drive with DOS and copy all DOS files to the new drive
4) Shut down the virtual machine
5) Mount my physical media(in my case a DOM) via USB
6) Copy the image file to the physical media: dd status=progress if=./dos622.img of=/dev/DEVICE(where DEVICE is the name of your physical media)

Disclaimer: I can't guarantee that this procedure is 100% accurate as I typed it from memory.
 
Just make a virtual machine in VirtualBox and mount the physical media...

I can vouch for this procedure. Years ago I used it to set up a bootable hard disk for an old Dolch Pentium luggable that had a nasty mid-90's BIOS that rendered it incapable of booting most CD-ROM formats. (And I had no floppy disks.) Attached the hard disk via one of those universal USB-to-IDE dongle kits; for a CF card you should be able to just use an apropos universal flash reader.

QEMU or KVM (via virt-manager or other gui of choice) would probably work just as well as Virtualbox, so far as it goes.
 
So I just did this for my Compaq portable and it booted almost to dos.. getting parity check 2 at the moment but may as well say how I got that far lol.

This will boot your floppy image and attach a drive located at /dev/sdb (typical name if you only have one main HDD or SSD installed + a USB CF adapter connected) run dmesg just after attaching the USB CF adapter with the disk in it and you'll see where linux recognizes it an gives it a device name in the output.

qemu-system-i386 -fda Disk1.img -drive fmt=raw,file=/dev/sdb -boot a

After you boot up partition and format you disk manually as it probably will fail to do it automatically... 2GB is the max it will do this by default for 6.22.

Then run the setup command to continue... it will begin the install and then ask to switch disks assuming you have the GTK interface version of QEMU you can select the compatmonitor0 device from the dropdown menu and type in change floppy0 Disk2.img to switch to the second image in your floppy set or whatever disk image name in the same folder as your previous floppy image. Now switch back to the VGA output device. Note if you don't have the GTK version of QEMU you can redirect that IO to the terminal but I don't remember how to do that at the moment just google search for it. Note I had to run fdisk /mbr before was able to boot from my drive. From there you have what you need to know to continue the install!

Also note that I used a cheap $10 CF to SD card adapter for this just now... and was able to access a 16GB SD card.
 
A problem is that different IDE devices may interpret a CF card's geometry differently. Even different XT IDE BIOS revisions can wind up expecting different CHS values.

The CHS values set in the partition table must match whatever values BIOS assigns it on the target machine. For CF cards and other LBA devices, these number just get pulled out of the air. Emulators/Virtualizers also usually just make up numbers to fit an arbitrary sized volume.

Sometimes, if BIOS and the partition table don't match, DOS booted from a different drive might still be able to find and read the partition, but it won't boot.

So you might get lucky and have a Windows/Linux/Emulator created partition boot DOS, but you might have to futz with the CHS values.
 
Back
Top