[ltp] Making backup of BIOS settings?

Ryan Underwood linux-thinkpad@linux-thinkpad.org
Wed, 23 Aug 2006 11:03:56 -0500


On Fri, Aug 18, 2006 at 08:40:55AM +0200, Felix E. Klee wrote:
> Is it possible to read the BIOS settings of a T41 from within LINUX in
> order to get some kind of backup.

You can read/write CMOS with a simple C program:
#include <sys/io.h>
#include <assert.h>

int main(int argc, char** argv)
{
        assert(iopl(3) != -1);
        unsigned char i, cmos1[256], cmos2[256];
        for (i = 0; i < 0xff; i++) {
                outb(i, 0x70);
                cmos1[i] = inb(0x71);
                outb(i, 0x72);
                cmos1[i] = inb(0x73);
        }
}

Unfortunately, this will not include data that are stored in the
Thinkpad's serial EEPROM.  Access to it is disabled by the BIOS
so it is impossible for software to dump.

-- 
Ryan Underwood, <nemesis@icequake.net>