Differences between revisions 20 and 22 (spanning 2 versions)
Revision 20 as of 2020-04-03 10:56:29
Size: 5865
Editor: TobiasFrost
Comment: alternative option to copy fw files accessbile through freedos
Revision 22 as of 2020-04-06 05:57:45
Size: 5865
Editor: PaulWise
Comment: cleanups
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
This page describes how to flash a BIOS, using [[http://debian.org/| Debian]],
[[http://www.freedos.org/|FreeDOS]], [[http://grml.org/| Grml Live Linux]],
This page describes how to flash a BIOS, using [[https://www.debian.org/| Debian]],
[[https://www.freedos.org/|FreeDOS]], [[https://grml.org/| Grml Live Linux]],
Line 23: Line 23:
Line 31: Line 30:
 {{{
 # dmidecode -t bios -t baseboard
 }}}

{{{
# dmidecode -t bios -t baseboard
}}}
Line 41: Line 41:
 {{{
 # mkdir -p /tmp/bios/
 # cd /tmp/bios/
 }}}
Line 46: Line 42:
Move or copy your BIOS update files into your working dir. {{{
# mkdir -p ~/bios/
# cd ~/bios/
}}}

Move or copy your BIOS update files into your working directory.
Line 63: Line 64:
Download a [[http://grml.org/download/|Grml iso.]] `grml-small` is fine. Use [[DebianPkg:grml2usb]] to install Grml to a usb stick: Download a [[https://grml.org/download/|Grml iso.]] `grml-small` is fine. Use [[DebianPkg:grml2usb]] to install Grml to a usb stick:
Line 65: Line 66:
 {{{
 # grml2usb grml96-full_2013.02.iso /dev/sdX1
 }}}
{{{
# grml2usb grml96-full_2013.02.iso /dev/sdX1
}}}
Line 69: Line 70:
Try `man grml2usb` or see http://grml.org/grml2usb/ for more information. See the [[https://grml.org/grml2usb/|grml2usb manual]] for more information.
Line 75: Line 76:
 {{{
 # mkdir -p /media/grml_usb
 # mount /dev/sdX1 /media/grml_usb
 }}}
{{{
# mkdir -p /media/grml_usb
# mount /dev/sdX1 /media/grml_usb
}}}
Line 82: Line 83:
 {{{
 # gunzip -k -S imz --stdout /media/grml_usb/boot/addons/balder10.imz > balder10.img
 # mkdir balder10
 # mount -o loop balder10.img balder10
 }}}
{{{
# gunzip -k -S imz --stdout /media/grml_usb/boot/addons/balder10.imz > balder10.img
# mkdir balder10
# mount -o loop balder10.img balder10
}}}
Line 90: Line 91:
 {{{
 # cp -a FLASH-PROGRAM BIOS-UPDATE balder10/
 }}}
{{{
# cp -a FLASH-PROGRAM BIOS-UPDATE balder10/
}}}
Line 96: Line 97:
 {{{
 # umount balder10
 # cp /media/grml_usb/boot/addons/balder10.imz balder10.imz.bak
 # gzip <balder10.img >/media/grml_usb/boot/addons/balder10.imz
 }}}
{{{
# umount balder10
# cp /media/grml_usb/boot/addons/balder10.imz balder10.imz.bak
# gzip < balder10.img > /media/grml_usb/boot/addons/balder10.imz
}}}
Line 109: Line 110:
Line 114: Line 114:
 {{{
 # umount /dev/sdX1
 # kvm -hdb /dev/sdX
 }}}
{{{
# umount /dev/sdX1
# kvm -hdb /dev/sdX
}}}
Line 120: Line 120:
 {{{
 Addons => Run FreeDOS
 }}}

{{{
Addons => Run FreeDOS
}}}
Line 125: Line 126:
 {{{
 # qemu-system-x86_64 -hda /dev/sdX
 }}}

{{{
# qemu-system-x86_64 -hda /dev/sdX
}}}
Line 147: Line 149:
For Example, flashing a Foxconn H67S motherboard:
Line 148: Line 151:
For Example, flashing a Foxconn H67S motherboard:
 
{{{
 C:\> dir
 C:\> A:
 A:\> dir
 A:\> cd mebios\bios\
 A:\> dir
 A:\> fpt -f C33F1P02.BIN -y
 }}}
{{{
C:\> dir
C:\> A:
A:\> dir
A:\> cd mebios\bios\
A:\> dir
A:\> fpt -f C33F1P02.BIN -y
}}}
Line 158: Line 160:
= Flashing with BIOS FreeDOS from a USB Stick when the flash .exe is too big for a floppy image = Flashing with BIOS FreeDOS from a USB Stick when the flash .exe is too big for a floppy image =
Line 160: Line 162:
It may be that the flash image your manufacturer provides is too large to fit on the floppy image of grml. an alternative is to use a larger FreeDOS image.

you can find freedos image with more space on [[http://joelinoff.com/blog/?p=431|Joe's Blog]]
It may be that the flash image your manufacturer provides is too large to fit on the floppy image of Grml. An alternative is to use a larger FreeDOS image,
you can find FreeDOS images with more space on [[https://joelinoff.com/blog/?p=431|Joe's Blog]]
Line 166: Line 167:
 * [[Firmware/Updates]]
Line 174: Line 176:
 * http://wiki.grml.org/doku.php?id=biosupdate  * https://wiki.grml.org/doku.php?id=biosupdate
Line 176: Line 178:
 * http://www.flashrom.org/Flashrom  * https://www.flashrom.org/Flashrom

Translation(s): none


Flashing a BIOS with FreeDOS and Grml via USB

Most BIOS update utilities for PCs expect to run in a DOS like environment. This page describes how to flash a BIOS, using Debian, FreeDOS, Grml Live Linux, and a USB stick, no matter what Operating System is installed, without using a Windows Operating System.

A USB stick allows the use of >1.2MB files in the FreeDOS image, where the traditional floppy based methods would not work. Many 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!

Preparation

Identifying the motherboard

You should know your motherboard and have any necessary BIOS files available. If you have not identified your motherboard, you should do so now for reference and any potential troubleshooting later. Check any manuals that came with the computer.

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

# dmidecode -t bios -t baseboard

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

Working directory

Make a directory to work in and change into it:

# mkdir -p ~/bios/
# cd ~/bios/

Move or copy your BIOS update files into your working directory.

USB stick

You need USB flash drive that can be completely overwritten. grml2usb should take care of any necessary formatting. Insert the stick, and it will be recognized in the /dev/ system, probably as /dev/sdb with primary partition /dev/sdb1 but this can vary based on your system config.

Note, we will assume that the USB stick is recognized as /dev/sdX with primary partition /dev/sdX1.

Packages

  • grml2usb for copying the downloaded Grml .iso to USB

  • qemu-kvm (optional) for testing the Grml/FreeDOS image

Grml

Install Grml to USB stick

Download a Grml iso. grml-small is fine. Use grml2usb to install Grml to a usb stick:

# grml2usb grml96-full_2013.02.iso /dev/sdX1

See the grml2usb manual for more information.

Option 1: Insert BIOS update into the Grml FreeDOS image

After Grml is installed on a usb stick, mount it, e.g.

# mkdir -p /media/grml_usb
# mount /dev/sdX1 /media/grml_usb

Next we need to unzip and mount the embedded FreeDOS image:

# gunzip -k -S imz --stdout /media/grml_usb/boot/addons/balder10.imz > balder10.img
# mkdir balder10
# mount -o loop balder10.img balder10

Now, just copy any necessary BIOS update files into the mounted image:

# cp -a FLASH-PROGRAM BIOS-UPDATE balder10/

Unmount FreeDOS, re-zip it, and put it back on the USB stick:

# umount balder10
# cp /media/grml_usb/boot/addons/balder10.imz balder10.imz.bak
# gzip < balder10.img > /media/grml_usb/boot/addons/balder10.imz

Option 2: Insert BIOS update into the Grml image

Option 1 did not work for me (I could not find the files afterwards). However, I figured out that the grml media is visible in the FreeDOS environment, in particular the boot/addons directory. It is accessible in FreeDOS as C:\boot\addons.

So it worked for me to copy the bios update files to /media/grml_usb/boot/addons…

Test the FreeDOS image

Unmount the USB stick and test it with Qemu / KVM:

# umount /dev/sdX1
# kvm -hdb /dev/sdX

After booting Grml, select FreeDOS from the menu:

Addons => Run FreeDOS

If you see a message about 'cannot find command.com' then try:

# qemu-system-x86_64 -hda /dev/sdX

Boot into DOS / command.com and check that your BIOS files are present.

Perform the update

We can't flash the BIOS from within Qemu obviously. Now you can reboot from the Grml USB stick and flash your BIOS from FreeDOS running on the metal. You may need to press a key on boot to access the BIOS menu or a boot menu. When the motherboard powers on you ought to see a message about which buttons to press, or check your motherboard manual. Then you can boot into FreeDOS from the USB stick and run the BIOS update program.

Some useful commands in DOS:

  • cd <dir>

    change to the directory

    dir

    list the files in the current directory

    type <file>

    display the contents of a file

    <driveletter>:

    e.g. switch to the A drive

For Example, flashing a Foxconn H67S motherboard:

C:\> dir
C:\> A:
A:\> dir
A:\> cd mebios\bios\
A:\> dir
A:\> fpt -f C33F1P02.BIN -y

Flashing with BIOS FreeDOS from a USB Stick when the flash .exe is too big for a floppy image

It may be that the flash image your manufacturer provides is too large to fit on the floppy image of Grml. An alternative is to use a larger FreeDOS image, you can find FreeDOS images with more space on Joe's Blog

See Also