Skip to content

Instantly share code, notes, and snippets.

@samtingleff
Created December 23, 2009 04:25
Show Gist options
  • Save samtingleff/262307 to your computer and use it in GitHub Desktop.
Save samtingleff/262307 to your computer and use it in GitHub Desktop.
How to create a 4MB FreeDOS boot disk for eg, doing a motherboard bios upgrade.
Originally from http://www.linuxinsight.com/how-to-flash-motherboard-bios-from-linux-no-dos-windows-no-floppy-drive.html
The following is a brief outline of how I created a 4MB CD boot image to update the bios on a motherboard I have been considering buying.
I do not have this motherboard, but I have tested the bootable CD up to the point of actually flashing the bios.
FWIW, my computer runs PATA / IDE HDs and optical drives. Not SATA.
Adjust accordingly to your distro, hardware, etc.
I'm human, and make typos on occasion. So double check your input.
(Also, CD-RWs are great to practice on :D)
This is a compilation of various web pages, including the following:
http://www.tuxrocks.com/Projects/CDProject/
http://members.chello.at/bobby100/ILpart1.htm
http://afs.caspur.it/afs/italia/project/bigbox/e4/x86_64/latest/isolinux/isolinux.cfg
http://ubuntuforums.org/archive/index.php/t-19428.html
And this one, of course :)
1. Create and cd to ~/bootcd
2. Download and gunzip FDOEM.144.gz
3. Create ~/bootcd/floppy
4. Loop mount FDOEM.144 and copy the loop mounted files to ~/bootcd/floppy
# mount -o loop -t vfat FDOEM.144 /mnt/floppy
$ cp -r /mnt/floppy/* ~/bootcd/floppy/
5. Unmount FDOEM.144
6. Create empty 4MB image: (Or whatever size you need.)
$ dd if=/dev/zero of=disk.img bs=1M seek=4 count=0
7. Create a DOS file system on the empty 4MB image
$ mkdosfs disk.img
8. Insert the FDOEM.144 boot sector into the 4MB disk image
(copy the 446 byte boot code from the 1.44MB floppy image.)
$ dd if=FDOEM.144 of=disk.img bs=1 count=446 seek=62 skip=62 conv=notrunc
9. Loop mount the 4MB image:
# mount -o loop -t vfat disk.img /mnt/floppy
10. Copy files from ~/cdboot/floppy to /mnt/floppy
# cp ~/cdboot/floppy/* /mnt/floppy/
11. Copy required BIOS files to /mnt/floppy
# cp DP0507C.BIO /mnt/floppy
# cp IFLASH.EXE /mnt/floppy
12. Unmount the 4MB image
13. You may now need to install the 'SYSLINUX' package for your distro, or download the tarball from:
http://syslinux.zytor.com/wiki/index.php/Download
I used the Ubuntu-8.04.1 package, and it seemed to work OK for this purpose.
14. Copy isolinux.bin to ~/bootcd
$ cp /usr/lib/syslinux/isolinux.bin ~/bootcd/
15. Copy memdisk to ~/bootcd
$ cp /usr/lib/syslinux/memdisk ~/bootcd/
16. Create ~/bootcd/bootmsg.txt
$ nano bootmsg.txt
$ cat bootmsg.txt
BIOS Update
17. Create ~/bootcd/isolinux.cfg
$ nano isolinux.cfg
$ cat isolinux.cfg
default Bios
prompt 1
timeout 1800
display bootmsg.txt
label Bios
kernel memdisk
append initrd=disk.img floppy c=10 h=64 s=32
18. You may now delete or move FDOEM.144 and ~/cdboot/floppy
$ cd ~/cdboot
$ rm FDOEM.144
$ rm -r floppy
19. Your ~/bootcd directory listing should now look something like this:
$ ls -al ~/bootcd
total 7728
drwxr-xr-x 2 username username 4096 2009-01-01 21:25 .
drwxr-xr-x 23 username username 4096 2009-01-01 21:21 ..
-rw-r--r-- 1 username username 12 2009-01-01 21:19 bootmsg.txt
-rw-r--r-- 1 username username 4194304 2009-01-01 21:20 disk.img
-rw-r--r-- 1 username username 14061 2009-01-01 21:25 isolinux.bin
-rw-r--r-- 1 username username 143 2009-01-01 21:20 isolinux.cfg
-rw-r--r-- 1 username username 20068 2009-01-01 21:21 memdisk
$
20. Create ISO image:
$ cd ~/bootcd
$ genisoimage -o cdproject.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
21. Burn ~/bootcd/cdproject.iso
(Remember to adjust these options to your distro and hardware accordingly.)
$ wodim -v -dao -eject speed=2 driveropts=burnfree dev=/dev/scd1 -data cdproject.iso
22. Boot from CD and test.
End of proceedure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment