It is sometimes necessary, even in this day and age, to use DOS or
some other simple operating system to directly access hardware to
perform tasks such as BIOS upgrades. Floppies, the traditional boot
media for quick and dirty tasks such as this, are almost extinct. CD's
are cumbersome to use and change. It is therefore handy to use
some other portable external bootable media for jobs such as
this. Enter the bootable USB key.
FreeDOS is a handy open source alternative to
MS-DOS, but it only comes as a CD image that must be burned to a CD
and then installed to a hard drive in order to be usable. This makes
it a bit cumbersome to install on a USB key.
I took a somewhat circuitous route to arrive at these
instructions, which included installing FreeDOS in a VMware Fusion
virtual machine, copying that virtual disk to a flat image file,
moving that image file into a Ubuntu virtual machine, byzantine
manipulations of a USB flash drive with dd, and learning more
about FAT and MBR than I ever wanted to know. Hopefully the distilled
instructions below are a little easier.
I assume that you have a Linux capable of running QEMU (there is a version of QEMU for OS X). You don't need
to use QEMU... but it makes it easier to try different things are
repeat the process while still doing other things, since you don't
have to reboot all the time.
- Download the FreeDOS installer ISO from FreeDOS.org.
- Partition your USB flash drive as you please. You should have at
least one FAT32 primary partition on which you will install
FreeDOS.
- Run qemu-launcher. Set it to boot from CD-ROM, and set the CD-ROM
path to point to the FreeDOS ISO you just downloaded. Set hard disk
path to point at the raw flash device (something like /dev/sdb... find
out from dmesg).
- Launch qemu. It should boot the FreeDOS installer. Install FreeDOS
on the "hard drive". I recommend installing just the base set of
packages, unless you want to experiment with networking, etc in FreeDOS.
- If you don't need multiboot, you are done.
- Close QEMU, unplug the flash drive, and try to test it on a real system. If you have trouble, like it says that no OS is found, it may be necessary to run QEMU again in the same way as before, except instead of using the installer, use the live CD and run fdisk /mbr and sys c: to make sure the drive is fully bootable.
If you want to use multiple OS's on the flash drive, then you can
install grub and set it up to boot each one. But that's for a later
post...