Flashing a BIOS with FreeDOS and Grml

This page describes how to flash a BIOS, using Debian, FreeDOS and Grml Live Linux. No matter what Operating System is installed. And without using a Windows Operating System.

This allows the use of >1.2MB files in the FreeDOS image. Where other methods would not work with files >1.2MB. Since most BIOS files and tools are bigger than can fit on a floppy image.

If the hardware works, there is often no need to flash the BIOS. If something goes wrong, this might cause permanent damage to your BIOS and you might lose your warranty. Flashing motherboard BIOS is a dangerous activity that can render your motherboard inoperable!

Identifying the motherboard

First you should find the motherboard's manufacturer and the model. Check the user's Manual that comes with your computer, usually there you'll find all needed information.

You can also use the dmidecode package to retrieve some info:

Lastly, if you have physical access to the motherboard, you may find the required information directly on the motherboard itself.

Make a directory to work in and change into it:

FreeDOS

You can use FreeDOS to run the DOS-based BIOS utility from your manufacturer. You must first create a custom FreeDOS image which includes the necessary BIOS tools, and then boot this image via Grml.

Download FreeDOS and tools

Create a custom FreeDOS image

Install the dosfstools,nasm and unzip packages, if not already installed:

Create an image file of ~20MB using dd:

Write a file system to the image:

Write the bootsector to the image file:

Now we need to copy the FreeDOS files to our new image. Create the mountpoints:

Mount the original image:

Mount the new image:

Copy the FreeDOS system files to our new image:

Now you should also copy your flash program and the new BIOS to the image file:

List freedos-new to make sure the files are there:

Unmount both images:

Using Grml on a usb stick to boot FreeDOS

Download a Grml iso.

Use either the dd command or the grml2usb package to install Grml to a usb stick.

NOTE: ANY existing data on your USB device will be destroyed when using the dd approach.

For more information on grml2usb, usage and FAQ:

Also available at the grml2usb page.

After Grml is installed on a usb stick and mounted. Copy the freedos.img to Grml:

Now backup the Grml FreeDOS version:

Use gzip to create a balder10.imz file using the freedos.img we created earlier:

Optionally now test with kvm:

After booting Grml, select FreeDOS from the menu:

Then, select:

If after testing with kvm, Grml boots the custom FreeDOS image and your BIOS files are present. Now you can flash your BIOS by using the Grml usb stick. Following the manufacturers instructions.

Some useful commands in DOS:

For Example, flashing a Foxconn H67S motherboard:

When done flashing the BIOS. Mount the Grml usb stick, remove freedos.img and balder10.imz. Move balder10.imz.org back to balder10.imz:

See Also