Friday, June 25, 2010

HOWTO : Make a bootable FreeDOS USB dongle on Ubuntu

As a Linux user, you may encounter a problem to update or upgrade computer's BIOS, RAID card's firmware or else. Most available DOS file is a floppy image that floppy drive is already phased out. A USB based DOS system is a must.

Step 0 :
Install the following packages.

sudo apt-get update
sudo apt-get install makebootfat
sudo apt-get install syslinux


Step 1 :
Make a temp directory for the essential files

cd /tmp
mkdir /tmp/fs-root


Step 2 :
Download the boot files of FreeDOS (the current version is 1.0 at this time of writing).

wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/commandx.zip
wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/kernels.zip
wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/substx.zip
wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/unstablx.zip


Step 3 :
Unzip all the downloaded files.

for ZIP in *.zip; do unzip $ZIP; done

Step 4 :
Copy the following files to the temp directory.

sudo cp ./bin/command.com /tmp/fs-root/
sudo cp ./bin/kernel.sys /tmp/fs-root/


sudo cp ./source/ukernel/boot/fat16.bin /tmp/
sudo cp ./source/ukernel/boot/fat12.bin /tmp/
sudo cp ./source/ukernel/boot/fat32lba.bin /tmp/


sudo cp /usr/lib/syslinux/mbr.bin /tmp/

Step 5 :
Now, insert the already formated USB dongle to the computer. Normally, your USB will be mounted to /dev/sdb and make sure you umount it before creating the bootable DOS USB.

cd /tmp
sudo umount /dev/sdb
sudo /usr/bin/makebootfat -o /dev/sdb -E 255 -1 fat12.bin -2 fat16.bin -3 fat32lba.bin -m mbr.bin /tmp/fs-root


Done!

Reference

That's all! See you.