BIOS Update

From Gentoo Wiki
Jump to: navigation, search
This page contains changes which are not marked for translation.

Other languages:
English • ‎français • ‎日本語 • ‎한국어 • ‎русский • ‎中文(中国大陆)‎

Hardware manufactures often provide updates for BIOS and other types of firmware. To apply (often referred to as "flash") the updates is sometimes not straight forward on GNU/Linux systems. This occasionally requires some extra work.

Warning
If the hardware is operational there is often no need to upgrade the BIOS. If something goes wrong permanent damage may be caused to the BIOS or system firmware that may expire the hardware warranty. Proceed with caution!

Gather firmware information

First find the motherboard's manufacturer and the model. Check the user manual that came with the system. Mos to of needed information can be found in the user manual.

The sys-apps/dmidecode package can be used to retrieve additional information on system hardware. dmidecode looks at the motherboard's DMI table in order to provide richer details about the firmware and hardware components.

root #dmidecode -t bios -t baseboard

Lastly, if physical access to the motherboard is possible required information may be found directly on the motherboard itself.

Warning
Accessing the motherboard of a computer may cause loss of warranty!

After some searching for where the manufacturer stores firmware update, proceed to download the package necessary to update the hardware. It is normal for a manufacturer to store firmware update packages in .zip, .exe, or .iso format.

user $unzip 7235v1A.zip
Archive:  7235v1A.zip
   creating: 7235v1A/
inflating: 7235v1A/7235v1x.txt
inflating: 7235v1A/AWFL865.EXE
inflating: 7235v1A/How to flash the BIOS.DOC
inflating: 7235v1A/W7235IMS.1A0

BIOS option

Many BIOS have an option to read the new binary image from an external memory stick or floppy disk. If this is the case all that is required is to enter the BIOS setup and look for the option.

Boot-CD

Often the manufacturer offers a CD-ROM image to download as a boot medium. The file should have a .iso file extension which can typically be burnt to an empty CD-R(W). cdrecord can be used in order to burn the image to a disk.

root #cdrecord BOOT-CD.iso
Note
cdrecord is provided by two packages. Choose one of the following for installation: app-cdr/cdrtools and app-cdr/cdrkit.

Choose from the BIOS boot menu to boot from CD and follow the instructions on the manufacturers website or in the user manual.

FreeDOS environment

FreeDOS can be used to run DOS-based BIOS update utilitys. A "custom" FreeDOS image which includes the necessary BIOS tools must be created. After the custom image has been generated boot the image via one of the methods shown below.

Download FreeDOS and tools:

  • FreeDOS - Download the fdboot.img file.
  • FreeDOS bootsector - Download the sys-freedos-linux.zip file.
  • The DOS-Flash program and new BIOS from the manufacturers website.

Create a custom FreeDOS image

First download the required software and enable the loopback device in the kernel:

KERNEL enable loopback device
Device Drivers  --->
    [*] Block devices  --->
        <M>   Loopback device support

If the module has not been loaded use modprobe to load it:

root #modprobe loop

Install the required software:

root #emerge --ask dev-lang/nasm
This template uses deprecated syntax.

Create an image file of ~20MB using the dd command. The name needs to be freedos.img when replacing the one on the SystemRescueCD):

root #dd if=/dev/null of=freedos.img bs=1024 seek=20480

Write a file system to the image:

root #mkfs.msdos freedos.img

Write the bootsector to the image file:

root #unzip sys-freedos-linux.zip && ./sys-freedos.pl --disk=freedos.img

Now copy the FreeDOS files to the new image.

Create the mountpoints:

root #mkdir -p /mnt/freedos /mnt/freedos_new

Mount the original image:

root #mount -o loop fdboot.img /mnt/freedos

Mount the new image:

root #mount -o loop freedos.img /mnt/freedos_new

Copy the FreeDOS system files to the new image:

root #cp -ar /mnt/freedos/* /mnt/freedos_new/

Now copy the flash program and the new BIOS to the image file:

root #cp -ar FLASH-PROGRAM BIOS-UPDATE /mnt/freedos_new

Unmount both images:

root #umount /mnt/freedos_new /mnt/freedos
Note
DOS can only display names up to a length of 8 characters. It is a good idea to rename some of the files if their filenames are longer than this limit.

Using SystemRescueCD to boot FreeDOS

The SystemRescueCD comes with a version of FreeDOS. This version can replace the original image and create a bootable memory stick which contains the needed programs to flash the firmware.

Download SystemRescueCD and prepare LiveUSB

Create a bootable memory stick

Use the default method to create the SystemRescueCD boot medium, the script usb_inst.sh will provide guidance through the installation.

Warning
This will delete any data on the memory stick! Be sure all data has been properly backed up before using the memory stick for this task!

Create the folder in /mnt:

root #mkdir /mnt/SysRescueCD

Mount the CD image:

root #mount -o loop systemrescuecd-x86-VERSION.iso /mnt/SysRescueCD

Start the installation script:

root #/mnt/SysRescueCD/usb_inst.sh

Unmount the CD image:

root #umount /mnt/SysRescueCD

Replace the FreeDOS image

It is time to replace the original FreeDOS image on the SystemRescueCD memory stick.

Mount the SystemRescueCD memory stick (/dev/sdX1 needs to be replaced by the device name of the memory stick):

root #mount /dev/sdX1 /mnt/SysRescueCD

Replace the freedos.img file:

root #cp freedos.img /mnt/SysRescueCD/bootdisk/

Unmount the SystemRescueCD memory stick:

root #umount /mnt/SysRescueCD

Booting the FreeDOS image from GRUB directly

To boot FreeDOS without any external media use the memdisk tool from syslinux to allow grub (or another bootloader) to boot the FreeDOS image directly.

root #emerge --ask sys-boot/syslinux

Mount the /boot partition (if needed):

root #mount /boot

Copy the memdisk binary, and the newly built FreeDOS image to /boot:

root #cp /usr/share/syslinux/memdisk /boot
root #cp freedos.img /boot

Edit /boot/grub/grub.conf and add an entry for FreeDOS:

FILE /boot/grub/grub.confExample grub.conf entry
title FreeDOS (BIOS update)
kernel /boot/memdisk floppy
initrd /boot/freedos.img

BIOS update

Restart and choose to boot from the USB memory stick or the new grub entry. When using SystemRescueCD, in the GRUB command line type:

freedos

This should boot into the new FreeDOS image. DOS prompt should appear:

CODE
C:\

Now start the BIOS update by following the manufacturers instructions. Some useful commands in DOS:

cd <dir>
Change to the directory.
dir
List the files in the current directory.
type
Display the contents of a file.

Flashrom