Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the type of CPU present

0 views
Skip to first unread message

Anantha Kesari

unread,
Aug 24, 2006, 3:34:39 AM8/24/06
to
Hi,

I am looking at ways of getting the type of CPU in any box. Like I would
like to if the CPU is Intel based or AMD based and accordingly give that
output. We are using the NetManIDGetRoutine API as below:

#include "subjects.h" /* OSSubjects, ... */

CPUInfo cpuInfo;
LONG processorType;
LONG ccode;

ccode = NetManIDGetRoutine(0, OSSubjects + 7, &cpuInfo, 2, 0, NULL);
if (ccode)
{
processorType = 0xFFFFFFFF;
}
else
{
processorType = cpuInfo.CPUType;
}

Based on the processorType, we are figuring out if it is a 386 or 486 or
a Pentium machine. This is under the assumption that it is an Intel
processor. But I would like to know how to get information if it is an
AMD processor. Which API can I use here and how do I use it?

Customer is asking for this and so it will help if someone gets back on
this.

Thanks,
Ananth.

Guenter

unread,
Aug 24, 2006, 8:52:34 AM8/24/06
to
Hi Anantha,

Anantha Kesari <hyan...@novell.com> wrote in news:44ED5717.7070507
@novell.com:
nice to meet you here - everthing well so far?

I've used in the past some inline assembler for the cpuid instruction:
http://www.gknw.net/development/samples/nlmconv/cpuid.zip
the binary works from console as well as from Apache2 (just put into cgi-
bin); maybe that can help you already....

greetz, Guenter.


Russell Bateman

unread,
Aug 24, 2006, 9:20:10 PM8/24/06
to
Ananth,

You can also probably call netware_cpu_info, in libc (see libc's
monitor.h). I think you can do this from a clib application, but you
might ask Jeff Lawson for certain.

Another route to go is sys/unistd.h's confstr function which is an open
standard. I * think * it doesn't require context because I think it
works the way Günter's stuff works (only more standard?). Try the
pronouns such as _CS_MACHINE and others. You'll find this stuff
commented in sys/unistd.h on your libc SDK.

I'm pretty sure that either of these methods will get you what you want.

Good luck,

Russ

0 new messages