Base Clock
From Wiki.cyring.fr
(Difference between revisions)
(→Source code to read the Base Clock of the ASUS Rampage II GENE) |
|||
| Line 31: | Line 31: | ||
printf( "BCLK=%d MHzn", bios_bclk() ); | printf( "BCLK=%d MHzn", bios_bclk() ); | ||
} | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | |||
| + | Copy and past the code into the bclk.c source file then exec as root | ||
| + | |||
| + | <syntaxhighlight lang="bash" line start="1"> | ||
| + | # nano bclk.c | ||
| + | # clang bclk.c -o bclk | ||
| + | # ./bclk | ||
| + | BCLK=160 MHz | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 10:12, 6 April 2012
Source code to read the Base Clock of the ASUS Rampage II GENE
// bclk.c#include#include#includeint bios_bclk()
{int fd = -1;
ssize_t br = 1;
char buf[2];
int clk = 0;
if( (fd = open("/dev/mem", O_RDONLY)) != -1 )
{if( (lseek(fd, 0xf08d9 + 0x12, SEEK_SET ) != -1)
&& ((br = read(fd, buf, 2)) !=1) )
clk = ((unsigned char) (buf[0])) + ((unsigned char) (buf[1] << 8));
close(fd);
}elseclk = 0;
return(clk);
}int main(int argc, char **argv)
{printf( "BCLK=%d MHzn", bios_bclk() );
}
Copy and past the code into the bclk.c source file then exec as root
# nano bclk.c# clang bclk.c -o bclk# ./bclkBCLK=160 MHz