Bootable CDs for BIOS flashing under Linux

Imagine you have a machine running Linux with no floppy drive. You want to flash the BIOS, and the manufacturer's web site insists that you boot into Windows 95/98 command line mode to do it.

If you have a floppy drive you can go to bootdisk.com or various other places and get a floppy image that will do the job. Booting off a memory stick is another option. But if you only have a CD as a boot device you may be a bit stuck. I have been in this situation a couple of times and am documenting what I've done mainly for my own benefit, but also because I can't find another web page that has all this information in one place.

I assume that you have a Windows 95/98 install CD. (Doesn't everyone?) You can use this to boot to a DOS prompt, but of course with no floppy drive and no access to memory sticks you can't get at the files you need for the BIOS flash. So the trick is to burn another CD that contains those files as well and is bootable.

You will need standard CD burning tools (cdrecord or wodim), mkisofs, and the geteltorito script (part of the genisoimage package in Debian etch).

Insert the original CDROM and do

geteltorito /dev/hdc > elt.bin
(I assume throughout you're working in some suitable scratch area). Then copy the rest of the CD to a working directory:
mkdir win98
cd win98
cp -R /cdrom/* .
We've copied all of the CD contents -- we don't need 99% of it, but disc space is cheap and we don't want to waste time figuring out what is actually required.

Eject the CDROM, so we remember not to try to over-write it!

eject /cdrom
Copy the El Torito info into this tree, as we need it to be there to make the file system (it doesn't cause any problems that it will be a visible file at the DOS prompt)
cp ../elt.bin .
(elt.bin contains an image of a DOS boot floppy, which will appear in A: after we've booted. So you can just make a bootable CD that only contains an image like this, and make sure your files are in it by mounting it using loopback. That doesn't work for large BIOS flash files, though. We'll do it the easy way.)

Copy the BIOS flash files to a suitable place in the win98 directory

mkdir flash
cp ../my-bios-files/* flash
Now make the ISO fs:
cd ..
mkisofs -o win98.iso -b elt.bin win98
The -b here is the crucial bit. Finally, insert a blank CD and burn it:
wodim -v win98.iso
(or cdrecord -v, if that's what you have).

Now you can boot from the CD. If you have a Win 98 CDROM, select 'Boot from CDROM', press shift-F8 for step-by-step verification of bootup commands when you get the chance, say 'start computer with CDROM support' and then say N to any driver that doesn't mention the CD (ie anything without CD in the file being loaded). At the end of this you will have a minimal bootup with an A:\ and D:\ drive, A:\ being the pseudo-floppy image of elt.bin. Go to the D:\ drive, find the files you added, and flash the BIOS.

(Obviously no responsibility is accepted if this doesn't work for you and you end up bricking your expensive computer. Follow your manufacturer's instructions for BIOS flashing carefully and if they aren't compatible with what I suggest above then don't do it!)