FreeDOS

BIOS flash upgrades on Linux

Wednesday, September 23rd, 2009 | linux | 4 Comments

To upgrade your system BIOS you normally need to run a piece of software from the system manufacturer which loads an updated copy of the BIOS into the EPROM chip on your system motherboard – a process known as flashing your BIOS. Most system manufacturers supply BIOS upgrades in a form that will run under DOS or, occasionally, Windows. It is rare to find a BIOS upgrade program that runs under Linux (I’d love to hear about one). Recognising that not all of their customers are necessarily running a 28 year old, 16-bit operating system – some system manufacturers supply their BIOS upgrades in the form of an image which you can burn to a CDROM and boot from (making the question of what OS you are running irrelevant).

I recently had to upgrade the BIOS on one of our Supermicro systems (an X7DVL-E system). Supermicro provide their BIOS upgrades as a ZIP file containing the actual BIOS and a DOS flash program. They also seem to provide some software which you can run on Windows to create a BIOS flash floppy disk (for the younger readers in the audience, that’s another wonderful technology from the 80s, and I’m talking about the super-modern 3.5″ floppy there). I’m not singling out Supermicro for particular criticism here, a lot of the system manufacturers seem to work on the assumption we’re still running PCs with Windows and a floppy drive (to be fair, if you have the optional IPMI management card installed, you can normally upload your firmware through that, but we don’t) – but for those of us running Linux servers, upgrading the BIOS can be a painful process.

There is a work-around for this problem. Thanks to the Linux boot-loader, GRUB – you can boot from a DOS disk image containing your BIOS upgrade program and run the program from within that booted image without ever actually installing DOS or a floppy drive in your system. The following procedure worked well for me on an Ubuntu 9.04 system (with thanks to this OpenSUSE page and and this Ubuntu forums posting for some assistance along the way) and the same approach should work on other distributions.

WARNING: Upgrading your system BIOS is an inherently risky process – with the primary risk being that if things go wrong you can brick your system. Things that can go wrong include flashing your system with a BIOS upgrade for a different system or the power getting interrupted while you are in the middle of a BIOS upgrade. In some cases, you may be able to reflash the BIOS using some emergency procedure but with most systems, you may be looking at a motherboard replacement. So proceed with caution and only upgrade your BIOS if you have a specific problem which the upgrade fixes.

  1. Download a bootable DOS disk image from the FreeDOS distribution site (FreeDOS is an excellent open source version of DOS. It is widely used by hobbyists and companies including Dell, HP and Seagate).
    wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
  2. Download your system manufacturers BIOS upgrade
    wget http://www.example.com/bios/version2.zip
  3. Place the downloaded BIOS upgrade program and files into the downloaded bootable DOS image.
    gunzip FDOEM.144.gz
    sudo mount -o loop FDOEM.144 /mnt
    sudo mkdir /mnt/bios
    cd /mnt/bios
    unzip <path to download BIOS upgrade file>/version2.zip
    umount /mnt
  4. Add the bootable DOS image (with the bios upgrade software) to your Linux bootloader (this requires a file from the syslinux package),
    sudo aptitude install syslinux
    sudo mkdir /boot/dos
    sudo cp /usr/lib/syslinux/memdisk /boot/dos
    sudo cp FDOEM.144 /boot/dos
    sudo vi /boot/grub/menu.lst

    and add the following section to the end of the file

    title DOS BIOS upgrade
    kernel /boot/dos/memdisk
    initrd /boot/dos/FDOEM.144
  5. Reboot your system and choose the DOS BIOS upgrade boot option. If the boot is successful you should shortly be presented with the A:\ DOS boot prompt. At this point you can run the BIOS upgrade software, for example,
    A:\CD BIOS
    A:\FLASH V2BIOS.ROM
  6. Once the upgrade finishes, reboot and enjoy your upgraded system.

Tags: , , , , , , , , ,