# Upgrading BIOS?

## ReeferMac

So how's one go about doing this in Gentoo?

I'm having trouble w/ my Aopen Mobo, and their tech support is advising me to upgrade my BIOS.. ZIP archive contained two .EXE files and a .BIN file.

I don't have a floppy drive on this machine, so do I just copy the .BIN file to a CD? How do I flash it to the BIOS?

- Mac

----------

## NeddySeagoon

ReeferMac,

Well, you are supposed to use one of the *.exe files to load the *.bin file into the BIOS FLASH memory. The bad news, is these exe files normally want to run in DOS real mode. 

Often, they offer an option to upload your current BIOS so you can attempt to go back if the update fails, doesn't work for you, etc.

Of course, this means that you need a writeable DOS disc. If you are prepared to not save you existing BIOS (you can probably download it anyway), you could make a bootable CD with everthing on it, boot the CD and run the program. You will need a bootable DOS image for this.

The alternative is to try running the *exe files under WINE and see if you can make the backup work. Download the same version of the BIOS as you have and do a compare. If reading the FLASH worked, erasing and writing  probably will too.

You have one chance to do the FLASH, if the PC won't boot on the new BIOS (for any reason) going back is not easy. I reccomend that you try all other options before you resort to a BIOS update.

----------

## barlad

Hello.

You will have to create a DOS CD-ROM bootdisk. Creating the bootable DOS cdrom is not a problem:

 *Quote:*   

> 
> 
> mkisofs -r -b boot/boot.img -c boot/boot.catalog -o bootcd.iso .
> 
> 

 

But getting the boot.img file is the problem. Boot.img is supposed to be a binary copy of a bootable DOS floppy disk with the files you want in it and to be honest I have no clue ho w you are going to get that. dosfsutils does not support the creation of dos bootdisks. Maybe someone will have an idea.

The binary file in your archive is the BIOS, one of the exe file is the utility that will allow you to flash it.

----------

## barlad

Ah... I found that.

http://colt.projectgamma.com/bios/flashing.html

That's exactly what you need. By the way, I would NOT try to flash the BIOS from wine.

----------

## NeddySeagoon

barlad,

That wasn't exactly a recommendation, although I did manage to flash my DVD writer firmware for compatibility with 8x media that way. I had to use scsi emulation though.

BIOS updates are always a last resort.

----------

## ReeferMac

Shit man, you guy's rock...  :Very Happy: 

Thnx for the help, I think I'll try that link... 

- Mac

----------

## Gentree

Tread carefully and be thorough. There is often little chance to "go back" with a BIOS flash.

I got stuffed last year by ABIT providing a flash that they still maintain is good for my board but I have two flashed chips that say otherwise.

My system was out for about 10 days while I found someone who could flash the previous version back in for me.

Should you need it (and I really hope you dont) this guy is fast, reliable and homest: http://www.flashbios.org

Good luck, be careful.  :Cool: 

----------

## pmjdebruijn

Well I suggest you do yourself a favor. Go out now, and buy yourself a single floppy drive (+floppy cable +power cable extender). 

Don't build this into the machine, just keep it handy for such occasions...

What do floppy drives cost these days? I think they're about 7 euro's over here. That shouldn't really be a hit to your budget.

Oh right, and if you need DOS, try http://www.freedos.org/!

Regards,

Pascal de Bruijn

PS: I would also highly recommend against flashing your BIOS from WINE or DOSEMU.

----------

## ReeferMac

Thanks guys. The vendor does supply all BIOS's from 1.0 on up on their FTP site, so I can always flash back. 

Hehehe, I've been being cheap about the floppy, and waiting for a machine to die at work to cannibalize, or else p/u one on sale somewhere's... Maybe it is time to break down and just get one ...  :Rolling Eyes: 

Thanks again for the excellent advice.

- Mac

----------

## Gentree

 *Quote:*   

>  so I can always flash back

 

No you cant! This is what I am warning you about. If your flash goes wrong you cannot count on the BIOS guard to restore you old BIOS. Often it cant.

Then even if you have the BIOS already on a floppy it will be useless to you: you no longer have a computer to put it in!

I'm not saying dont. Just be aware of the risk and make sure you have a way to restore your system if all goes wrong.

Ultimatly the only way to be safe is to have a second BIOS chip ready with the old BIOS.

If you can afford a week or two's down time , trust to luck and note the address I gave above just in case.

Good luck.   :Cool: 

----------

## phoenixjim

First, I definitely would get a floppy drive for this reason - it's still not quite at the point where alternatives are as easy to use, or as universal.

