PDA

View Full Version : BIOS Upgrade using freedos Howto.



Jeff Sadowski
5th December 2014, 05:19 PM
I needed to update my Intel motherboards BIOS the other day and the Intel linux compiled tool for this always failed with a segfault. So, I decided I should write a howto for others to follow to update their BIOS's

First get Freedos. I got it from here so I didn't have to build my own.
http://domoticx.com/diskimage-freedos-software/

I downloaded the 256M one.
I logged in as root so I could put files where I needed them.
I unzipped it and copied it to my /boot/ directory as follows


7za e "FreeDOS 1.1 USB image 256M img.7z"
cp FreeDOS-1.1-memstick-2-256M.img /boot/freedos.img


next I mounted the image so I could put the dos tools on it.

following is a script I wrote to do this


kpartx -d /boot/freedos.img >/dev/null 2>/dev/null
sleep 1
partition=`kpartx -av /boot/freedos.img|awk '{print $3}'`
sleep 1
mkdir -p /mnt/freedos
mount /dev/mapper/${partition} /mnt/freedos


next I copied the DOS tools I downloaded from the manufacture to update the BIOS on to the freedos image



cp -r ./bios /mnt/freedos


my bois tools directory looked as follows


ls -1 bios/
IFLASH2.EXE
JG0663P.BIO
JG0663P.ITK


my supermicro tools directory looked as follows


ls -1 X10SRA6_128
afudosu.smc
choice.smc
fdt.smc
FLASH.BAT
X10SRA6.128

I copied them as follows
cp X10SRA6_128/* /mnt/freedos

unmount it as follows


umount /mnt/freedos
kpartx -d /boot/freedos.img


next I created a freedos entry in GRUB

I edited /etc/grub.d/40_custom to look as follows

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "FreeDOS (flash bios)" {
insmod fat
linux16 /memdisk
initrd16 /freedos.img
}
In ubuntu /etc/grub.d/40_custom to look as follows

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "FreeDOS (flash bios)" {
insmod fat
linux16 /boot/memdisk
initrd16 /boot/freedos.img
}

I needed memdisk in /boot as well so I got it from syslinux


yum install syslinux
cp /usr/share/syslinux/memdisk /boot/

in ubuntu I downloaded syslinux and got memdisk out of the bios/memdisk folder and put it in /boot/


I needed to update grub using

grub2-mkconfig -o /boot/grub2/grub.cfg
in Ubuntu it is

grub-mkconfig -o /boot/grub/grub.cfg



When I reboot I select FreeDOS from grub

-------------- updated 2016-04-18
Freedos now puts its own syslinux on its image
thus now you need to type fdos at it's prompt
then wait for another menu. The first option didn't work for me I selected the hImemeory option and that worked

--------------

that boots me into freedos
I just let it boot to a command prompt
from there I used the dos tools
Mine was as follows


C:\>cd bios
C:\bios>iflash2 /p JG0663P.BIO


My supermicro had the command like so


C:\>FLASH.BAT X10SRA6.128


It rebooted and I have the latest BIOS
Wala

dobbi
5th December 2014, 07:51 PM
By Linux tools you mean flashrom?

flashrom.x86_64 0.9.6.1-5.svn1705.fc20 @fedora

http://www.flashrom.org/Flashrom

antikythera
5th December 2014, 11:29 PM
I guess this is potentially a handy procedure for older board designs without built-in flash utilities (such as Gigabyte's Q-Flash for example) to commit images direct from storage media.

I have been using a Sony USB floppy drive (and have an internal drive tucked away in the workshop if needed) where necessary with small enough ROM files. allbootdisks is a good source for obtaining compatible DOS floppy boot images.

Jeff Sadowski
6th February 2015, 10:48 PM
By Linux tools you mean flashrom?

flashrom.x86_64 0.9.6.1-5.svn1705.fc20 @fedora

http://www.flashrom.org/Flashrom

I downloaded Intels tool they had downloadable for my motherboard.
It segfaulted any time I tried to use it.
I had even turned off selinux and was trying to run it as root. I was using it as documented.
I gave up and used the method I described.

Jeff Sadowski
6th February 2015, 10:56 PM
I guess this is potentially a handy procedure for older board designs without built-in flash utilities (such as Gigabyte's Q-Flash for example) to commit images direct from storage media.

I have been using a Sony USB floppy drive (and have an internal drive tucked away in the workshop if needed) where necessary with small enough ROM files. allbootdisks is a good source for obtaining compatible DOS floppy boot images.
Yeah, as I re-edited it to be more precise of the tool that failed. Intel had their tool too called ifash. It always segfaulted. And my BIOS images where too big to fit on a floppy. I wouldn't have used a floppy anyways. I wanted a method that I no longer had to plug something else in. The board is about 5 years old now. So it isn't that old.