Installing HP BIOS Updates under Linux

I have recently acquired an old HP Omnibook xe4100 laptop. As part of my maintenance and to hopefully resolve a technical issue with the machine, I thought I´d update the BIOS on the machine. I visited the HP website and downloaded the appropriate package containing the latest BIOS for my machine. The update came in the form of a Windows ¨EXE¨ (executable). From past experience these have been self-extracting ZIP files which are easy to manage on non-Windows platforms. On Linux the InfoZIP ´zip´ program can strip off the SFX stub from a self-extracting ZIP file, and indeed the ´unzip´ tool can extract the file directly.

HP appear however to use a windows based application to package the files which makes things only slightly more difficult.

The approach I took was to have a look at the file first:-

alan@multivac:~/Downloads$ file sp27514.exe
sp27514.exe: MS-DOS executable PE  for MS Windows (GUI) Intel 80386 32-bit

It´s also possible to determine that the file isn´t a self-extracting ZIP by trying to unpack it:-

alan@multivac:~/Downloads$ unzip sp27514.exe
Archive:  sp27514.exe
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of sp27514.exe or
        sp27514.exe.zip, and cannot find sp27514.exe.ZIP, period.

Yup, that´s no ZIP file.

Next approach is to try to run the Windows executable with WINE on Linux. WINE is a tool designed for just these occasions where an application isn’t available nativley for Linux, but a Windows version exists. I already had WINE installed on Ubuntu but if I didn’t then this is what I might do to get it:-

alan@multivac:~/Downloads$ sudo apt-get install wine
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed
  wine
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 0B/9170kB of archives.
After unpacking 43.2MB of additional disk space will be used.
Selecting previously deselected package wine.
(Reading database ... 139531 files and directories currently installed.)
Unpacking wine (from .../wine_0.9.21-0ubuntu1_i386.deb) ...
Setting up wine (0.9.21-0ubuntu1) ...

Now we have WINE lets try running the executable. Of course I would’t advocate running random Windows executables downloaded from the web in this way, but this did come directly from HP and the machine I am doing this on isn´t a production machine (yet). It´s up to you what you choose to run on your own machine, don´t blame me if your machine dies horribly at this point (although it shouldn’t of course):-

There´s two ways to do this. You can either use the file navigaion tool such as Konqueror (in KDE) or Nautilus (in Gnome) to find the file and double-click. Alternatively you can run WINE from the command line:-

alan@multivac:~$ cd Downloads/
alan@multivac:~/Downloads$ wine sp27514.exe
wine: creating configuration directory '/home/alan/.wine'...
libGL warning: 3D driver claims to not support visual 0x42
libGL warning: 3D driver claims to not support visual 0x42
libGL warning: 3D driver claims to not support visual 0x42
Failed to open the service control manager.
fixme:ole:ITypeInfo_fnRelease destroy child objects
wine: '/home/alan/.wine' created successfully.
libGL warning: 3D driver claims to not support visual 0x42
libGL warning: 3D driver claims to not support visual 0x42
fixme:richedit:RichEditANSIWndProc WM_STYLECHANGING: stub
fixme:richedit:RichEditANSIWndProc WM_STYLECHANGED: stub
fixme:richedit:RichEditANSIWndProc WM_STYLECHANGING: stub
fixme:richedit:RichEditANSIWndProc WM_STYLECHANGED: stub

(all the ´fixme´ stuff is WINE reporting things that I guess need fixing :) )

A window appears after a few seconds which will be familiar in style to Windows users:-

Following the normal procedure of blindly clicking ´Next´ and agreeing to anything that makes the ´Next´ button appear results in the following screens.

At the end of the process my terminal is filled with a lot of these kinds of messages:-

-------------------------------------------------------------------------
This utility will create a bootable system BIOS updated diskette
-------------------------------------------------------------------------

Insert a blank 1.44MB floppy disk into drive A:

Any existing data on the floppy disk will be erased.

Press Enter to continue or CTRL+C to cancel

Finally ending in this ominous looking message:-

err:seh:setup_exception stack overflow 3504 bytes in thread 000d eip 7eda9763 esp 00240250 stack 0x241000-0x350000

Not to panic though. During the Windows installer it unpacked the BIOS update tool into C:\SWSetup . Now on Linux under WINE that ends up in ~/.wine/drive_c/SWSetup which under my user is /home/alan/.wine/drive_c/SWSetup . If we go and have a mooch in there we find:-

alan@multivac:~/.wine/drive_c/SWSetup$ ls -l
total 4
drwxr-xr-x 2 alan alan 4096 2006-09-25 07:25 sp27514

A folder containing:-

alan@multivac:~/.wine/drive_c/SWSetup/sp27514$ ls -l
total 1488
-rw-r--r-- 1 alan alan     511 2004-03-17 13:18 copydisk.bat
-rwxr-xr-x 1 alan alan   24917 1996-11-07 12:28 COPYDISK.EXE
-rw-r--r-- 1 alan alan 1474592 2004-03-17 13:12 M127.IMG
-rw-r--r-- 1 alan alan    1371 2004-03-17 13:31 SP27514.txt
-rw-r--r-- 1 alan alan    1125 2004-03-17 13:31 WSSP27514.txt

From past experience you might use the tool provided (in this case ‘COPYDISK.EXE’) to copy the contents of an image file onto a floppy disk. That looks to be the case here. COPYDISK.EXE isn´t a Windows program though, it´s a nice DOS command-line one:-

