Creating a DOS boot CD with custom data for BIOS updates with the help of K3B in Linux

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

  1. Download DOS boot image drdosmin.zip (see above) and extract drdos.img to folder /tmp/dos-iso/img
  2. Prepare the DOS files you want to access out of the running dos
  3. [code lang=”bash”]#mount DOS image with loop interface
    mount -o loop /tmp/dos-iso/img/drdos.img /tmp/dos-iso/loop/[/code]
  4. copy your DOS files to the mounted loop/ folder from the last step
  5. [code lang=”bash”]
    #unmount loop file
    umount /tmp/dos-iso/loop/ [/code]

 

Writing the extended ISO Image

  1. Start K3B
  2. Open prepared K3B project from http://www.phillme.de/dl/burn-dos-iso.k3b
  3. Check if correct boot image was selected (default from K3B project “/tmp/dos-iso/img/drdos.img”), otherwise
    1. Click paper with pencil icon
    2. Click “new…”
    3. Select extended drdos.img with files
    4. Leave other options untouched
  4. “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

  1. Install kvm or other virtualisation software
  2. Start iso from commandline [code lang=”bash”]kvm -cdrom /tmp/dos-iso/dosimg.iso[/code]
  3. In the kvm window you should see something like “Starting Caldera DR-DOS…”
  4. Then you should get a commandline asking for the date (just hit enter)
  5. After that you should get a line looking like “A:\>_”
  6. 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

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*