8253 PIT timer problem
Posted: Mon May 19, 2003 11:52 pm
hello fellow devers,
i seem to be having a problem with getting my PIT ISR to be called. Remapped the PICs to 0x20 and installed the PIT ISR to 0x20(IRQ0), but it never gets called. Actually, in bochs, when you reset it gets called once, but not on a PC. Here is the PIT init code:
i seem to be having a problem with getting my PIT ISR to be called. Remapped the PICs to 0x20 and installed the PIT ISR to 0x20(IRQ0), but it never gets called. Actually, in bochs, when you reset it gets called once, but not on a PC. Here is the PIT init code:
Code: Select all
extern void timer_ISR();
dword ticks;
char tstr[9];
void mud()
{
/* mud delay */
if(10 > 9){ if(10 / 2 > 5){}}
}
void timer()
{
ticks++;
itoa(ticks, 10, tstr);
print("ticks:",0,10,0x04);
print(tstr,0,11,0x04);
outportb(0x20, EOI);
}
void pit_init()
{
disable_ints();
outportb(MODECTRL, S_CNTR0|RWLSB_MSB|MODE3);
//mud();
outportb(COUNTER0, LOBYTE(0));
//mud();
outportb(COUNTER0, HIBYTE(0));
AddInt(0x20,timer_ISR,G_INT|G_PRESENT|G_DPL0|G_32BIT, 0x8);
unmaskIRQ(TIMER);
ticks=0;
}
[\code]
I have tried different modes, frequencies and even interrupts, but no luck. I know the ISR is there because i can call it with the asm int command. Please help me out, i really need this done. thank you in advance.
Regards,
mr. xsism