A few months ago, I came across the problem of creating a DOS-based bootable CD-ROM with custom data on it. I needed the image to upgrade an old mainboard BIOS. Sadly the manufacturer did not provide a bootable CD by himself. It took me quite a long time to get the image working. Either the image would not boot or my custom data was not available. If you ever find yourself in the same situation and you are using a Desktop Linux for creating the images, I might have a nice solution for you.
In the following, I will describe how to create a bootable DOS based ISO with custom data on it with Linux command line tools and K3B.
But first things first.
I will use the following programs/configurations in this post.
Prerequisites
- Burning tool K3B – http://www.k3b.org/
- Loop device mounting in kernel:
[code]
-> Device Drivers
-> Block devices (BLK_DEV [=y])
-> Loopback device Support (CONFIG_BLK_DEV_LOOP)[/code] - DOS Boot image drdos.img (drdosmin.zip from http://www.biosflash.com/e/bios-boot-cd.htm)
- Prepared K3B project file – http://www.phillme.de/dl/burn-dos-iso.k3b
- File structure: The K3B file provided assumes the following file structure:tmp
img/
drdos.img # original/ extendable dos disk image
loop/ # mount point for extendable dos image
dosimg.iso # created iso image with K3B
Preparing the disk image
- Download DOS boot image drdosmin.zip (see above) and extract drdos.img to folder /tmp/dos-iso/img
- Prepare the DOS files you want to access out of the running dos
- [code lang=”bash”]#mount DOS image with loop interface
mount -o loop /tmp/dos-iso/img/drdos.img /tmp/dos-iso/loop/[/code] - copy your DOS files to the mounted loop/ folder from the last step
- [code lang=”bash”]
#unmount loop file
umount /tmp/dos-iso/loop/ [/code]
Writing the extended ISO Image
- Start K3B
- Open prepared K3B project from http://www.phillme.de/dl/burn-dos-iso.k3b
- Check if correct boot image was selected (default from K3B project “/tmp/dos-iso/img/drdos.img”), otherwise
- Click paper with pencil icon
- Click “new…”
- Select extended drdos.img with files
- Leave other options untouched
- “Burn” iso image to a file for testing it before burning. Default location with K3B file should be “/tmp/dos-iso/dosimg.iso”
Testing the created boot image
- Install kvm or other virtualisation software
- Start iso from commandline [code lang=”bash”]kvm -cdrom /tmp/dos-iso/dosimg.iso[/code]
- In the kvm window you should see something like “Starting Caldera DR-DOS…”
- Then you should get a commandline asking for the date (just hit enter)
- After that you should get a line looking like “A:\>_”
- Type in “dir” hit enter and check if you see all files from the drdos.img prepared before
If everything works… Congratulations! You can now burn the CD from the ISO image, start your computer with it and access your copied files out of a running DOS.
If it does not work for you or if you have any other suggestions, drop me a comment on this post.
Best Regards,
Phillip