Finally my wife’s old trusty Acer Aspire 5738G broke after 7 years. The mode of failure was strange. Computer stops during windows startup – no power down, the screen turns off and it doesn’t respond. This is old news you may say. The Internet and YouTube are full of laptops that stop during Windows startup. However this one stops after ~30sec even when in BIOS setup. In BIOS setup one could notice some artifacts in the screen from failed redraws and then it would stop responding at all. I suspected the memory, but I was able to reproduce it with each one of the DIMM modules. I can’t believe that the two DIMM module broke at the same time. I have never seen a failure in the memory controller before so finally I believe the problem is on ATI mobility graphics card. This can explain the screen artifacts and the eventual halt. A reflow may revive the laptop but for how long?
Naturally I was assigned the task to buy a new laptop, install the OS and backup restore from the old hard disk.
I found this laptop HP 250 G5 X0P62EA in a very good price. It is an i3 machine with 8GB of memory and Intel video card. Sadly it comes with a 1TB hard disk. It’s a pity that HP doesn’t ship it with SSD. The laptop comes without Windows but with FreeDos instead. Buying strategy thought: “Hey – they wouldn’t ship it without Windows if it can’t run Linux in a proper and satisfactory manner? Would they?”
Indeed the Debian/GNU Linux unstable installation was a breeze. Everything worked out of the box. And when I am saying everything I mean everything. You name it: UEFI boot non legacy mode, audio, webcam, ethernet, wifi, video. At some point the kernel complained about missing firmwares but I was able to find all requested files in Debian provided packages.
And then when I was nearly completing my task I thought to check about firmware updates from HP. That thought alone simply cost me the better part of my weekend.
Looking at the HP site at https://support.hp.com/ca-en/drivers/selfservice/hp-250-g5-notebook-pc/10180321 for this model it says no update.
-Good we are finished. Let’s get out of here.
-Wait there is an OS selector combobox. There is only two options: Windows 10 and 7.
-These are driver updates for Windows. I don’t need them. Let’s get out of here.
-Let’s see what happens if I select it… Oh look! There are two firmware updates, one for the BIOS and one for the HDD.
-Here there are. Install them.
- Bios version 30 Rev.A http://ftp.hp.com/pub/softpaq/sp81501-82000/sp81514.exe
- HDD A7L0 Rev.A http://ftp.hp.com/pub/softpaq/sp76501-77000/sp76532.exe
Note: your mileage may vary but I am confident that you will be able to escape many hours by following the advice in this blog.
HP provides software packs or softpacks. They are executables that have the following form in their filenames: SP[number].exe. So how do we run them without a machine with Windows?
First things first: let’s examine them.
$file sp81514.exe sp81514.exe: PE32 executable (GUI) Intel 80386, for MS Windows, InstallShield self-extracting archive
Bingo! Let’s extract it.
$ unzip sp81514.exe Archive: sp81514.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 sp81514.exe or sp81514.exe.zip, and cannot find sp81514.exe.ZIP, period.
Oups! Let’s try again.
$sudo apt-get install p7zip-full $7z e sp81514.exe ... blah blah.... $ls Insydeflash.exe sp81514.exe
$ file Insydeflash.exe Insydeflash.exe: MS-DOS executable, COFF for MS-DOS, DJGPP go32 DOS extender
DJGPP go32 DOS extender? My God I am old! I know what it is and what it means. I am feeling lucky though…
$ 7z e Insydeflash.exe ... blah blah.... $ ls -rw-r--r-- 1 bill bill 9177600 Jun 29 11:47 081EC.bin -rw-r--r-- 1 bill bill 9177600 Jul 10 09:41 081ED.bin -rw-r--r-- 1 bill bill 9177600 Jul 11 11:10 081EF.bin -rw-r--r-- 1 bill bill 9177600 Jun 28 06:04 081F2.bin -rw-r--r-- 1 bill bill 9177600 Jul 11 10:26 081F3.bin drwx------ 2 bill bill 4096 May 10 10:13 CrisisFolder -rw-r--r-- 1 bill bill 261120 Feb 10 2017 CrisisKeyDLL.dll -rw-r--r-- 1 bill bill 259072 Apr 21 2016 CryptRSA32.efi -rw-r--r-- 1 bill bill 443904 Apr 21 2016 CryptRSA.efi -rw-r--r-- 1 bill bill 195584 Mar 25 2013 FlsHookDll.dll -rw-r--r-- 1 bill bill 231936 Mar 25 2013 FlsHook.exe -rw-r--r-- 1 bill bill 944664 Nov 4 2010 FWUpdLcl.exe -rw-r--r-- 1 bill bill 1355632 Apr 22 2016 HpBiosMgmt.efi -rw-r--r-- 1 bill bill 256 Apr 22 2016 HpBiosMgmt.s09 -rw-r--r-- 1 bill bill 256 Apr 22 2016 HpBiosMgmt.s12 -rw-r--r-- 1 bill bill 256 Apr 22 2016 HpBiosMgmt.s14 -rw-r--r-- 1 bill bill 1355640 Apr 22 2016 HpBiosUpdate.efi -rw-r--r-- 1 bill bill 256 Apr 22 2016 HpBiosUpdate.s09 -rw-r--r-- 1 bill bill 256 Apr 22 2016 HpBiosUpdate.s12 -rw-r--r-- 1 bill bill 256 Apr 22 2016 HpBiosUpdate.s14 -rw-r--r-- 1 bill bill 30135717 Jul 12 14:57 Insydeflash.exe -rw-r--r-- 1 bill bill 918528 Apr 10 05:09 InsydeFlash.exe -rw-r--r-- 1 bill bill 1763840 Apr 10 05:08 iscflash.dll -rw-r--r-- 1 bill bill 54984 May 13 2016 iscflash.sys -rw-r--r-- 1 bill bill 63432 May 13 2016 iscflashx64.sys -rw-r--r-- 1 bill bill 34716 Jun 28 06:01 platform.ini -rw-r--r-- 1 bill bill 30250664 Aug 16 00:01 sp81514.exe
Good!!! We have the firmware in multiple versions! Huh? Hold your horses . The 0x81*.BIN files are not version indicators. They are motherboard indicators. My laptop is 081EF.bin.
OK… but now we have the firmware. Let’s flash it. Not so fast! HP BIOS does not offer the facility to flash the BIOS. There is no DOS flash tool as I was used too all these years. How on earth am I going to flash it?
Note: Adding salt to the injury this was not the real firmware but I didn’t know it at the time. Real firmware is extracted from that file along with a signature file.
Look there is this file name HpBiosUpdate.efi. This looks helpful. Oh it is an EFI binary. How can we run EFI binaries?
- From the shell which does not exist or
- by chainloading from GRUB https://unix.stackexchange.com/questions/277373/is-it-possible-to-use-grub-to-run-an-efi-binary.
I followed the instructions it and chainload it. Actually you don’t need to do that. You can boot into it from the BIOS by pressing F9 and selecting the USB disk where the binary resides. It is failed in both cases but it created a log in the file HpBiosUpdate.log.
2015-01-01 00:08:06 EFI HP BIOS Update 3.6.4.r31880 Started 2015-01-01 00:08:06 System ID: 81EF 2015-01-01 00:08:07 Failed Loading HP BIOS Image Interface Protocol (Not Found) 2015-01-01 00:08:07 Failed Loading HP BIOS Image Interface Protocol
and in Debug log
2015-01-01 00:08:04 [W]> [EfiUtilityLib.c:InitializeEfiUtilityLib:218] LocateProtocol(EFI_SHELL_PROTOCOL'6302D008-7F9B-4F30-87AC-60C9FEF5DA4E', NULL, 0x8A897CB8) returned 'Not Found'. 2015-01-01 00:08:04 [L]> EFI_DECOMPRESS_PROTOCOL'D8117CFE-94A6-11D4-9A3A-0090273FC14D' (ProtocolPtr = 0x89462980) is found. 2015-01-01 00:08:04 [L]> EFI_LOADED_IMAGE_PROTOCOL'5B1B31A1-9562-11D2-8E3F-00A0C969723B' (ProtocolPtr = 0x8D6B4840) for current image (ImgHandle = 0x8D623698) is found. 2015-01-01 00:08:04 [L]> EFI_DEVICE_PATH_PROTOCOL'09576E91-6D3F-11D2-8E39-00A0C969723B' (ProtocolPtr = 0x8D446018) for current device (DevHandle = 0x8D446298) is found. 2015-01-01 00:08:04 [L]> EFI_SIMPLE_FILE_SYSTEM_PROTOCOL'964E5B22-6459-11D2-8E39-00A0C969723B' (ProtocolPtr = 0x8D7DF030) for current device (DevHandle = 0x8D446298) is found. 2015-01-01 00:08:04 [L]> Executable Directory '\Hewlett-Packard\BIOSUpdate\'. 2015-01-01 00:08:04 [L]> Current Working Directory '\Hewlett-Packard\BIOSUpdate\'. 2015-01-01 00:08:04 [W]> [FileIo.c:InitializeFileIO:353] Cannot get debug log path system environment variable 'DEBUGLOGPATH'. (Not Found) 2015-01-01 00:08:04 [L]> Initial Log File '\Hewlett-Packard\BIOSUpdate\Debug.log'. 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_LOG_TO_CONSOLE' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_LOG_TO_DEBUGLOG' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_PROMPT_TO_CONSOLE' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_PROMPT_TO_DEBUGLOG' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_ERROR_TO_CONSOLE' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_ERROR_TO_DEBUGLOG' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_WARN_TO_CONSOLE' Not Found. (Not Found) 2015-01-01 00:08:05 [L]> Environment Variable 'HP_DTD_UEFI_WARN_TO_DEBUGLOG' Not Found. (Not Found) 2015-01-01 00:08:06 [L]> Environment Variable 'HP_DTD_UEFI_DEBUG_TO_CONSOLE' Not Found. (Not Found) 2015-01-01 00:08:06 [L]> Environment Variable 'HP_DTD_UEFI_DEBUG_TO_DEBUGLOG' Not Found. (Not Found) 2015-01-01 00:08:06 [L]> StdErr is non-NULL, StdErr is used for Error/Warning message to console. 2015-01-01 00:08:06 [L]> EFI_CPU_IO_PROTOCOL'B0732526-38C8-4B40-8877-61C7B06AAC45' (ProtocolPtr = 0x9BA85280) is found. 2015-01-01 00:08:06 [L]> EFI_CPU_IO2_PROTOCOL'AD61F191-AE5F-4C0E-B9FA-E869D288C64F' (ProtocolPtr = 0x9B875280) is found. 2015-01-01 00:08:06 [L]> EFI_UNICODE_COLLATION_PROTOCOL'1D85CD7F-F43D-11D2-9A0C-0090273FC14D' (ProtocolPtr = 0x9B6823C0) is found. 2015-01-01 00:08:06 [W]> [EfiUtilityLib.c:InitializeEfiUtilityLib:537] LocateProtocol(EFI_SHELL_ENVIRONMENT2'47C7B221-C42A-11D2-8E57-00A0C969723B', NULL, 0x8A897CA8) returned 'Not Found'. 2015-01-01 00:08:06 [W]> [EfiUtilityLib.c:InitializeEfiUtilityLib:557] OpenProtocol(0x8D623698, EFI_SHELL_PARAMETERS_PROTOCOL'752F3136-4E16-4FDC-A22A-E5F46812F4CA', 0x8A897CB0, 0x8D623698, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) returned 'Unsupported'.
OK we need a little education. What’s going in here? What are these protocols?
Wikipedia first: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface
EFI defines protocols as a set of software interfaces used for communication between two binary modules. All EFI drivers must provide services to others via protocols.
So protocols are library entry points. All these just to tell me “library not found” in a new and incomprehensible way?
Time for Google now. Here are the findings.
- There is a procedure to firmware upgrade. You are supposed to start the computer with a specially crafted USB stick while pressing Win+b (or Win+v which leads to CMOS error and ubootable system in my case). Here you can find the HP documentation https://support.hp.com/ca-en/document/c00042629 There is even a section named “Updating the BIOS when Windows does not start (Windows 10, 8, 7)”
- HP support forums are full of desperate people looking a way to update their BIOS without Windows.
So how this specially crafted USB stick is actually crafted?
Here are the strict requirements:
- The stick doesn’t need to be bootable but it doesn’t hurt either.
- It needs to be formated as FAT (VFAT32 worked for me)
- Go easy on the size of the USB stick. For me both 4GB and 8GB USB sticks worked
- It must have a specific volume label named HP_TOOLS. dosfslabel is your friend.
- It also needs a specific directory structure. I will give the layout now and then I will tell you how I end up there. So without further ado:
./Hewlett-Packard ./Hewlett-Packard/BIOSUpdate ./Hewlett-Packard/BIOSUpdate/HpBiosUpdate.log ./Hewlett-Packard/BIOSUpdate/HpBiosUpdate.s09 ./Hewlett-Packard/BIOSUpdate/HpBiosMgmt.s14 ./Hewlett-Packard/BIOSUpdate/HpBiosUpdate.efi ./Hewlett-Packard/BIOSUpdate/HpBiosUpdate.sig ./Hewlett-Packard/BIOSUpdate/HpBiosMgmt.s12 ./Hewlett-Packard/BIOSUpdate/HpBiosUpdate.s14 ./Hewlett-Packard/BIOSUpdate/HpBiosMgmt.s09 ./Hewlett-Packard/BIOSUpdate/CryptRSA.efi ./Hewlett-Packard/BIOSUpdate/HpBiosMgmt.efi ./Hewlett-Packard/BIOSUpdate/HpBiosUpdate.s12 ./Hewlett-Packard/BIOS ./Hewlett-Packard/BIOS/Current ./Hewlett-Packard/BIOS/Current/081EF.bin ./Hewlett-Packard/BIOS/Current/081EF.s12
In HP support forums you can find instructions like these with minor or maybe no differences. People are exchanging screenshots and hope for the best. I followed every piece of advice there and it didn’t work.
Finally I used WINE https://www.winehq.org/ which is a seriously cool project that time and time again had helped me escape very uncomfortable moments. I used it to run the BIOS update soft-pack file sp81514.exe. It run it, uncompress it and then it gave me this (WDM: Read PCI32 error.):
and on enter (Error M-FD: PCI read error in DLL)
Bummer. But here is the trick: if you keep pressing enter multiple times you finally get
Option 1 is not possible of course in my Linux PC. Option 2 is the most prominent but doesn’t work because it needs low level access to the USB stick and WINE crashes on it. However, the remaining Option 3 generates the proper firmware file and the accompanying signature file. So now we have the firmware. We are still missing the necessary directory tree.
After many hours of trial and error I finally stumbled upon https://h30434.www3.hp.com/t5/Notebook-Operating-System-and-Recovery/How-to-make-bootable-bios-flash-USB-CD-with-WINFLASH-bios/td-p/5219366 which suggests to “Download the latest HP PC Hardware Diagnostics 3-in-1 USB Key available in links below:” https://h30434.www3.hp.com/t5/Notebook-Operating-System-and-Recovery/How-to-make-bootable-bios-flash-USB-CD-with-WINFLASH-bios/td-p/5219366
I downloaded the “3-1 sp[number].exe and run it through WINE. Unzipping through 7z doesn’t preserve the directory structure so don’t attempt it. WINE run the executable, installed everything in c:\SWSetup\sp[number] and then it tried to run a DOS bat file.
Here is the directory listing
bill@localhost:~/.wine/drive_c/SWSetup$ ls sp81373 biosunzip.bat field HPUF.exe makekey.bat README.txt
and what biosunzip.bat tries to do?
It tries to run makekey.bat
and what makekey.bat tries to do?
It tries to run
hpuf.exe %drvletter% -Y -VI -v:HP_TOOLS
Luckily there is a readme that says:
Execute makekey.bat to create HP PC Diagnostics USB key. ---- Instructions from Vision Diags version of makekey.bat: Makekey.bat usage (Preferred Method) Note: Administrator privileges are required to use this application. If asked to grant administrator access to the application, please click Copy all files from the release path to your local hard drive; Execute makekey.bat from your hard drive. HPUF.exe usage (Advanced users): Usage: hpuf.exe targetdevice [A:size] [-MSB] [-FDB]/[-B] [-VI] [-VB] [-V:label][-Y] [-(?|H)] where targetdevice Specifies the drive letter of a USB Key to format. -A:size Overrides the default allocation unit size. Valid values are 512, 1024, 2048, 4096, 8192, 16384 (or 16K), and 32768 (or 32k) -B Creates a FreeDOS bootable USB key with all necessary FreeDOS files. -FDB Creates a FreeDOS bootable USB key with all necessary FreeDOS files. -MSB Creates an MSDOS formatted USB key. Note: MSDOS files will need to be manually copied onto USB key. -VI Copies the "field" folder onto the USB key. If -VI is specified, -B will be applied. -VB Enables verbose output. -V Specify name for USB key to appear as (maximum 11 characters.) -Y Suppresses prompting for confirmation. Due to the destructive nature of the utility, this option should only be used by experienced users. -(?|H) Displays this usage screen. Notes ---- The parameters enclosed in square brackets () are optional.
So it tries to copy the field directory in to the USB stick. I helped it by copying manually and lo and behold! It worked! The USB stick booted in HP diagnostics environment. Cool. I tried the combination Win+b and it worked. It booted in the HP BIOS Update facility.
From there is was downhill. I found the necessary directory structure inside the Field directory. After some tests I ended up to the minimum required files that I posted above. With the firmware from the previous step I was able to update my laptop. Easy – peasy!
That’s all folks!
-Wait! What happened with the disk firmware update?
-Oh! I run it through WINE and and said it was a Hitachi disk firmware update. However my disk is a Toshiba one. So I skipped this one. Bye!