Monday, 9 August 2010

Firmware Test Suite: BIOS+ACPI health check

The FirmWare Test Suite (fwts) is a tool I've been working on to do automatic testing of a PC's firmware. There can be a lot of subtle or vexing Linux Kernel/firmware issues caused when firmware is buggy, so it's useful to have a tool that can automatically check for common BIOS and ACPI errors. Where possible the tool will give some form of advice on how to fix issues or workaround firmware issues.

It's packaged up and in Maverick universe, you can install it using:

sudo apt-get install fwts

To see the tests available in the tool use:

fwts --show-tests

There are over 30 tests and I hope to expand this every time I find new firmware issues which can be diagnosed automatically in a tool.

To run a test use, for example the ACPI AML syntax checking test use:

sudo fwts syntaxcheck

There are categories of tests, for example, by default fwts will run batch mode tests which run without the need of user intervention. Some tests, such as checking the laptop lid works or hotkeys requires user intervention - these are interactive tests and can be invoked using:

sudo fwts --interactive

By default the tool will append the test results into a log file called results.log. This logs the date/time the test was run, the name of the test and the test results and hopefully some useful advice if a test fails.

I suggest checking out the manual page to see some examples how to fully drive this tool.

Quite a lot of the tests have been picked up from the core of linuxfirmwarekit.org, but I've added a bunch more tests, and expanded the types of errors it checks for and the feedback advice it reports. I've targeted fwts to run with the Maverick 2.6.35 kernel but it should work fine on Lucid kernels too. I've written fwts with command line driven test framework to run the tests mainly to allow fwts to easily plug into more powerful test frameworks.

If you want to run the tool from a bootable USB flash key, then one can download a i386 or amd64 image and dd it to a USB flash key.

For example:

wget http://kernel.ubuntu.com/~kernel-ppa/testing/maverick-desktop-i386-fwts.img
sudo dd if=maverick-desktop-i386-fwts.img of=/dev/sdX

where /dev/sdX is the block device of your USB flash key

then boot off this USB flash key and let it run the tests. At the end it will automatically shutdown the PC and you can then remove the key. The key has a FAT formatted partition containing the results of the test in a directory named: fwts/ddmmyyyy/hhmm/results.log, where ddmmyyyy are the digits in the date and hhmm for the time the test was started.

The fwts PPA can be found in the Firmware Testing Team project and the source code is available in a git repository here.

I've also written a short OpenOffice presentation on the tool which also may prove instructive.

12 comments:

  1. Hi,

    Is firmwarekit upstream dead? Any chance you can push the tests back upstream or take on a maintainer role there?

    ReplyDelete
  2. Kevin, when I spoke to Intel back in May I was told "AFAIK there's no one from Intel supporting the toolkit at this point." which was one of the many reasons for picking up some of the (ageing) goodness from there as a starting point.

    ReplyDelete
  3. Hi Colin,

    Nice Work, that Tool is awesome :-)

    ReplyDelete
  4. Hi,

    I cannot report bugs on launchpad, But I get two segmentation faults.

    (ben@oberth)[~] $ sudo fwts -p --fwts-debug dmesg_common
    0001 16/07/10 21:24:50 fwts fwts_framework_run_registered_tests() - run test dmesg_common
    0002 16/07/10 21:24:50 fwts fwts_framework_run_registered_tests() - test dmesg_common
    0003 16/07/10 21:24:50 fwts fwts_framework_run_test() entered
    0006 16/07/10 21:24:50 fwts fwts_framework_run_test() calling ops->init()
    0007 16/07/10 21:24:50 fwts exectuting test 1
    Segmentation fault : 0%

    ReplyDelete
  5. I'm giving a chance to your app, looks useful, I hope it would be part of the Ubuntu's LiveCD/USB, like a startup option, or just for invoking it into a user terminal...

    Greetings,
    JaD!

    ReplyDelete
  6. @mampf, I suggest capturing the output from dmesg and sending it to me - colin.king at canonical.com

    ReplyDelete
  7. @jado92mx, at the moment another tool for the LiveCD/USB means we got to cram more on the ISO and there is only so much one can cram on a CD image.

    The tool is part of a downloadable USB key image http://kernel.ubuntu.com/~kernel-ppa/testing/maverick-desktop-i386-fwts.img which designed to boot and run this test automatically.

    ReplyDelete
  8. Have you or someone else from Canonical considered using this at the upcoming UEFI Forum plugfest in Taipei during October?

    ReplyDelete
  9. @Kevin, we do have an engineer from Canonical attending the UEFI Forum plugfest. Can you send me an Email colin.king at canonical.com and I will sort out the various details.

    ReplyDelete
  10. I am having problems with a Dell Inspiron 600m. It will only work with acpi=off. All other modifiers don't help. So I thought that maybe I have some corrupted ACPI tables and came across your site and your program fwts. I have plenty of error messages. Is there any way to know how to fix them?

    ReplyDelete
    Replies
    1. The 600M is a fairly old bit of kit, and from what I gather from various bug reports the ACPI tables aren't great with Linux. Since it's not going to be fixed with any BIOS updates, I doubt there is much we can easily do for such an old machine.

      Delete