View topic - QNX 4.25 - Get CPU info
QNX 4.25 - Get CPU info
5 posts
• Page 1 of 1
QNX 4.25 - Get CPU info
Hi, I need a process or application to get the CPU info, could you help me?
I need CPU type (P3,P4,586,etc) and speed.
Thanks
I need CPU type (P3,P4,586,etc) and speed.
Thanks
Last edited by skeepa on Fri Jun 01, 2007 1:18 pm, edited 1 time in total.
- skeepa
- New Member
- Posts: 2
- Joined: Thu May 31, 2007 11:42 pm
RE: QNX 4.25 - Get CPU info
I'm out of town without documentation nearby, But I'm pretty sure that there is a qnx_...() routine that gives you this information
back in a structure. It also gives you specific process information.
back in a structure. It also gives you specific process information.
- maschoen
- QNX Master
- Posts: 2728
- Joined: Wed Jun 25, 2003 5:18 pm
RE: QNX 4.25 - Get CPU info
Yes it's qnx_osinfo() and in the structure returned there is a flag containing CPU type information.
- mario
- QNX Master
- Posts: 4132
- Joined: Sun Sep 01, 2002 1:04 am
RE: QNX 4.25 - Get CPU info
Thanks Mario. I tried the following example:
#include <stdio.h>
#include <sys/osinfo.h>
struct _osinfo osdata;
void main()
{
if( qnx_osinfo( 0, &osdata ) != -1 )
printf( "Cpu speed is %d\n", osdata.cpu_speed );
}
result: Cpu speed is 62942
What does this number mean?
#include <stdio.h>
#include <sys/osinfo.h>
struct _osinfo osdata;
void main()
{
if( qnx_osinfo( 0, &osdata ) != -1 )
printf( "Cpu speed is %d\n", osdata.cpu_speed );
}
result: Cpu speed is 62942
What does this number mean?
- skeepa
- New Member
- Posts: 2
- Joined: Thu May 31, 2007 11:42 pm
RE: QNX 4.25 - Get CPU info
It's a relative number. It provides an approximate way to compare the speed of two processors, but historically it has not been very accurate. Judging the speed of a processor is very complex as issues like cache or instruction order can dramatically change the rate at which instructions are executed. I've never seen the algorithm published, but if you are real concerned you might check with QNX for details.
- maschoen
- QNX Master
- Posts: 2728
- Joined: Wed Jun 25, 2003 5:18 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests