//Set the new clock interrupt (replace with our function)
//id=InterruptAttach(SYSPAGE_ENTRY(qtime)->intr, &handler, NULL, 0, 0 );
//Set mode 0 for interrupt
out8(0x43, 0x36);
// Load new interrupt count value
// This will be the actual value written to the register
unsigned short l_count = (unsigned short)(65536.f / mClock.total);
out8(0x40, (mCount & 0x0FF));
out8(0x40, ((mCount >> 8) & 0x0FF));
InterruptEnable();
[/code]
Well, when i use this interrupt and try to play with the frequency of the clock etc … i see that the system time (computer time) seems to be affected.
The other Interrupt Vectore I could possibly use is the 1CH (TimerTick).
Am i correct ? Also how do i attach an interrupt vector with the vectore adrress 1CH using the function InterruptAttach().
As I said, use ClockPeriod(), because this goes to the kernel, the kernel will change the timer hardware and ajust all its internal divider to handle system time problem.
yeh you are right … i am converting from DOS to QNX … i would really appreciate if you could give me a sample code of how to increase the frequency using ClockPeriod() for the counter at 0x40h, so that i could generate interrups at faster rates.
In my code i do … which messed up the system clock
If you read the ClockPeriod() documentation you noticed that it takes value in absolute time, say 100ms or 10ms or 1ms, etc. You have to figure out what period 0x40 is equal to, 1ms? 10ms? 50ms? Note that not all value can be accepted.