Luc Verhaegen (libv) wrote,
Luc Verhaegen
libv

  • Location:
  • Mood:
  • Music:

bios_extract, the tool for all, err, some of your bios extraction needs.

As everyone by now knows, i dislike bioses, for a variety of well-founded technical reasons that i am not going to repeat yet again. Not only have i been fighting BIOS based modesetting for ages, but i am also involved with coreboot and flashrom, doing (hopefully) my part on freeing hw.

But, legacy bioses are chock-full of often very important information that chip or board makers are unable or unwilling to give you, even if it is just to be able to tie 2-and-2 together so that datasheets make sense. So, being able to find what you need to know from a legacy bios is an important skill to have, even though it often resembles sticking ones hand up a drainpipe and rummaging around in the muck.

Now, you often cannot just point a disassembler to a legacy BIOS image, because, in order to save space, much of the important code is to be found in compressed modules within this larger image. At boot, these modules are decompressed as soon as some memory has been set up. And while some of this code survives long after booting in the upper segments, parts of this code gets overwritten soon after being run.

There are a few utilities around to go and extract these modules from legacy bios images into individual files, but they were not always easy to get, build or use. Plus, the code wasn't always that nice, and each tool was made for one vendor and they re-used some version of the same lh5 extraction routine over and over again.

So, using some of the very valuable information and code from these utilities, i created bios_extract, with a cleaner structure, cleaner code and a very simple interface. It currently handles AMI, award (and thus also asus) and phoenix (non-trustedbios) BIOSes, and can be expanded easily to support other BIOS types.

You can find it in my fd.o git, from which it should be easy to build, as it requires nothing but glibc. And you just point it to a BIOS image, and it will happily clutter up your working directory for you.

As usual, if it isn't working as expected for you, feel free to poke me wherever you find me :)

And of course, another nice use of this utility is extracting PCI Expansion ROMs from onboard devices, like IGP graphics, raid controllers, nic boot roms, etc, for inclusion in a coreboot image. Even though for IGP devices, i am working on getting rid of this at least for unichrome.

In any case, have fun rummaging around!
Tags: ami, award, bios, bios_extract, coreboot, flashrom, phoenix
Subscribe

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments