Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old December 11th, 2006   #1
ciscosurfer
Chocolate-Covered Ubuntu Beans
 
ciscosurfer's Avatar
 
Join Date: Jun 2006
Beans: 2,314
Ubuntu 10.04 Lucid Lynx
Post HOWTO: Flash BIOS, The Ubuntu Way

HOW TO FLASH YOUR BIOS

WARNING
BIOS flashing is destructive. If you don't understand what this means, start reading here and here. Read these documents and all related documents very carefully.

RELEASE COMPATIBILITY, Ubuntu 32-bit/i386

10.10 Maverick Meerkat · 10.04 Lucid Lynx · 9.10 Karmic Koala · 9.04 Jaunty Jackalope · 8.10 Intrepid Ibex · 8.04 Hardy Heron · 7.10 Gutsy Gibbon · 7.04 Feisty Fawn · 6.10 Edgy Eft · 6.06 Dapper Drake · 5.10 Breezy Badger · 5.04 Hoary Hedgehog · 4.10 Warty Warthog

UPDATE
Many vendors now include native Linux utilities to assist in a BIOS flash (or replacement). If you fit into this category then it is recommended to use the method provided by them. Another example: Dell has the biosdisk project. You can also try your luck with the flashrom project (more on flashrom below). If you know what you are doing, are feeling daring, or just want to know a little more about this topic, then continue reading.

BACKGROUND

Flashing a BIOS typically serves the following functions: to fix specific bugs, to support newer hardware, or to fix a damaged BIOS. Using Ubuntu Linux as our host OS, we will create a bootable floppy disk or CD using FreeDOS as our OS of choice. On this disk we will place a new BIOS image and any related files used for flashing. Once the disk has been created, reboot the system and allow your newly created disk to load automatically and begin the flashing process. See your particular BIOS vendor's web site for these files and for more information on the commands you will to need to use to begin the flashing process. In other words, read what your BIOS vendor has to say about flashing. READ the README file.

BIOS INFORMATION

Learn more about your BIOS and its features (e.g., make, vendor, release date).
Code:
sudo biosdecode
sudo hwinfo --bios | less
sudo dmidecode --type bios
sudo lshw
gksudo lshw-gtk
TIPS & WARNINGS (YOU SHOULD READ THESE)
Note
Flashing your BIOS is a potentially dangerous activity that can render your motherboard (and computer, for that matter) inoperable. Proceed with caution and fully understand what you are doing before attempting the commands below! The only way to reverse the commands below is to make a copy of your current BIOS configuration and re-flash or by reinstalling the original BIOS to your motherboard.

CMOS Jumpers
Some motherboards have CMOS Jumpers that need to be cleared to perform a successful BIOS flash. More on this topic here & here.

ACPI-Related Issues
Sometimes these issues can be fixed by updating your BIOS. If after flashing your BIOS you still encounter power/fan/thermal problems, this thread will describe how to modify your DSDT file in an attempt at fixing common ACPI-related issues. More on ACPI here and here.

GRUB 2
The third method uses the GRUB bootloader to our bidding. It's meant to be used with original GRUB and not with GRUB 2.
If you need or want to use GRUB 2, check out The GRUB 2 Guide or the GRUB 2 manual for ideas.

Flashrom
This method utilizes an app called flashrom to update your BIOS without having to reboot your system. It is a utility for identifying, reading, writing, verifying, and erasing flash chips (http://www.flashrom.org/Flashrom). It's often used to flash BIOS/EFI/coreboot/firmware images. Read the compatibility chart to see whether your BIOS is supported or if proposed workarounds have been suggested. Check the following links for more information. Pádraig Brady offers up this page as well. More info can be found at the main project site here, on wikipedia here, on apcmag.com here, and on desktoplinux.com here.

Unetbootin & USB Flash
Ideas on using unetbootin and/or USB flash drives, thumb drives, sticks, etc., can be found here and here. Some comments here discuss making bootable USB flash drives as well.

Size Contraints
In cases where the new BIOS image and related files are larger than 1.44MB, you can go here or here to learn about creating or using customized boot disks of larger sizes to help in flashing your BIOS. As an alternative, you can try the third method listed below that uses GRUB to update your BIOS. See above for ideas on modifying config files if using GRUB 2 as your boot loader.

Still Not Sure?
If you don't know what you are doing or feel unsafe at this point, it is highly recommended to ask for help or consult a professional.


METHODS
Carefully read through all methods.
Pick a method that best suits your situation.
Understand what you are doing before you begin.
Read the
TIPS & WARNINGS section above for additional insight.

YOU WILL NEED THE FOLLOWING:
1) FreeDOS, specifically, this image: http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
2) New BIOS image + flashing tool to be found at the web site of your motherboard/BIOS/OEM vendor.


