All current “IBM-Compatible” PC’s use a Basic Input/Output System also known as a BIOS. It’s a program that tells the PC how to start up when you switch it on, raises any critical faults with the system and then passes control to an operating system on a boot medium.
As time goes on, like any program, bugs are found, improvements are made, and the manufacturer of your PC’s motherboard will provide updates to the BIOS, usually supplied as a small downloadable file. Normally it is usually intended that you reboot your PC onto a DOS-compatible boot floppy disk and run the BIOS update program to install the new BIOS firmware. These days this process has been a bit simplified what with Windows users generally being able to do this from within Windows itself and even more recently, from the BIOS itself or even though starting the system on a FAT16-formatted USB stick.
This is all well and good, but what if you have an older system that cannot be flashed from Windows? What if you don’t even have Windows? What about a system that still relies on booting from a floppy disk to flash the BIOS? I don’t know about you, but I highly doubt any of the remaining floppy disks in my garage work anymore, and besides that, there’s a good chance that the floppy drive itself on older PC’s probably doesn’t work anymore.
So what can you do?
Well, we can utilise a floppy disk image that ultimately boots from your hard-drive, but acts and operates exactly like a DOS floppy disk would.
- A boot floppy disk image. You can grab from from the FreeDOS project. FreeDOS is a compatible open source re-invention of Microsoft or IBM DOS. For our needs, we will use the 1.44MB OEM floppy which has just enough on it to boot the disk and that’s it. The filename is called FDOEM.144.gz.
- Some free space under /boot. This won’t be a concern for most users, but some people, including myself, choose to partition off space for /boot rather than include it as part of the root filesystem partition. You will need about 2MB of space.
- Some floppy disk image manipulation tools. We will be using MTools for the task, available in the Ubuntu repositories.
- The new BIOS file for your motherboard.
- The DOS-based BIOS flashing program executable.
- OPTIONAL: Wine may be required if the BIOS file is provided as a self-extracting Windows executable. In most cases, the flashing program is usually included in the same archive.
These instructions were written with Ubuntu Jaunty in mind but should work on any version of Ubuntu.
- First up, download the FDOEM.144.gz file from the FreeDOS website.
- Extract the image file from the archive either using Ubuntu’s archive manager, or at a terminal use the command:
$ zcat FDOEM.144.gz >dosfloppy.img
- Now we need to install some tools so we can manipulate the image (note that you may already have these tools installed):
$ sudo apt-get install syslinux mtools
- Extract your BIOS file from the archive you downloaded from your motherboard’s manufacturer. If the file was called “bios123.zip”, unzip it with the following command:
$ unzip bios123.zip
NOTE: If your BIOS file is a self-extracting executable (eg: “bios123.exe”, then install WINE with:
$ sudo apt-get install wine
…and then execute the Windows binary via Wine with:
$ wine bios123.exe
…then let the self-extractor extract the files. Retrieve the BIOS file (and if available, the BIOS flashing program executable) from what was extracted.
- Let’s copy the BIOS file and the flashing program onto the boot floppy image. In this example, the BIOS file is called “bios123.bin” and the flashing program is called “flash.exe”:
$ mcopy -i dosfloppy.img bios123.bin flash.exe ::
- Now let’s list the contents of the floppy image to confirm that the files were copied:
$ mdir -i dosfloppy.img ::
Volume in drive : is FREEDOS
Volume Serial Number is 188F-6C25
Directory for ::/
COMMAND COM 66090 2003-12-10 7:49 sys com 9221 2005-07-18 19:58
AUTOEXEC BAT 67 2004-02-22 10:16 CONFIG SYS 52 2004-02-22 10:17
README 1486 2004-02-22 12:50 BIOS123 BIN 1048576 2009-08-11 22:34
FLASH EXE 26351 2009-08-11 22:34
7 files 1 151 843 bytes 258 048 bytes free
- The floppy disk is ready! Now to set it up so we can boot it.
$ sudo mkdir /boot/biosflash
$ sudo cp dosfloppy.img /usr/lib/syslinux/memdisk /boot/biosflash/
- Now we need to make an entry in the GRUB boot menu for it so we can choose it as a boot option when we start the PC. First open the GRUB menu.lst file in your favourite editor:
$ sudo gedit /boot/grub/menu.lst
- Scroll right down to the very bottom of the file and add the following lines:
title Boot floppy for BIOS flashing
initrd /boot/biosflash/dosfloppy.img boot
NOTE: If your /boot directory is on its own partition (like how I have it on my own system), you need to omit the “/boot” bit from all lines above, thus:
title Boot floppy for BIOS flashing
kernel /biosflash/memdisk initrd /biosflash/dosfloppy.img
- Save your changes and quit the editor.
- You are now ready to boot! Shutdown and restart your system. When your GRUB menu appears, you will see an entry called “BIOS floppy for BIOS flashing” at the bottom of the menu. Select it and you should very quickly be presented with the familiar A:\> prompt. You can now launch your BIOS flashing program and flash your BIOS!
- When you are done with the floppy environment, just press CTRL + ALT + DEL to reset your PC (or after a BIOS flash you should ideally physically switch off and then back on instead).