alan@multivac:~/.wine/drive_c/SWSetup/sp27514$ file COPYDISK.EXE
COPYDISK.EXE: MS-DOS executable, MZ for MS-DOS

Bleah! Ok we have tools that can deal with this. I can just use dd to copy the file M127.IMG (which I am assuming is an image of a floppy disk) to an actual disk. But hang on, this disk image doesn´t look the right size for a floppy disk image. A floppy disk is 1440KiB in size. That’s 1440*1024 which is 1474560 bytes long. This image is 1474592 which is 32 bytes too long to fit on a floppy. Let’s have a look at the first few bytes of that file.

alan@multivac:~/.wine/drive_c/SWSetup/sp27514$ hd M127.IMG | head -5
00000000  43 4f 50 59 44 49 53 4b  00 02 00 02 00 00 02 40  |COPYDISK.......@|
00000010  0b 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  eb 3c 90 28 6d 78 79 61  49 48 43 00 02 01 01 00  |.<.(mxyaIHC.....|
00000030  02 e0 00 40 0b f0 09 00  12 00 02 00 00 00 00 00  |...@............|
00000040  00 00 00 00 00 00 29 ff  14 73 1b 4e 4f 20 4e 41  |......)..s.NO NA|

Ok, so it's got some header on the front which (at a guess) is used by the COPYDISK.EXE program in DOS. Lets just strip out those 32 bytes:-

dd if=M127.IMG of=stripped_M127.IMG bs=1 skip=32
alan@multivac:~/.wine/drive_c/SWSetup/sp27514$ dd if=M127.IMG of=stripped_M127.IMG bs=1 skip=32
1474560+0 records in
1474560+0 records out
1474560 bytes (1.5 MB) copied, 9.19391 seconds, 160 kB/s

The above uses dd to copy the file M127.IMG to one called stripped_M127.IMG but skipping 32x1 byte chunks of the file. Lets just check that worked:-

alan@multivac:~/.wine/drive_c/SWSetup/sp27514$ ls -l *.IMG
-rw-r--r-- 1 alan alan 1474592 2004-03-17 13:12 M127.IMG
-rw-r--r-- 1 alan alan 1474560 2006-09-25 08:05 stripped_M127.IMG

Looks good. Last thing to do is copy to the image to a floppy drive:-

dd if=stripped_M127.IMG of=/dev/fd0

I then booted off the floppy disk and followed all the usual prompts to update the BIOS. Job done.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
This entry was posted in Uncategorized. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

6 Comments

  1. darake
    Posted December 20, 2009 at 4:09 pm | Permalink

    Sh*t !

    Thanks to your tutorial, I’m sure that I can upgrade my bios through gnu-Linux but I need more help.

    I have several file with others name, some directories, but unfortunately there is no COPYDISK.exe, instead I got delay.exe, EXITCODE.exe, showmsg1.exe… Delay is a dos command line but delay no delay, nobodies knows !
    It seems that my new bios is contained in this file ~/.wine/drive_c/SwSetup/SP38061/30B7F3D.WPH ( 1109666 MBytes ) and in .wine/drive_c/SwSetup/SP38061/SWinFlash/ I have an other one called BIOS.WPH ( 1109554, wh at tha ! )

    After comparing ( hd then diff ) , there is too much differences between theses files…Which is the right file ??

    I’m completely lost…

    Thanks to help if you have any informations about that…Can you update this issue by email ?

  2. Jonathan Maddox
    Posted January 21, 2011 at 12:30 am | Permalink

    Wonderful notes. Unfortunately it doesn’t work these days … later bios updates are done not with a floppy image but from inside windows using “unimplemented function ntoskrnl.exe.MmMapIoSpace” (wine error). The BIOS update page claims that the update is valid only for Windows 7 and Vista, but there are error dialogs mentioning XP (“run as Administrator if you are using Windows XP”) as well.

    I don’t have a windows installation on this machine, since I got it without a hard disk (original broke) as a hand-me-down. It’s Linux only. And has a suspend/resume BIOS bug which was worked around in the original Windows drivers but even so fixed by HP with a BIOS update for Linux users over a year ago. Funny, the person who gave me the machine also ran Linux on it, but never used suspend/resume. For me it’s a must-have or the laptop is usable only as a desktop. Grrr.

    Anyway. You got me pretty close, thanks for the post.

  3. Posted April 7, 2011 at 5:33 pm | Permalink

    You could just use cabextract to get at the files.

    I just unpacked the hp bios update for a compaq 6000 SFF machine, it has an iso in there ready to burn onto cd. (as well as 1.44MB disk images)

      More from author
  4. jrdls
    Posted April 23, 2011 at 5:27 am | Permalink

    I’m out of luck. When I extracted the files of the .exe file (using cabextract instead as suggested by one of the commenters) I got 4 files, none of them being a .IMG file. All I got was one .sys file, one .SYS file, one .exe file and one .VXD file. Do I have to use wine to do my bios update or can I do something else? BTW is it safe to do my bios update through wine?

  5. Amit
    Posted April 14, 2008 at 3:13 am | Permalink

    Excellent job. I am looking some way to directly push this kind of BIOS update from within Linux (Ubuntu 8.04) for my HP NC6230. This was good information. Thanks for your work,

  6. g2g591
    Posted December 15, 2007 at 2:38 am | Permalink

    Finally, I can get my old HP linux box to shutdown properly (sudo init 0 now shuts it all the way off)! (acpi didnt work right with the old bios, so had to push powerbutton). Thank you very much

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType