2010-09-27

Flashing a Dell Vostro 1510 Bios Without Windows.

I've been trying to get my BIOS updated for several months now, and attempted several times with no success, but tonight, I stumbled into the information that gave me the breakthrough I needed.

What Doesn't Work

Dell have started being nice and releasing more Linux friendly ways of installing bios updates, but sadly, for models like mine, there is no support.

Using Windows7/Vista 64bit

It just will never work. Not even with administrator privileges. That WinPhlash thing just Doesn't Work™

Using The biosdisk technique

Doesn't work, because the winphlash executable that you have to use will not run in the FreeDOS boot environment. It's a Win32 GUI app.

Using the remote boot update method

There is no hdr file produced by Dell to work with this bios yet, and there is no way to produce one.

Windows XP Portable Edition( BartPE )

In my case, the "bootable media" just hung for 8 hours and wouldn't boot.

Working Solution: phlash16.exe

Legacy dos apps save the day!.

While this method worked for me, its not official, nor supported, and you are on your own if it breaks, just like I was. However, you have my good intentions and the testimony of others that it works for some of us.

Checklist

From here on, I'm going to be using very gentoo-specific terms, but they should be portable to other Linux distributions.

Install nessecary tools

You'll need libsmbios to see what you have, and biosdisk to generate a bootfloppy which we can inject our tools into. Wine will also be required to extract the ROM file from the Winphlash self-extractor.

$ sudo emerge -uvatDN libsmbios
$ sudo emerge -uvatDN biosdisk
$ sudo emerge -uvatDN wine
$ sudo emerge -uvatDN unzip

Check your Bios and System

While this technique may work for other Dells, I have not myself tested it and thus, cannot recommend it. If you use my pre-generated boot-floppy , you will WANT to have the same BIOS SystemID and Version as I currently have.
$ sudo smbios-sys-info-lite 
Libsmbios:    2.2.19
System ID:    0x0273  # MATCH 
Service Tag:  XXXXXXX
Express Service Code: XXXXXXXXXXX
Aset Tag:  X
Product Name: Vostro1510
BIOS Version: A10 # MATCH
Vendor:       Dell Inc.
Is Dell:      1

Get Dell Bios updates in WinPhlash form

I must remind you, this solution works ONLY for WinPhlash based bios updates. If your bios update installer tool does NOT use WinPhlash, you should not continue.

Get a copy of Phlash16.exe

I can't gurantee that this link will always work, so Google for it if my link dies. But in the mean time, you can get a copy of winphlash16 with one of intels bios flashes. You won't need everything in the archive, but it has what we need. So, download the 3C91.zip bios package for Quanta* QTW3A945PM1

Preparation

Unpack your Dell BIOS

Unfortunately, Dell bundle this as a self-extracting achive, a weirdly formatted one at that, which contains the winphlash and the BIOS.ROM file you need. So we need to run this with Wine to get it out.
$ wine ~/Downloads/V151015.exe
It will do its thing, run and so forth, tell it to start extracting, and then winphlash will run. It will then throw an error, but it doesn't matter, its done the job we wanted it to.

Grab the BIOS.ROM from your wine dir

This will be in a directory such as C:\WINDOWS\TEMP\WINPHLASH, but relative to your wine directory. In my case, its ~/.wine/drive_c/windows/temp/WINPHLASH/BIOS.ROM
$ cp ~/.wine/drive_c/windows/temp/WINPHLASH/BIOS.ROM /tmp/

Unzip phlash16.exe from the Zip

$ cd /tmp/
$ mkdir phlash
$ cd phlash
$ unzip ~/Downloads/3C91.zip phlash16.exe

Build the MemDisk

We can now build an in-memory FreeDOS boot diskette and stash it into Grub.conf so we can boot into our bios updater on our next boot.

Mount /boot

$ sudo mount /boot 

Generate a BiosDisk

Note I don't really "get" how biosdisk works inside, so we're passing it here an executable thats reasonably large, and known not to work =).

We're going to fix that later.

$ sudo biosdisk install ~kent/Downoads/V151015.exe
That should have built you a nice boot floppy config and setup grub in nice ways.

Manually hack the generated BiosDisk

Now for the part that does all the sexy good work. That boot floppy image is a mountable filesystem image we can read and write to.
$ mkdir /tmp/vfat/
$ sudo mount /boot/V151015.img /tmp/vfat/
$ cd /tmp/vfat
$ sudo rm /tmp/vfat/V151015.exe
$ sudo cp /tmp/phlash/phlash16.exe ./
$ sudo cp /tmp/BIOS.ROM ./

Now here, we could make this automatically flash the bios on boot, but I'm going to suggest against that, because I don't want to run it accidentally at some later stage before I get rid of it again, and interrupt it, bricking my box =).

So instead, I've set it up to give me a command shell, and I manually execute the flash command.

$ sudo vim -c "set fileformat=dos" autoexec.bat
command.com

This is the flash instruction. You really want the /S option, unless you enjoy deafening beeping at 3am.

The /EXIT option is supposed to STOP exiting and auto-rebooting, but it does this anyway, for reasons that I don't understand, and quite frankly am slighly afraid of.

$ sudo vim -c "set fileformat=dos" flash.bat
phlash16.exe /S /EXIT BIOS.ROM

Now to check we have DOS line endings.
$  grep ''  autoexec.bat flash.bat  | cat --show-all
autoexec.bat:command.com^M$
autoexec.bat:^M$
flash.bat:phlash16.exe /S /EXIT BIOS.ROM^M$
flash.bat:^M$
And now we can unmount it, and be ready to fly.
$ cd /
$ sudo umount /tmp/vfat

