BIOS Upgrade using FreeDOS and a USB stick

Most times BIOS upgrades can only be performed via real-mode DOS, which usually means booting from a floppy disk. But many rack-mounted systems unfortunately have neither a CD-ROM drive nor a floppy disk drive. So the most obvious way to boot is using a USB stick.

Assuming that we have a System Rescue USB stick ready, given that it already boots FreeDOS for other purposes, it is fairly easy to modify it for any purpose. If we look in the syslinux.cfg file we can see the following entry:

label freedos
        kernel memdisk
        append initrd=/bootdisk/freedos.img floppy

What it actually means is that it loads memdisk, which emulates a floppy disk containing whatever is in the image file freedos.img. What we will do is change this image file and fill it up with the the contents we want, which is the BIOS upgrade executable.

Mount the USB stick:

# mount /dev/sda1 /mnt/usb

Using your favorite file editor, append the following entry in /mnt/usb/syslinux.cfg:

label biosup
        kernel memdisk
        append initrd=/bootdisk/biosup.img floppy

Now gunzip the freedos.img image and mount it via loopback:

# gzip -dc /mnt/usb/bootdisk/freedos.img > ~/biosup.img
# mount -o loop ~/biosup.img /mnt/tmp/

With the df command you can see that the image is rather full. So we need to delete all unecessary files:

# mkdir ~/tmpdisk
# cp /mnt/tmp/{autoexec.bat,command.com,config.sys,kernel.sys,sys.com} ~/tmpdisk
# rm -rf /mnt/tmp/*
# cp ~/tmpdisk/* /mnt/tmp/
# rm -rf ~/tmpdisk

Finally we copy the bios upgrade executable (for example ~/mybios.exe) to the image, unmount the image, and write it compressed to the USB stick:

# cp mybios.exe /mnt/tmp
# umount /mnt/tmp
# gzip -c ~/biosup.img > /mnt/usb/bootdisk/biosup.img
# umount /mnt/usb

Now boot from USB, and at the syslinux prompt type biosup. Luckily you will soon be in FreeDOS!