Page 1 of 1

Writing code to detect processor

Posted: Wed Nov 21, 2001 3:05 pm
by Fredrick
What code can I write to detect processor speed, ram?

Re: Writing code to detect processor

Posted: Wed Nov 21, 2001 10:02 pm
by df
detecting processor speed is a convoluted process.

if its a pentium class  you can use rdtsc on it and time a known instruction.

if its < pentium, you have to resort to lots of tricks (ie: make, model, stepping etc).

or

use some extended bios info stored in the tables in the bios, which give processor speed, motherboard type/maker, etc.

detecting ram is much easier. let something like grub do it for you and use its value. (grub just uses some of the extended bios calls)