1. TechSpot is dedicated to computer enthusiasts and power users. Ask a question and give support. Join the community here.
    TechSpot is dedicated to computer enthusiasts and power users.
    Ask a question and give support.
    Join the community here, it only takes a minute.
    Dismiss Notice

A bit of weekend BIOS hacking..

By Nodsu ยท 6 replies
Jan 26, 2008
Post New Reply
  1. OK. Since I don't have a blog (and never will), I thought that I'd share one of my hacking adventures with you here. (All five of you who will actually bother to read something this long) Also a nice demonstration that noname laptops are a can of worms and that all those cliche sayings about BIOS updating still apply.. It's not a technical writeup but more of a rant, so I'm putting it in Meeting Spot. Whoever wants to move it, go ahead, I don't mind.

    So I have this laptop "made" by a local OEM, really an ASUS S96F/Z96F. Occasionally it would refuse to power on and only removing and putting back the battery would help. Since it's obviously a machine-level problem, then the only thing one can do is to update the BIOS.

    Naturally this local company couldn't care less and has no driver or BIOS updates for me. So I flip around the lappy and read on the bottom: S96Fm. A quick Google tells me this is an ASUS barebones kit and they also sell their own ASUS branded version under the name Z96Fm.

    Downloaded a Z96Fm BIOS. Winflash refuses to do anything with it since it turns out the BIOS in the machine is for Z96F. Gee.. Looks like our laptop maker ran out of proper cases or stickers.

    Downloaded the latest BIOS for Z96F. Winflash refuses to do anything with that too, because even though the version number is bigger, the date on the currently installed BIOS is newer. Looks like out laptop maker has customised the BIOS they got from ASUS. I really hate the powerup glitch so I just ignore this sign of trouble.

    Since the Windows flash utility is braindead, we have to use the DOS one that is (hopefully) less picky about things. Since this is a laptop, I can't use a floppy or a generic CD- or USB-supporting DOS off a CD. We have to boot raw DOS from either a selfmade bootable CD or a USB flash drive. I don't have the utility that makes flash drives bootable, so bootable CD it is. (Bad idea as it turned out)

    How to make a DOS floppy with your own files on it without a floppy drive? CBA to install a virtual floppy driver, so I just get a floppy image plugin for FAR Manager and edit an existing DOS floppy image I have. Just remove the existing crap and copy the ROM image and flash utility on the "floppy". Fire up Nero, tell it to make a bootable CD and point it to the floppy image. Burn.

    Grr! Since I'm booting from a CD, I can't save the current BIOS to a file.. Ah well, what could go wrong? After kicking the flash utility for not accepting ~ as input, I manage to flash the BIOS using command line switches.

    Power off, power on.. POST screen, yay! But there's a nasty error message about failing to update the CPU microcode. Hmm.. we'll just press F1 as told and disable the uCode updating in the BIOS. reset the settings too while at it. Nope, nothing happens when I press F1 and I get the familiar sinking feeling that occurs when I realise that something Very Bad has happened.

    Google tells us that this is a pretty common error message. ASUS doesn't give a damn and the general advice is either: update to the latest BIOS (if your system is still usable) or replace the processor with something that it supported by the BIOS. Thanks a lot, I have the "latest" BIOS and no, I don't have a pile of Yonah CPUs under my bed.

    It turns out that the laptop is still usable. It doesn't respond to F1, but I can still get into BIOS setup with F2 and after exiting that, the thing boots as normal. Well, at least I don't have a $1000 doorstop, but a very annoying startup procedure. HD password, Enter, F2, BIOS password, Enter, ESC, Enter - try figuring that out, laptop thieves!

    OK, we'll get the original BIOS release from ASUS (since I don't have a backup) and try that. Download, burn, boot, "Intel CPU uCode Loading Error", f**k! Now, I suppose that a sensible person would take the laptop to the manufacturer and let them put the correct BIOS back on, but I don't give up that easily and besides, the humiliation of going there and saying that I screwed up big time is just way too much :p

    A little background info about the microcode updates.
    You can think of microcode as the "firmware" or the "OS" for the CPU itself. When a CPU comes out of the factory, it has its base microcode fused into the silicon, but you can patch it at runtime with code loaded by software to correct bugs and improve performance. Unfortunately, this patching is not permanent and you have to do it after every time you power off the computer. Some operating systems support loading microcode updates to CPUs, but this is not the best way to do it. The ideal way to load new microcode is to use BIOS - the first program run at startup. BIOS is bulletproof and simple enough to that any CPU bugs don't crash it or can be worked around and the patches are always loaded when the machine powers on.

    So why can't the microcode be updated on this laptop? Since one of the solutions was about putting in another CPU, we can make an educated guess and say that our Core 2 is not fully supported. It is recognised and works, but for some reason the BIOS wants to update the microcode and probably either can't find the code or it is corrupt somehow.

    A quick look into a couple of BIOS hacking websites gives me a whole folder full of AMI BIOS tools and some background info about How Stuff Works on the ROM (reverse) engineering level. The BIOS setup, as usual with laptops, is totally useless, so maybe we can tweak some setting that is not shown using these utilities? None of the Windows tools work with Vista, so it's the cursed CD-floppy again :\ Most of the DOS utilities don't like the BIOS either :( The only things that work are the ROM image editing tools when I load them on my XP computer. So we'll have to make the most of those.

    I'm not skilled enough to edit the BIOS code directly and there's no time to learn either, so the solution would have to be messing around with chunks of BIOS data and GUI settings offered by AMI tools. After some poking around, it looks like there are no hidden setup menus or lines to unhide and no settings to set in the BIOS image itself - time to gamble. If my CPU microcode is not supported, then I may be able to add it to the ROM image and if it corrupt somehow, then I could remove or replace it. Download and run the CPU ID utility from Intel and open up the program that showed me the BIOS modules.. What do you know! Neither of my BIOS images have a microcode entry for my CPU ID 06F2. So all I have to do is to load that to the ROM image and re-flash!

    Intel distributes its microcode updates in some text form suitable for the Linux microcode_ctl utility. Even if I managed to convert this to binary and extract the part for my CPU, AMI BIOS probably wants to see the ucode patch in some specific format. Google for the CPU ID and "microcode". Most of the results are for Award BIOSes that I don't have the tools for (and the microcode store format is probably different anyway), but there is one about MSI P35 Platinum mobo that has AMI BIOS. Download, extract, open up, extract the proper microcode patch. Open up my ROM image, throw away the patch for the 06F1 CPU (can't risk making the ROM too big and making things crash - I would like to keep the laptop bootable, thank you), load the patch for 06F2, save changes. (This is the feeling you get when you know that things are going to turn out Just Great.) Edit floppy image, burn, boot, flash, power off, power on, "Intel CPU uCode Loading Error". That's odd..

    Let us double-check everything to make sure we didn't do anything wrong.. I extracted the correct microcode, replaced the chunk with exactly the same size.. Oh, there's this "Platform Type" field that says 20 for most of my original ucode patches, but the one from MSI says 01. Ah well, we can easily change that. Hex edit the patch file - 01 becomes 20 in no time. Throw away the patch with the wrong type, load the new one, "Not a valid patch file"! Those bastards have probably put checksums in there..

    A wild guess, "Platform Type" is the same for all similar ASUS laptops. Google for 06F2 doesn't bring anything, so we search for ASUS laptops supporting the C2D T5300. F3F is one of the first results. Download BIOS update, extract, look inside. Yes! The ucode for 06F2 has platform type 20. Extract, import, save, copy, burn, boot, flash, power off, power on and the system boots without error :D

    This is where I should put the moral of the story.. I don't think there is any, other than that all this is another proof of my stupidity (and vanity) and a good example of how to waste five hours of one's life.

    And yes. Children, do not update the system BIOS unless something is broken and you have a good reason to believe that a BIOS update would fix it. And always make backups of your stuff.
  2. captaincranky

    captaincranky TechSpot Addict Posts: 12,502   +2,295

    I Read Every Word......Unfortunately I Didn't Understand Every Word....

    I guess it's one down and four to go in getting your post read. Although, I propose that you might reach a wider audience, if you launched it on a Monday! As a recent victim of my own incompetence with respect to BIOS updating, I stand in awe of the whole endeavor!

    OK, I destroyed an Intel G965WH attempting to update the BIOS, so I could install a new E2200 Pentium. This board isn't (rather wasn't) overclockable so I sprung for the 2200 as it is the natively fastest in this processor sequence.Also the newest, requiring the newest version of the BIOS. Do you see the slippery slope I found myself on?

    Unfortunately, my level of experience doesn't lend itself to such an elegant (and inexpensive) solution such as your's. But still, there is this orphan CPU to contend with. Well, when the going gets tough....... Quite frankly, I simply don't don't know what the tough do. What I did, was to go shopping, which started by reading every CPU compatibility chart that Foxconn and Gigabyte had to offer. I finally settled on a Gigabyte GA G31MX-S2, which (so they say) supports the E2200 with BIOS version F1! Now, that's what I'm talking about. There is a $23.00 paranoia penalty over their lower priced G31 board. But what the hey, it has 8 channel sound (instead of six). I'll probably never use it, but it's less embarrassing than admitting you're just plain scared. Oh well, once bitten twice shy. Newegg no longer shows this board in their inventory, not even as out of stock. I wonder what's up with that?

    Anyway, thanks for taking the time to share your trials and tribulations with us. Great post, and I'm going to read it a couple more times, to try and make some of it sink in. Thanks again!
  3. MetalX

    MetalX TechSpot Chancellor Posts: 1,388

    I understood some of it... I get the main idea here. :D Don't update your BIOS unless you have to!
  4. Goalie

    Goalie TS Booster Posts: 616

    Get this man a book award!!
  5. captaincranky

    captaincranky TechSpot Addict Posts: 12,502   +2,295

    Would Something Like This Work........?

    I installed a Foxconn 945P7AA-8KS2 in place of the broken DG965. The 8KS2 is the earliest revision that Foxconn shows, and they are claiming it only supports Prescott CPUs, no dual core at all. However, the board's later versions will support C2D and whatnot.
    Is there any likelyhood that this board's BIOS could be re-chipped with a later variant. It carries an Award socketed BIOS. I was wondering if you thought someone like "Biosman" http://www.biosman.com/ might be able to hook me up.

    Desperate times demand desperate measures! (Winston Churchill, I think)

    Either that or I should learn hex editing, and I'm giving myself a "good luck with that".
  6. Masque

    Masque TechSpot Chancellor Posts: 1,058

    Nodsu....see the part where you mention not wanting to contact Asus to fix it for you? Well, my brother-in-law has a nice little saying...."Suck it up cupcake!" and that's probably what I would've done. I applaud you on your "stick-to-it-ivness" but damn......I really have got better things to do with 5 hours.

    On the plus side....you've learned a lot from it.....thanks for sharing.
  7. Nodsu

    Nodsu TS Rookie Topic Starter Posts: 5,837   +6

    Replacing the BIOS chip is not going to help. If there isn't a BIOS update with supprt for your CPU, then you are screwed.
    In addition to BIOS support for a CPU, you may have hardware limitations that don't let you run newer processors and there's no way to get around that..

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...