bios flashing without a floppy/cd-rom/usb-stick

well i posted this in our development blog in my company and have noticed that this can be usefull for other people, but i am not responsible for anybody messing up their bios due to not knowing what they are doing!

here’s how you can flash your bios without needing a boot disk. the easy way is to use flashrom and i’ve also written a short how-to on how to boot dos from grub further below.

well installing flashrom (on ubuntu linux) is pretty unproblematic:

sudo apt-get install flashrom

just for safety create a backup of your current bios:

sudo flashrom -r bios_20101014.bin

output is something like this:

flashrom v0.9.3-r1211 on Linux 2.6.35-22-generic (i686), built with libpci 3.1.7, GCC 4.4.5, little endian
flashrom is free software, get the source code at http://www.flashrom.org
 
Calibrating delay loop... OK.
No coreboot table found.
Found chipset "Intel ICH9", enabling flash write... OK.
This chipset supports the following protocols: FWH,SPI.
Found chip "Winbond W25x80" (1024 KB, SPI) at physical address 0xfff00000.
===
Reading flash... done.

my mainboard seems to be currently untested and so i also receive this message in my output:

This flash part has status UNTESTED for operations: WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom@flashrom.org if any of the above operations
work correctly for you with this flash part. Please include the flashrom output  with the additional -V option for all operations you tested (-V, -Vr,
-Vw, -VE), and mention which mainboard or programmer you tested.
Please mention your board in the subject line. Thanks for your help!

well since i’m only making a backup in this step this really is irrelevant (because i’m only reading) but i also ignored this later on and it worked perfectly.

download the bios file from the manufacturers website and then flash it:

sudo flashrom -w mynewbios.rom

here’s the output:

flashrom v0.9.3-r1211 on Linux 2.6.35-22-generic (i686), built with libpci 3.1.7, GCC 4.4.5, little endian
flashrom is free software, get the source code at http://www.flashrom.org
 
Calibrating delay loop... OK.
No coreboot table found.
Found chipset "Intel ICH9", enabling flash write... OK.
This chipset supports the following protocols: FWH,SPI.
Found chip "Winbond W25x80" (1024 KB, SPI) at physical address 0xfff00000.
===
This flash part has status UNTESTED for operations: WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom@flashrom.org if any of the above operations
work correctly for you with this flash part. Please include the flashrom
output with the additional -V option for all operations you tested (-V, -Vr,
-Vw, -VE), and mention which mainboard or programmer you tested.
Please mention your board in the subject line. Thanks for your help!
Flash image seems to be a legacy BIOS. Disabling checks.
Erasing flash chip... SUCCESS.
Writing flash chip... COMPLETE.
Verifying flash... VERIFIED.

like i said i ignored the UNTESTED warning and was able to cross-flash my asus p5k-se mainboard to the asus p5kr bios (to receive ahci support for the p5k-se motherboard) without any problems.

reboot your ubuntu and set your settings in your new bios.

since i wanted ahci support i quickly checked if ahci loads properly after booting back into ubuntu linux:

lsmod | grep ahci

 

[alternate method]
for everybody that wants to flash using the manufacturers tool that usually only runs in DOS go for this method:

download and mount a freedos image (for example balder or freedos oem used in this example):

sudo mkdir /media/floppy
sudo mount -t vfat -o loop,quiet,umask=000 FDOEM.144 /media/floppy

now copy the bios files and your flashtool to the mounted /media/floppy (as root or with sudo).
then unmount:

sudo umount /media/floppy

move or copy the floppy image into your /boot folder

sudo mv FDOEM.144 /boot/biosupdate.img

copy memdisk to /boot (first command makes sure you have syslinux installed):

sudo apt-get install syslinux
sudo cp /usr/lib/syslinux/memdisk /boot/

now add the floppy image to your /boot/grub/menu.lst

title       bios upgrade
kernel      /boot/memdisk
initrd      /boot/biosupdate.img

then choose to boot the bios upgrade in grub while starting up (you might need to press escape to fall into the grub menu) as soon as dos is up and running use your manufacturers command in dos to flash your bios…

other methods and related topic:
http://ubuntuforums.org/showthread.php?t=318789

updating sony ericsson x10 (mini/mini pro) to android 2.1 in linux

well for all of you who like to upgrade their SE phone from a linux machine here’s a way to get it done using virtualbox… (i’m using ubuntu maverick meerkat)

first download virtualbox and install the correct version from here or for ubuntu just do a:
sudo apt-get install virtualbox-ose-qt

then you need to add yourself to the “vboxusers” group, this can be done using the colorful clicky menu in ubuntu by clicking System -> Administration -> Users and Groups -> Manage Groups

in older version of ubuntu and other linux distros you might need to add persmissions to usbfs for the virtualbox users. check and see if your distro has a “/proc/bus/usb” if not, ignore this next step.
edit the fstab to get the correct permission for the usb device in virtualbox

sudo gedit /etc/fstab

add this at the end (make sure you replace the XXX with the “vboxusers” group ID)

none /proc/bus/usb usbfs devgid=XXX,devmode=664 0 0

best thing to do now is a reboot ;)

so now you need to create a new virtualbox and install windows… this shouldn’t be a problem if you still have an old windows cd lying around.

after that you need to configure that virtual machine with 2 usb filters for your phone. plug in your phone and in the virtualbox settings dialog add it to the usb filters. unplug your phone, turn it off and reboot into flash mode (hold the back key while plugin in the usb cable). now you should see a different device popup in the usb settings. add it also:

start-up your virtual machine and install pc companion or whatever and you are ready to update…