/* * cmosdump - dump the CMOS contents on x86. * * Copyright 2002 Jason Spence */ #include #include #include int main(void) { int i; int rc; unsigned char b; rc = iopl(3); if(rc == -1) { err(1, "You must be root to run this program."); } // Don't run two of these at the same time! There's no synchronization // mechanism for the CMOS resources. for(i = 0; i < 65536; ++i) { outb(i, 0x72); // You can do a outb here instead to write a value printf("%c", inb(0x73)); } return 0; }