October 22, 2009

Create DOS Boot Disk for CD or GRUB

Sometimes hardware firmware updates are not available as simple programs you can execute while the OS is running. You have to boot into DOS to flash a motherboard BIOS chip or RAID controller. Here we will take a DOS utility and BIOS update image, copy them onto a DOS boot disk image, and then boot into it, by burning a CD-R or via a GRUB menu option. This is handy because most new hardware comes without a floppy drive.

Download the DOS floppy image and copy the utility in:
# wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.imz
# unzip FDOEM.144.imz
# mount -o loop -t vfat FDOEM.144 /mnt
# cp AWDFLASH.EXE SN78U10Y.BIN /mnt/
# umount /mnt

Now, IF you still have a floppy drive, you can write this to a 1.44 floppy diskette:
# dd if=FDOEM.144 of=/dev/fd0 count=1 bs=1440k

To create a bootable CD-ROM from a floppy disk image:
# mkdir ./t
# cp FDOEM.144 ./t
# mkisofs -r -b FDOEM.144 -c boot.cat -o ./bootcd.iso ./t
# cdrecord -dao -overburn dev=/dev/sr0 speed=8 driveropts=burnfree -vvvv bootcd.iso

If Linux is already installed, I prefer to use a GRUB menu item at boot and not worry about possible external media errors. No need to burn a disc or make a floppy!
# cat FDOEM.144 | gzip > /boot/dosboot.img.gz
# cp /usr/share/syslinux/memdisk /boot/
and add the following to the bottom of your /boot/grub/grub.conf file:
title DOS update utility
root (hd0,0)
kernel /memdisk
initrd /dosboot.img.gz

Further reading:

1 comments:

Azrael808 said...

Wow! This is such a simple, but incredibly useful trick!

I still have a floppy drive on my desktop PC at home, but not my personal and work laptops, so this is exceptionally useful for them!

:)