I get only one interrupt after enabling it.
This is what I'm doing:
Enable PIE bit on the MC146818A chip:
Enable cascade (IRQ2) and IRQ8 on the 8259:// ! assumes interrupts are disabled
outportb(0x70, 0x0b); // choose RTC register 11
int regB = inportb(0x71);
outportb(0x70, 0x0b);
outportb(0x71, regB | 0x40); // enable PIE bit
I have read here http://www.compuphase.com/int70.txt that I have to read register C in my ISR so IRQ8 continues triggering...// enable IRQ0 (timer) IRQ1 (keyboard) and IRQ2 (cascade) on primary PIC
outportb(0x21, ~0x07);
// enable IRQ8 on secondary PIC
outportb(0xA1, ~0x01);
So I did (in my ISR):
Code: Select all
outportb(0x70, 0x0c); // select RTC status register C
int val = inportb(0x71);
if(val & 0x40)
{
++rtc_ticks;
}
I tried reenabling the PI bit but that didn't work neither. Do I always need to disable NMI's during reads/writes to ports 0x70/0x71?
Help someone?