[ltp] Making backup of BIOS settings?

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


On Wed, Aug 23, 2006 at 11:03:56AM -0500, Ryan Underwood wrote:
> 
> 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);
>                 cmos2[i] = inb(0x73);
                  ^^^^^^^^
>         }
> }

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