Base Clock
From Wiki.cyring.fr
(Difference between revisions)
(→Source code to read the Base Clock of the ASUS Rampage II GENE) |
(→Source code to read the Base Clock of the ASUS Rampage II GENE) |
||
Line 34: | Line 34: | ||
- | Copy and past the code into the bclk.c source file | + | Copy and past the code into the bclk.c source file<br /> |
+ | Execute as root to be able to read the [http://www.dmtf.org/standards/smbios DMI] | ||
<syntaxhighlight lang="bash" line start="1"> | <syntaxhighlight lang="bash" line start="1"> |
Revision as of 10:16, 6 April 2012
Source code to read the Base Clock of the ASUS Rampage II GENE
// bclk.c
#include
#include
#include
int 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);
}
else
clk = 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
Execute as root to be able to read the DMI
# nano bclk.c
# clang bclk.c -o bclk
# ./bclk
BCLK=160 MHz