Second, there is an excellent site out there for boot disks, called bootdisk.com. Here is a link I found on their site to a zip conaining a mountable floppy image file, which you can modify to suit your needs. There are many others available - feel free to browse  :Smile: 

For example, if you download that file, extract win98sec.img, and mount it thus:

```
mount -o loop win98sec.img /mnt/image
```

(You will have to have the /mnt/image directory before doing that.)

You can then delete any files except command.com, msdos.sys and io.sys, and put any files there you wish(up to the capacity of the real floppy disk). That would be the bin file and the flash exe in this case. Then, for completeness,

```
sync

umount /mnt/image

```

To write the image to a floppy in Linux, do

```
dd if=win98sec.img of=/dev/fd0
```

(with the floppy attached to the standard location of course, adjust the dev part as necessary)

There are other parameters for the dd command which escape me at the moment, but that should do the trick.

After that point, you should have no problem rebooting, starting off the floppy (assuming it's enabled in your current bios and set in the boot order ahead of your hard drive) and updating your bios - although I would recommend caution with bios updates. Mistakes tend to destroy boards.

If I've missed anything, or made the usual human errors, my apologies...

As for myself, I've saved a custom img file for just such emergencies.

HTH   :Cool: 

----------

## artoo

Dell has created a tool called 'biosdisk' which makes a FreeDOS floppy image that also contains a DOS flash bios executable. The useful part is the grub instructions to use memdisk(from syslinux).  See bug 5748(https://bugs.gentoo.org/show_bug.cgi?id=57481) for more info.

----------

## ixtow

If I didn't get this error....

```

bash-2.05b# mount win98-boot.img /bootimg

mount: win98-boot.img is not a block device (maybe try `-o loop'?)

bash-2.05b# mount -o loop win98-boot.img /bootimg

mount: could not find any device /dev/loop#

bash-2.05b# mount win98-boot.img /bootimg

mount: win98-boot.img is not a block device (maybe try `-o loop'?)

```

Rather nice bit of circular logic....  I guess something is mising from my 2.6?

----------

## NeddySeagoon

ixtow,

You are missing the -t vfat on the mount command.

Have you got vfat built somehow?

----------

## ixtow

bash-2.05b# mount -o loop -t vfat win98-boot.img /bootimg

mount: could not find any device /dev/loop#

----------

## ixtow

```

bash-2.05b# ls -l /dev/l*

srw-rw-rw-  1 root root 0 Jul 27 14:23 /dev/log

bash-2.05b#

```

There seems to be no "loop" where one is expected?

----------

## ixtow

I have other vfat partitions mounted, so that can't be it....  I also don't have to specify -t vfat on command line, it auto-figures-it-out... but specifying it does work on the other partitions, if I chose to waste the time typing it....  so I know my Kernel has vfat support, and that it's working.

----------

## ixtow

it's this "/dev/loop" thing that seems to be the issue...

----------

## megadonkey

Maybe you don't have Loopback device support enabled in the kernel.

If you're using a 2.6 kernel it's under:

```
Device drivers --->

Block devices --->

Loopback device support
```

You can check it with:

```
cd /usr/src/linux

less .config |grep LOOP

```

----------

## NeddySeagoon

ixtow,

Have you got the loopback device enabled in your kernel?

Are you able to mount an iso image file with

```
mount -o loop -t iso9660 /path/to/iso /mnt/floppy
```

If that works, you have loop device support.

----------

## ixtow

```

bash-2.05b# mount -o loop -t iso9660 woody-minimal-i386-1.iso /bootimg

mount: could not find any device /dev/loop#

```

I figured as much, but where in my 2.6 menuconfig do I find it?

----------

## cisco.wizard

Make a small 8 mb partion on you harddrive and install freedos on it for BIOS updates.   Be sure to add a DOS selection to your GRUB or LILO menu.. Then all you need to do is mount the drive when needed copy the bios files to it .  Reboot and pick DOS from your boot menu and flash to your hearts content.

----------

## LosD

If you have another around same age (a few years) computer, it's not THAT big a deal to reflash a BIOS... Boot up the other computer in DOS(make sure that the BIOS is shadowed in normal RAM), pop out that computers BIOS chip (Ok, don't pop it out, be careful!), insert the one that failed an upgrade and start the flash program, ignore all warnings, and just flash the bastard with the old BIOS, (or the new one, if it was the flashing itself that went wrong).

Oh, by the way, the program you use should be the "host" board's flash utility (With "host" I mean the board that do the actual flashing)... If it denies to flash the other boards .bin file, then try the flash utility of the board that you want to up/downgrade the BIOS, you might be lucky...

Oh, if you want to be 100% sure that nothing will go wrong, check that both computers use the same ROM size BIOS chip, some Googleing should help you out, but computers within the same few years usually has the same size...

(DISCLAIMER: It's around 3 or 4 years time since I did this the last time (although I did do it at least 5 or 6 times), and that was mostly with somewhat older computers, I don't know if things have changed, and if this is not possible anymore!)

I guess you could find some site with more details somewhere but I haven't  checked it out...

Dennis

----------

## Ben2040

Hi

Both my motherboards - Cheap (We're talking £30 here) AthlonXP and quality Gigabyte AMD64 have backup/secondary BIOS chips, that boot if the original is trashed - and the utils are both simple GUI progs that download and flash right from in XP - How old is the board?

Ben

----------

## pmjdebruijn

I think that having two BIOS chips is a gigabyte only trick...

No other motherboard manufacturer has that...

I've seen ASUS display CrashFree! BIOSes, not sure if it uses two chips...

Regards,

Pascal de Bruijn

----------

## ReeferMac

Wow, thanks for all the help folks.. been a few days since I checked back. 

I snagged a floppy drive out of an aged Intergraph machine at work (that installed SuSe just ducky), but I'm getting all kinds of POST errors w/ the mobo. Manuf. claims the BIOS upgrade will take care of all my problems, but..... I can't get the damned thing to boot half the time (just on long tone at POST), and the half I can get it to, it doesn't see my floppy.   :Evil or Very Mad: 

I've got a 700-dollar desk ornament, and it's driving me NUTS!

- Mac

----------

## NeddySeagoon

ReeferMac,

If you get POST errors like that it unlikely to complete a BIOS update without it corrupting the load.

Is the BIOS in a socket and do you have any friends who have access to the kit for programming the bare BIOS chip?

----------

## ReeferMac

Thanks Neddy,

Between troubles slapping it all together (my 1st DIY computer), gentoo install woe's, and everything else, this rig's been nothing but 700-dollars of desktop decorations for the last 2 months!

It's an Aopen mobo, and their tech guy just keeps telling me to upgrade the BIOS... so when it does b0rk on me, he'll be happy to RMA it for me I'm sure...  :Very Happy:  And I'm the geekiest of all my friends, so no help there, either. I'll see if I can re-seat the BIOS chip or something... maybe just pull it all apart and put it back together again just for good measure.

- Mac

----------

## dayul

Hi guys,

I seem to remember the system rescue CD (http://www.sysresccd.org/) having a boot option to load freedos if that helps, then you shouldnt need to install freedos on your hard drive.

----------

## ellingsw

 *LosD wrote:*   

> If you have another around same age (a few years) computer, it's not THAT big a deal to reflash a BIOS... Boot up the other computer in DOS(make sure that the BIOS is shadowed in normal RAM), pop out that computers BIOS chip ...
> 
> 

 

There is a better way to recover from f'ed BIOS flashes.  You have to plan ahead though.

I can't remember the specifics but you do not have to hot-swap CHIPS to recover.  Both AWARD and American Megatrends BIOSes had a undocumented feature that allows you to recover from a bad flash at one point and probably still do.

With one of the vendors you simply remove all cards from the system, put a properly setup DOS boot disk---the boot disk should run the flash util and flash the BIOS automatically---in the floppy drive and then turn the system on.  You will not have video.  The BIOS will boot from the floppy and flash the BIOS image back to the BIOS.

The other BIOS vendors does it a similar way but I cannot remember how.

I've actually recovered from two f'ed BIOS flashes before.  One if I remember was on an ASUS TX-97.  The other was a newer board... ECS Athlon board... I think.

Update: Here is a PDF document describing the procedures for AWARD and AMI (American Megatrends) BIOSes.

http://www.amptron.com/documents/Recover.pdf

I guess it is documented now.  You can probably find more by searching Google for BIOS and BOOTBLOCK or 'BOOT BLOCK'.

----------

## Dirk.R.Gently

Sometimes the node has to made:

```
mknod /dev/loop0 b 7 0
```

----------

## ghost16825

If it's a flash upgrade that can be done through DOS:

http://gentoo-wiki.com/HARDWARE_Dell_Inspiron_E1405#Firmware_Upgrade_from_DELL

(Instructions are for a Dell machine but can't see why it shouldn't work on other machines)

----------

