Creating FreeDOS bootable ISO

Creating FreeDOS bootable ISO

Prerequisites:

  • Linux
  • mkisofs or genisoimage
  • unzip utility for Linux
  • unix2dos (part of dos2unix packages)

This guide will cover creating DOS bootable ISO files to assist with simple and automated firmware updates for the most frequently updated components. The completed CD image can be burned to a CD, copied to a USB drive using Rufus or dd, or can be mounted with IPMI virtual media.

Why do we need this?

Simplicity, and to save space. DOS is fairly portable, and creating your own ISO files allows you to bundle flashing utilities along with firmware to avoid having to write up a separate tutorial for the customer. The customer can simply boot it, and scripted autorun utilities take care of the rest.

1. Download the attached FreeDOS OEM iso creator utility. This package includes a pre-formatted MOTD on boot for customer-facing DOS .iso files. 

2. Extract the files and navigate to the CDROOT folder.

    • # unzip FDOEMCD.builder.zip
    • # cd FDOEMCD/CDROOT/

3. Copy/paste the necessary update files to CDROOT, and add an entry in the AUTORUN.BAT file for automatic flash on boot. The files you use will depend on what type of firmware or BIOS update you wish to run.

 

  • For a SuperMicro BIOS update, copy over the following files:
    • # cp <bios update path>/afudos.smc /FDOEMCD/CDROOT/
    • # cp <bios update path>/DM82A229.ROM /FDOEMCD/CDROOT/
    • Check the readme and the contents of the BIOS update download from SuperMicro. If the BIOS update includes a .bat file to assist with the flash, open it and examine its contents.
    • # cat <bios update path>/flash.bat
  • The basic commands of a BIOS update batch executable are broken down like this:
    • Hide commands internal to the script from showing on the command line.
    • @echo off
    • Rename afudos.smc to afudos.exe. Prevents users from accidentally running executable outside of the batch script.
    • REN AFUDOS.SMC AFUDOS.EXE
    • Run flash command, where %1 corresponds to user-inputted file name.
    • AFUDOS.EXE %1 /P /B /N /C
    • Rename afudos.exe back to afudos.smc
    • REN AFUDOS.EXE AFUDOS.SMC
  • Open up AUTORUN.BAT as well, and copy over the flash command found in “flash.bat”. Change the “%1” to the name of the firmware ROM file.
    • # cd /FDOEMCD/CDROOT
    • # echo “AFUDOS.EXE DM82A229.ROM /P /B /N /C” >> AUTORUN.BAT
  • Make note of any commands in the original flash.bat that rename files. The .iso file is a read-only file system, so rename commands will subsequently fail. Instead, we can rename afudos.smc to afudos.exe outside of the boot environment.
    • # mv afudos.smc afudos.exe
  • Note that DOS is not case-sensitive, so “afudos.exe” is the same as “AFUDOS.EXE” for the purpose of batch scripts.

 

  • For a LSI MegaRAID firmware, copy over the following files:
    • # cp <DOS MegaCli path>/MegaCli.exe /FDOEMCD/CDROOT/
    • # cp <firmware update path>/mr2208fw.rom /FDOEMCD/CDROOT/
  • If the system contains only a single RAID controller, then you can auto flash all detected controllers in the system by adding the command to AUTORUN.BAT:
    • # cd /FDOEMCD/CDROOT
    • # echo “MegaCli -adpfwflash -f mr2208fw.rom aALL” >> AUTORUN.BAT
  • If there are multiple LSI controllers in a system, do not set AUTORUN.BAT to auto flash firmwareInstead, provide a blank AUTORUN.BAT and manually instruct the customer on how to update firmware with the adpfwflash command.
  • From DOS, list detected controllers in the system:
    • C:\ MegaCli -adpCount
  • Flash firmware to a single controller:
    • C:\ MegaCli -adpfwflash -f mr2208fw.rom -aN

 

  • For IPMI firmware, copy over the following files:
    • # cp <firmware update path>/RKCSFlsh.exe /FDOEMCD/CDROOT/
    • # cp <firmware update path>/<firmware>.ima /FDOEMCD/CDROOT/
  • Add a command to auto flash the IPMI firmware on boot:
    • # cd /FDOEMCD/CDROOT
    • # echo “RKCSFlsh.exe <firmware.ima>” >> AUTORUN.BAT

 

4. Once you've copied over the necessary files and edited your autorun batch file, note that this script must use DOS newlines, so if you added new lines to AUTORUN.BAT you need to convert the script from UNIX to DOS.

    • # unix2dos AUTORUN.BAT

5. Navigate up one directory to FDOEMCD and create your .iso file.

    • # cd ..
    • # mkisofs -o fdoem.iso -p "Silicon Mechanics Support" -publisher "www.siliconmechanics.com" -V "SiMech OEM CD" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -N -J -r -c boot.catalog -hide boot.catalog -hide-joliet boot.catalog CDROOT

6. The finished file will be named as fdoem.iso in the FDOEMCD directory.
You can then upload to Google Drive, FTP, or, depending on the size of the file, attach directly to an email for the customer.

Additional notes:

  • In all cases where modifications are made to the AUTORUN.BAT file, a MOTD has been provided by default in the AUTORUN.BAT. Do not remove this for customer-facing BIOS and firmware update .iso files.
  • If your distribution does not have a mkisofs installation candidate (such as Debian Wheezy), you can substitute the exact command parameters with genisoimage.
  • For the expertly lazy, you can also link genisoimage directly to mkisofs, and this will also enable compatibility with other legacy .iso creation utilities:
    • # ln -s /usr/bin/genisoimage /usr/bin/mkisofs
    • Related Articles

    • Create FreeDos CD from Windows using Rufus

        Download Rufus. ( Create Bootable USB Media) Download attached FDOEM.zip (FreeDos Image Creator) Unzip FDOEM.zip to C:\Temp   Move any files that you want to have available during the DOS session to the C:\Temp\CDROOT folder. Ex. BIOS Updates, IPMI ...
    • Supermicro Update Manager (SUM)

      Introduction The Supermicro Update Manager (SUM) can be used to manage the BIOS and BMC firmware image update and configuration update for select systems. In addition, system checks as well as event log management are also supported. Moreover, ...
    • Introduction to IPMI

      Q: What is IPMI? A: IPMI stands for Intelligent Platform Management Interface. It is in essence a web server that runs internally on your motherboard, powered by a separate ARM-based chip, also known as the baseboard management controller (BMC). The ...
    • BIOS recovery procedure

      Prerequisites: Failed motherboard with F9 POST code Latest BIOS release for your motherboard A FreeDOS / MS-DOS formatted USB drive (see our FreeDOS USB creation guide here) Instructions: If you do not already have a copy of the latest BIOS, head to ...
    • Load IPMI Modules on Linux

      Common Errors: *Not seeing Ipmi information due to no device found. Kernel module may not be loaded. *Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory *Get Device ID command failed *Unable to open SDR ...