: Here are the values from the qnx_osinfo command
: cpu_speed = 12758
: cpu = 586
: totmemk = 65152
: freememk = 52564
: version = 425
: The CPU type, and OS version is correct, but the other values memory and cpu speed are a bit off… am I missing something ?
The structure changed a bit (I think totmemk and freememk weren’t big
enough). Use totpmem and freepmem instead (they’re both long unsigned).
Someone else might know about the CPU speed.
The totpmem and freepmem worked fine, but the CPU speed is still a mystery. The Watcom Library Reference say “a PC is 96” and the /sys/osinfo.h says “a PC is 960” which one is it ?
and more importent, what does this number mean ?
Is there a way to calculate the CPU speed from other system variables ?.. anyone ?
The CPU speed is hosed anyway with “modern” CPUs. The CPU speed number is the same as
that produced by “sin ne”, where it sez, “Speed”, i.e.,
Nid Machine Cpu Fpu Speed Memory Hard Flop Other Display Flags
1 PCI 686 687 19117 402.1M 240121M 1.4M TCP VGA Color -3+±—8P
2 PCI 686 687 58702 536.3M 35673M 1.4M cd VGA Color -3+±—8P
6 PCI 686 687 59397 268.0M 8257M 1.4M cd VGA Color -3+±—8P
137216 1206M 284051M
Machine 1 is a Pentium 750 MHz, node 2 is an Athlon 1.3GHz and node 6 is a 500 MHz
Pentium. As you can see, some “roll over” has occurred over the years…
What do you want to do with the CPU speed, anyway? You might consider writing your
own “benchmark” program that runs at a super-high priority during startup and saves
its “computed CPU performance index” number somewhere for easy reference…
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.