Advertisement

hardware info header

Started by February 28, 2006 05:20 PM
3 comments, last by pulpfist 18 years, 8 months ago
im looking for a simple c header that will find out various basic hardware info under unix eg memory / cpu type + speed. perhaps also distribution version as well ta zed
Have you had a look at /proc

AFAIK you can just read the info from the files in there...
Advertisement
I am just finishing up a project for work that had to do this. Let me tell you, getting hardware and system information as a user space process is a pain in the butt. For most things there is no friendly API to get the information as is the case in Windows.

You will definitely want to look at /proc as one place to get information. Also get the source code for utilities that do something similar to what you want and see how they do it.

To get system memory you can use
sysinfo

Edit:
For cpu information you either have to use assembly to query thecpu directly or parse the information in /proc/cpuinfo
"Pfft, Facts! Facts can be used to prove anything!" -- Homer J. Simpson
ta guys, i was hoping that someone had already written something similar ( which no doubt has occured >30,000x in the past )
i want it, so i can see what ppls hardware + distributions are if they have problems running my game, to aid in the debugging.
This might help

This topic is closed to new replies.

Advertisement