M1: FLOPPY

Unpack FreeDOS image → copy image to floppy disk → create temp floppy dir → mount floppy copy flashing tool and new BIOS image to /tmp/floppy (see footnotes below) → reboot following vendor instructions

Note: "NewBiosFiles" listed below is pseudocode for the extracted location of the new BIOS image + related files that you just downloaded
Code:
wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
gunzip FDOEM.144.gz
dd if=FDOEM.144 of=/dev/fd0
mkdir /tmp/floppy
sudo mount /dev/fd0 /tmp/floppy
sudo cp ~/NewBiosFiles/* /tmp/floppy
Once the command has finished executing, mount the floppy and copy the new BIOS image + flashing tool onto it. That's all there is to it. Reboot, flash BIOS with commands provided by the BIOS vendor. Check the README file for exact syntax.
END OF METHOD


M2: CD
Unpack FreeDOS image → create temp dir → mount FreeDOS image to /tmp/cdr → copy flashing tool and new BIOS image to /tmp/cdr (see footnotes below) → unmount image → install mkisofs → create ISO → burn ISO to disc → reboot following vendor instructions

Note: "NewBiosFiles" listed below is pseudocode for the extracted location of the new BIOS image + related files that you just downloaded
Code:
wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
gunzip FDOEM.144.gz
mkdir /tmp/cdr
sudo mount -t vfat -o loop FDOEM.144 /tmp/cdr
sudo cp ~/NewBiosFiles/* /tmp/cdr
sudo umount /tmp/cdr
sudo apt-get install mkisofs
mkisofs -o newBIOS.iso -b FDOEM.144 FDOEM.144
cdrecord -v newBIOS.iso
[note: in later releases, /usr/bin/mkisofs symlinks to /usr/bin/genisoimage]
[note: in later releases, /usr/bin/cdrecord symlinks to /usr/bin/wodim]

Reboot from the CD and flash your BIOS with the commands provided by the BIOS vendor. Check the README file for exact syntax.
END OF METHOD


M3: GRUB (GRUB 2 users, read GRUB 2 links under TIPS & WARNINGS above)
Download FreeDOS image and unpack → create temp dir → mount image to temp dir extract flashing utility and new BIOS image to temp dir → unmount image, remove temp dir → move image to new file to be used by GRUB → install syslinux to provide memdisk for booting → copy memdisk to /boot dir reboot choosing biosupdate.img option from GRUB menu
Code:
wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
gunzip FDOEM.144.gz
mkdir /tmp/floppy
sudo mount -t vfat -o loop,quiet,umask=000 FDOEM.144 /tmp/floppy
unzip newBIOS.zip -d /tmp/floppy
sudo umount /tmp/floppy
rmdir /tmp/floppy
sudo mv FDOEM.144 /boot/biosupdate.img
sudo apt-get install syslinux
sudo cp /usr/lib/syslinux/memdisk /boot/
Code:
sudo vim /boot/grub/menu.lst
Now add the following to your GRUB menu
Code:
title       BIOS upgrade
kernel      /boot/memdisk
initrd      /boot/biosupdate.img
END OF METHOD

INSPIRATION

HOWTO:Flash Your Bios...
No DOS/Windows, No floppy...

FOOTNOTES
You've likely downloaded an executable file (an .exe file) containing your new BIOS image and flashing utility. There may be other files that you wish to copy over, such as an AUTOEXEC.BAT file to automate the process. In addition, you'll probably find a README file of some sort that will describe the appropriate syntax to use when flashing. To get at these files, use unzip to de-archive the executable file. Install unzip via your favorite package manager.

Last edited by ciscosurfer; July 20th, 2010 at 05:54 PM.. Reason: updated release compatibility to include Maverick Meerkat 10.10
ciscosurfer is offline   Reply With Quote
Old December 17th, 2006   #2
bodhi.zazen
Ubuntu Guru
 
bodhi.zazen's Avatar
 
Join Date: Apr 2006
Location: Montana
My beans are hidden!
Xubuntu Development Release
Send a message via Yahoo to bodhi.zazen
Re: HOWTO: Flash BIOS, The Ubuntu Way

Nice How-to

This thread has been added to the UDSF wiki.

Flash_Bios

Thanks Crane
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999

bodhi.zazen is offline   Reply With Quote
Old December 19th, 2006   #3
dannyboy79
Ubuntu addict and loving it
 
dannyboy79's Avatar
 
Join Date: May 2006
Location: Milwaukee,WI
Beans: 4,419
Ubuntu 10.04 Lucid Lynx
Send a message via AIM to dannyboy79
Re: HOWTO: Flash BIOS, The Ubuntu Way

i used this to flash my foxconn motherboard and everytime I would get to the part in the award bios flasher it would say, press y to program or n to cancel and I would hit y and it would just sit there????? i di itover and over, made new disks, to no avail, then I thought I recaled reading along time ago about some motherboards having a jumper that is used to clear the cmos ( i believe this is what holds the bios settings) and that if this jumper is in place the bios is unwritable. well, i removed the jumper temporarily and sure enough, my new bios was flashed on the motherboard and I am now not getting the apic errors in my syslog anymore about the cpu error 40 something or other. anyway.

I think you should FYI people about a possibler jumper preventing them from writing to the cmos or bios or whatver the term is. hope this helps others.
dannyboy79 is offline   Reply With Quote
Old December 19th, 2006   #4
ciscosurfer
Chocolate-Covered Ubuntu Beans
 
ciscosurfer's Avatar
 
Join Date: Jun 2006
Beans: 2,314
Ubuntu 10.04 Lucid Lynx
Re: HOWTO: Flash BIOS, The Ubuntu Way

Quote:
Originally Posted by dannyboy79 View Post
i used this to flash my foxconn motherboard and everytime I would get to the part in the award bios flasher it would say, press y to program or n to cancel and I would hit y and it would just sit there????? i di itover and over, made new disks, to no avail, then I thought I recaled reading along time ago about some motherboards having a jumper that is used to clear the cmos ( i believe this is what holds the bios settings) and that if this jumper is in place the bios is unwritable. well, i removed the jumper temporarily and sure enough, my new bios was flashed on the motherboard and I am now not getting the apic errors in my syslog anymore about the cpu error 40 something or other. anyway.

I think you should FYI people about a possibler jumper preventing them from writing to the cmos or bios or whatver the term is. hope this helps others.
Thanks for the tip. I've added this information into my HOWTO as an "EDIT".

Glad this HOWTO was helpful for you.
ciscosurfer is offline   Reply With Quote
Old May 5th, 2007   #5
gaxxter
First Cup of Ubuntu
 
Join Date: May 2007
Beans: 1
Re: HOWTO: Flash BIOS, The Ubuntu Way

Hi, I can't be bothered with the hassle to update manually so get a biosflash company to do my work 4 me, got a new chip with latest bios and use the old one as a back up for future failure!!! hope not
gaxxter is offline   Reply With Quote
Old May 5th, 2007   #6
ciscosurfer
Chocolate-Covered Ubuntu Beans
 
ciscosurfer's Avatar
 
Join Date: Jun 2006
Beans: 2,314
Ubuntu 10.04 Lucid Lynx
Re: HOWTO: Flash BIOS, The Ubuntu Way

Quote:
Originally Posted by gaxxter View Post
Hi, I can't be bothered with the hassle to update manually so get a biosflash company to do my work 4 me, got a new chip with latest bios and use the old one as a back up for future failure!!! hope not
That's definitely one way to do it!
ciscosurfer is offline   Reply With Quote
Old May 8th, 2007   #7
Rhubarb
Fresh Brewed Ubuntu
 
Rhubarb's Avatar
 
Join Date: Aug 2006
Location: Australia
Beans: 1,383
Ubuntu 10.04 Lucid Lynx
Re: HOWTO: Flash BIOS, The Ubuntu Way

This is a great + very important thread.
Thanks
__________________
Work smart, not hard.
Rhubarb is offline   Reply With Quote
Old May 8th, 2007   #8
quail-linux
Just Give Me the Beans!
 
quail-linux's Avatar
 
Join Date: Mar 2006
Location: Australia
Beans: 80
Send a message via ICQ to quail-linux
Wink Re: HOWTO: Flash BIOS, The Ubuntu Way

Hi ciscosurfer

Great Howto, i found it very helpful
__________________
PC: Core 2 Duo 2.66GHz, 4096MB Ram - Debian 5.0.3
Laptop: Acer Aspire Timeline 4810T - Core 2 Solo 1.4GHz, 4096MB Ram - Debian 5.0.3

quail.southernvaleslug.org - Ubuntu user #60
quail-linux is offline   Reply With Quote
Old May 9th, 2007   #9
loyeyoung
5 Cups of Ubuntu
 
Join Date: Nov 2006
Location: Laredo, Texas
Beans: 25
Send a message via Skype™ to loyeyoung
Exclamation There is a MUCH easier way.

I'm glad you got it to work for you, but it's not a good solution.
  1. Relies on software not tested in Debian or Ubuntu
  2. Not fault tolerant -- too easy to mess up your system.
  3. There is a much better way.

Here's the RIGHT way to do it:

(I am assuming you have obtained the BIOS update files from a reliable source, that they are unzipped and stored in a separate directory in your home directory, and no other files are in that directory.)

1. Use your favorite package manager (Synaptic, Adept, aptitude, etc.) to install the dosemu package and the packages it recommends and suggests.

2. Open Konsole.

3. At the command prompt, type:
Code:
user@localhost:~$ xdosemu
4. Read the warnings. When you understand them, type "yes" (no quotes) where prompted.

5. A DOS window will open.

6. Insert a floppy in your floppy drive. Note the capacity of the disk you are using. Most are 1.44MB, but there are others floating around.

7. At the C:\ prompt, type:
Code:
C:\ format a: /S /F:[number of KILOBYTES of your disk] /V:[SOMENAME]
and press Enter on your keyboard. You need to replace "[number of KILOBYTES of your disk]" with the size of your disk, in kB. For instance, if your floppy is a 1.44MB, you would use 1440. For 720kB, use 720, etc. Replace "[SOMENAME]" with a name that helps you remember what the disk is. In my case, I typed:
Code:
C:\ format a: /S /F:1440 /V:BIOS-UPDATE
8. To find your files:
Code:
C:\ d:
D:\ ls
This will give you a directory list of your home directory. Dosemu maps your home directory to the DOS D: drive. You will note that Dosemu mangles the filenames in order to make them 8.3 filename compliant. Not to worry, it hasn't done anything to them; you'll just have to decide based on the first few characters of the actual file name. The commands "cd" (change directory") and "ls" (list) are your friends.

9. Copy your BIOS files from their directory (we'll call it "STOREDIR" as an example) to the floppy:
Code:
D:\ copy BIOSDIR\* a:\
XYZ123.BIN => a:\XYZ123.BIN
AUTOEXEC.BIN => a:\AUTOEXEC.BIN
BFLASH.EXE => a:\BFLASH.EXE
OTHERFILE.COM => OTHERFILE.COM
D:\
10. Exit Dosemu:
Code:
D:\ exitemu
11 Now, back at the Konsole terminal, unmount the floppy and exit:
Code:
user@localhost:~$ umount /dev/fd0
user@localhost:~$ exit
12. Follow the instructions of the BIOS vendor.

Happy Trails,

Loye Young
http://www.iycc.net
Laredo, Texas

Last edited by loyeyoung; May 9th, 2007 at 09:50 PM..
loyeyoung is offline   Reply With Quote
Old May 9th, 2007   #10
quail-linux
Just Give Me the Beans!
 
quail-linux's Avatar
 
Join Date: Mar 2006
Location: Australia
Beans: 80
Send a message via ICQ to quail-linux
Re: There is a MUCH easier way.

Quote:
Originally Posted by loyeyoung View Post
I'm glad you got it to work for you, but it's not a good solution.
  1. Relies on software not tested in Debian or Ubuntu
  2. Not fault tolerant -- too easy to mess up your system.
  3. There is a much better way.

Here's the RIGHT way to do it:

(I am assuming you have obtained the BIOS update files from a reliable source, that they are unzipped and stored in a separate directory in your home directory, and no other files are in that directory.)

1. Use your favorite package manager (Synaptic, Adept, aptitude, etc.) to install the dosemu package and the packages it recommends and suggests.

2. Open Konsole.

3. At the command prompt, type:
Code:
user@localhost:~$ xdosemu
4. Read the warnings. When you understand them, type "yes" (no quotes) where prompted.

5. A DOS window will open.

6. Insert a floppy in your floppy drive. Note the capacity of the disk you are using. Most are 1.44MB, but there are others floating around.

7. At the C:\ prompt, type:
Code:
C:\ format a: /S /F:[number of KILOBYTES of your disk] /V:[SOMENAME]
and press Enter on your keyboard. You need to replace "[number of KILOBYTES of your disk]" with the size of your disk, in kB. For instance, if your floppy is a 1.44MB, you would use 1440. For 720kB, use 720, etc. Replace "[SOMENAME]" with a name that helps you remember what the disk is. In my case, I typed:
Code:
C:\ format a: /S /F:1440 /V:BIOS-UPDATE
8. To find your files:
Code:
C:\ d:
D:\ ls
This will give you a directory list of your home directory. Dosemu maps your home directory to the DOS D: drive. You will note that Dosemu mangles the filenames in order to make them 8.3 filename compliant. Not to worry, it hasn't done anything to them; you'll just have to decide based on the first few characters of the actual file name. The commands "cd" (change directory") and "ls" (list) are your friends.

9. Copy your BIOS files from their directory (we'll call it "STOREDIR" as an example) to the floppy:
Code:
D:\ copy BIOSDIR\* a:\
XYZ123.BIN => a:\XYZ123.BIN
AUTOEXEC.BIN => a:\AUTOEXEC.BIN
BFLASH.EXE => a:\BFLASH.EXE
OTHERFILE.COM => OTHERFILE.COM
D:\
10. Exit Dosemu:
Code:
D:\ exitemu
11 Now, back at the Konsole terminal, unmount the floppy and exit:
Code:
user@localhost:~$ umount /dev/fd0
user@localhost:~$ exit
12. Follow the instructions of the BIOS vendor.

Happy Trails,

Loye Young
http://www.iycc.net
Laredo, Texas

That is another way to do it, but if you have no floppy drive the freedos on a cd-rw with the bios update and the flash program is an option to get the job done. I upgraded the bios in my laptop with a bootable cd-rw with my bios tool and update with no problems.
__________________
PC: Core 2 Duo 2.66GHz, 4096MB Ram - Debian 5.0.3
Laptop: Acer Aspire Timeline 4810T - Core 2 Solo 1.4GHz, 4096MB Ram - Debian 5.0.3

quail.southernvaleslug.org - Ubuntu user #60
quail-linux is offline   Reply With Quote

Bookmarks

Tags
bios, bios update

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:26 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry