Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title QNX4 CPU powersaving via HLT
Ref. No. QNX.000009565
Category(ies) Kernel, Development, Configuration
Issue We would like to implement power-saving features using QNX4.25.  For example, when the process "idle" is run a HLT instruction is issued. Many processors, such as the K6 reduce their power consumption via this method.

A mother board with a Pentium MMX 266 processor does not seem to implement this by default.  This is normally controlled by the MSR register 12 of the processor, and we have tried issuing RDMSR and WRMSR instructions, but the programs terminate with a SIGSEGV.  Other instructions like CPUID still work. Is there a limitation for the use of RDMSR and WRMSR in QNX4?

Solution QNX4 does not include any power-saving utilities, but there are hooks in the kernel to allow the implementation of some power-saving features.  There is an archive of some apm software posted in /usr/free/tmp/Apm-1.3.tar.gz.
In most cases an APM capable BIOS that will wake on demand is need, otherwise you could go to sleep and never wake up.

There are two options here:

1. Look at the apm src and use a BIOS that supports APM 1.2

2. If you need to control everything yourself and you trust your code then you can hit those registers from an int handler (you need to be at ring 0 in order to hit them).  So have a cheap interrupt handler that gets invoked once on a timer tick.  Do your manipulations and then get out.