computer type and speed

When my computer boots up,
Qnx displays the computer speed (in mhz) and type.
before(/along with) the boot image info.

Is there any way of getting this info from the command prompt?
(not #sin in)

#sin in will give the type, but what about the speed in mhz?

-Glenn

Glenn Sherman <gsherman@remove_this.m20.net> wrote:

When my computer boots up,
Qnx displays the computer speed (in mhz) and type.
before(/along with) the boot image info.

Is there any way of getting this info from the command prompt?
(not #sin in)

#sin in will give the type, but what about the speed in mhz?

From the docs for qnx_osinfo():

long unsigned cpu_features
cpu_features & 0xFFF gives the CPU speed, in Mhz.


-David

QNX Training Services
I do not answer technical questions by email.

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:9uqs9u$kc8$1@nntp.qnx.com

Glenn Sherman <gsherman@remove_this.m20.net> wrote:

When my computer boots up,
Qnx displays the computer speed (in mhz) and type.
before(/along with) the boot image info.

Is there any way of getting this info from the command prompt?
(not #sin in)

#sin in will give the type, but what about the speed in mhz?

From the docs for qnx_osinfo():

long unsigned cpu_features
cpu_features & 0xFFF gives the CPU speed, in Mhz.

that is probably true, but what if I don’t have a C compiler.

  • That is why I asked “from the command prompt”


-David

QNX Training Services
I do not answer technical questions by email.

-Glenn

Glenn Sherman <gsherman@remove_this.m20.net> wrote:

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:9uqs9u$kc8$> 1@nntp.qnx.com> …
Glenn Sherman <gsherman@remove_this.m20.net> wrote:

When my computer boots up,
Qnx displays the computer speed (in mhz) and type.
before(/along with) the boot image info.

Is there any way of getting this info from the command prompt?
(not #sin in)

#sin in will give the type, but what about the speed in mhz?

From the docs for qnx_osinfo():

long unsigned cpu_features
cpu_features & 0xFFF gives the CPU speed, in Mhz.

that is probably true, but what if I don’t have a C compiler.

  • That is why I asked “from the command prompt”

Find a friend with a compiler who can write & compile you a 6-line
program that gets & prints that value? I don’t think any of our
utilities print it out.

-David

QNX Training Services
I do not answer technical questions by email.

So when 4.5 GHz CPUs come on the scene they will show up as 500 MHz.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“David Gibbs” <dagibbs@qnx.com> wrote in message
news:9uqs9u$kc8$1@nntp.qnx.com

From the docs for qnx_osinfo():

long unsigned cpu_features
cpu_features & 0xFFF gives the CPU speed, in Mhz.


-David

QNX Training Services
I do not answer technical questions by email.

Bill Caroselli <qtps@earthlink.net> wrote:

So when 4.5 GHz CPUs come on the scene they will show up as 500 MHz.

Well, the other place to look is the cycles_per_sec in the timesel.

Code like:

#include <sys/osinfo.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <i86.h>

void main()
{
struct _osinfo osinfo;
struct _timesel far *ts;
long unsigned cycles_per_sec;

qnx_osinfo( 0, &osinfo );

ts = MK_FP( osinfo.timesel, 0 );

cycles_per_sec = ts->cycles_per_sec;

printf(“speed is %d Mhz\n”, osinfo.cpu_features & 0xFFF );
printf(“cycles is %d\n”, cycles_per_sec );
}

But, that is an unsigned long, so it will also wrap around 4G speed.
So, it doesn’t help much either.

What can I say? We use a 64-bit field for the cycles_per_second
field (equivalent) under QNX 6.

-David

QNX Training Services
I do not answer technical questions by email.

Hi Dave,

I said that half tongue in cheek. It’s just funny that since the early days
of QNX2 we’ve been overflowing whatever speed fields have been defined.

Merry Christmas or whatever


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“David Gibbs” <dagibbs@qnx.com> wrote in message
news:9v2sbf$af4$1@nntp.qnx.com

Bill Caroselli <> qtps@earthlink.net> > wrote:
So when 4.5 GHz CPUs come on the scene they will show up as 500 MHz.

Well, the other place to look is the cycles_per_sec in the timesel.

Code like:

#include <sys/osinfo.h
#include <unistd.h
#include <stdlib.h
#include <stdio.h
#include <i86.h

void main()
{
struct _osinfo osinfo;
struct _timesel far *ts;
long unsigned cycles_per_sec;

qnx_osinfo( 0, &osinfo );

ts = MK_FP( osinfo.timesel, 0 );

cycles_per_sec = ts->cycles_per_sec;

printf(“speed is %d Mhz\n”, osinfo.cpu_features & 0xFFF );
printf(“cycles is %d\n”, cycles_per_sec );
}

But, that is an unsigned long, so it will also wrap around 4G speed.
So, it doesn’t help much either.

What can I say? We use a 64-bit field for the cycles_per_second
field (equivalent) under QNX 6.

-David

QNX Training Services
I do not answer technical questions by email.