IMPORTANT PRE-FLIGHT BRIEFING

You are about to fly into dangerous territory, where enemy combatants like "power failure" can mean certain death

Please read all following instructions and be familiar with them BEFORE attempting to continue

  • When you reboot, you will see the bios flash option in grub
  • Select this
  • A few seconds later, you will be given the A:\ prompt of FreeDOS
  • You will double check you are on an uninterruptable power supply system, and batteries are working
  • You will be running mains power
  • type flash.bat and press your ENTER key
  • A bios flash utility will load, and progress to flash your bios
  • YOU WILL BE PATIENT AND NOT INTERRUPT IT
  • Upon completion of flashing, the computer may suddenly and unexpectedly reboot with NO warning, and this may surprise you and make you think your computer has crashed! DONT PANIC, wait it should quickly return to normal booting.
  • During this boot, you should observe the code "A15" in the bios booting sequence instead of "A10" =).
  • Boot back into linux, and proceed to remove the flash installer from the boot menu =)
  • SUCCESS!

Experimenters Advice

If you have elected to try see what other flags phlash16.exe has, you're probably not going to find any of them useful. I have noticed something weird, and that is, at least in the biosdisk boot enviroment, the /BU option does not work. Using it causes phlash16.exe to reboot as soon as it hits the backup phase, making you panic and thinking you killed it. I have not played with the other flags, but they didn't appear to be of use to me =).

Proceed! AND GOOD LUCK MY FELLOW COUNTRYMAN!

yes, you may now go and try the above.

POST-OP cleanup

Once you have successfully flashed your bios, you may then clean the biosdisk entry out of grub:
$ biosdisk uninstall ~kent/Downloads/V1510A15.exe
And then it should be gone from menu.lst

PREMADE BIOSDISKS

For your convenience, I have made a pre-built copy of the biosimage, my grub configuration, and the memdisk kernel:

Dell Bios Phlash Vostro1510 A10 -> A15 on humyo.com

They worked for me, and might work for you too.

The grub configuration is given for your understanding. The top section is all you need to add, but it probably won't work like that verbatim.

6 comments:

  1. KENTNL,

    I am in the sittuation where my Vostro 1520 quit charging my batterry (even with new batterry). it is running on win7/Bios version A02. so I hope after updating bios the situation would improve, but until then I am just hopping.

    I am trying to follow your instruction but I got lost at the point where you "Build the MemDisk" because you are doing everything in Linux commands, while I am not familiar with and has no linux system available, could you kindly show how it is done from a window if possible?

    Thanks in advance!
    -Hai

    ReplyDelete
  2. I'm not sure how you'd do it from windows sorry. Building Quality boot disks in windows is actually sadly very very difficult, to the point a few months ago I spent 3 hours fussing around trying to get a USB-key to be bootable, and gave up, jumped on my linux machine, did a few basic things and it was done.

    Also, lots of the tricks and things I've done here to make a working bios-disk are very linux centric, and I'm not even sure if its possible to translate the same to windows.

    For starters, we have a virtual floppy disk image, which we tell linux to load as a normal drive, so we can poke around in it, change it etc. I've never been able to do this on windows.

    Second, the boot-disk tool injects the flasher-floppy disk image into out boot-loader ( in our case, grub ), so that it can be simply booted into on the next boot. Grub lets you do lots of magical things and I don't know if its possible to do it with a windows boot-loader.

    Your best bet if you have a windows only machine, is really to use an actual floppy disk, but I'd recommend not doing that, because floppy disks are dangerously prone to corruption.

    In windows, to do this, you'd have to somehow initialize the floppy disk with the "boot environment" of freedos , copy the right files onto it , and create the autoexec.bat file, and then reboot with that floppy disk in it. But my experience with windows says "This could be very hard".

    You could attempt to image a floppy disk using my above linked "1510" boot floppy, and once you've gotten a floppy disk that has all the gut files in it, a bit of poking around in the floppy could give you some ideas, but I'm sorry, I can't really be more helpful than that.

    Best of luck with your flashing!

    ReplyDelete
  3. were you having the problem that a previous bios flashing failed (or for some other reason the bios was bad), leaving the computer in a unusable state? that's my problem

    I've heard that BIOS often have a floppy 'fail safe' mode, is that what you're using?

    ReplyDelete
  4. No, bios floppy failsafe uses the bios to load a literal floppy disk directly. This circumvents the entire boot order because the bios thinks "hey, I'm screwed, booting any OS will never work", and it loads the floppy itself, and finds the bios image itself, and then uses that.

    This technique is just utilizing the normal system boot order to boot into a dedicated operating system pre-configured for the task of flashing the bios.

    If your machine can no longer boot ( ie: not even boot a CDROM ), then this technique will not work for you.

    ReplyDelete
  5. I have a bricked vostro 1510. Is it possible to use this method? The link is dead. Have you a new one?
    Thx in advance.

    You have made a pre-built copy of the biosimage, your grub configuration, and the memdisk kernel:

    Dell Bios Phlash Vostro1510 A10 -> A15 on humyo.com

    ReplyDelete
    Replies
    1. Sorry, if your vostro is "Bricked" so that it no longer gets past the BIOS splash screen, you're shit out of luck, you'll need a working boot-able computer for this to be at all viable.

      Sorry the link is dead, trying to get free online file hosting is a nightmare, especially types that are persistent. But if your machine is that bricked, you're not going to need it anyway.

      Delete