Interrupt Vectors


//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 /;
out8(0x40, (mCount & 0x0FF));
out8(0x40, ((mCount >> 8) & 0x0FF));


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().

I would appreciate quick responses.


DO NOT PLAY WITH SYSTEM TIMER. The timer hardware is reserved for OS usage. You can change the frequency with ClockPeriod()…

You should read the whole documentation set first. You definitely need to give up most DOS concept ;-)

wont this affect the system time ??

hmmm … so do you mean i can increase the rate of interrupts generated without affecting the system time ??
If so how would i do that?


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.

Forget all you know about DOS…

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

id=InterruptAttach(0, &handler, NULL, 0, 0 ); 
out8(0x43, 0x36);
out8(0x40, (mCount & 0x0FF));
out8(0x40, ((mCount >> 8) & 0x0FF)); 


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.

thanks for the response … 0x40 is the address for the 82c54 counter#0 and 0x43 is the address for the control byte to that timer.

Sorry miss read 0x40 for the vaoue being written in the timer. I should have said mCount ;-)

thanks … i use ClockPeriod() now