OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 9:43 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: CPU infos
PostPosted: Thu Jan 31, 2008 8:34 am 
Offline
Member
Member
User avatar

Joined: Wed Nov 07, 2007 12:15 pm
Posts: 226
Location: Italy
Can anyone tells me how to read some infos from the cpu such as the usage percentage, or the temperature?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 31, 2008 9:35 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7614
Location: Germany
ACPI. Or whatever special interface the specific CPU family you are thinking of supports...

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 01, 2008 3:41 pm 
Offline
Member
Member
User avatar

Joined: Sun Jan 20, 2008 5:51 am
Posts: 50
You can't read usage percentage. You will have to calculate that yourself.

_________________
Conway's Law: If you have four groups working on a compiler, you'll get a 4-pass compiler.
Melvin Conway


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 02, 2008 9:45 am 
Offline
Member
Member
User avatar

Joined: Fri Aug 03, 2007 6:03 am
Posts: 536
Location: Cambridge, UK
You can get CPU model by using the CPUID asm command...

Code:
static void newcpuid(unsigned long op, unsigned long v[4])
{
__asm__ ("cpuid": "=a" (v[0]), "=b" (v[1]), "=c" (v[2]), "=d" (v[3]):"a" (op));
}

_________________
~ Lukem95 [ Cake ]
Release: 0.08b
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: dmemsm, SemrushBot [Bot] and 235 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group