At loss: seeing no IRQ's from PIC2 (testing RTC)
Posted: Wed Feb 17, 2021 9:15 am
I'm trying to get the CMOS RTC clock going and I'm up against it a bit.
This is a 64bit kernel, running as an UEFI application, and I run it in Qemu and VirtualBox.
I'm following the instructions from https://wiki.osdev.org/RTC to enable irq8 @ 1KHz.
My version looks like this:
I've initialized PIC1 and PIC2, and I can confirm that I'm servicing IRQs from the PIT and keyboard correctly.
I've followed the PIC setup procedure from https://wiki.osdev.org/PIC .
When I enable the RTC, and I install an IRQ8 handler, I get nothing. Everything else works but I don't get IRQ8.
There are two possible causes here; one is that PIC2 isn't wired up correctly to serve IRQ>=8 , the other is that IRQ8 isn't firing at all.
So my questions are:
* is there a *known* good reason why this wouldn't just work (as in; "oh, didn't you know that X needs to be divided by Pi first")?
* can anyone recommend a way to narrow this down? I can't trigger an IRQ from software to test if it's actually working (or can I...?), and I can't use Bochs for debugging since it's 64 bit and UEFI...
* other inspired ideas?
cheers,
Jarl
This is a 64bit kernel, running as an UEFI application, and I run it in Qemu and VirtualBox.
I'm following the instructions from https://wiki.osdev.org/RTC to enable irq8 @ 1KHz.
My version looks like this:
Code: Select all
static void _enable_rtc_timer(void) {
x86_64_cli();
x86_64_outb(0x70, 0x8b); //< also disable NMI
x86_64_io_wait();
uint8_t prev = x86_64_inb(0x71);
x86_64_outb(0x70, 0x8b);
x86_64_outb(0x71, prev | 0x40);
x86_64_sti();
}
I've followed the PIC setup procedure from https://wiki.osdev.org/PIC .
When I enable the RTC, and I install an IRQ8 handler, I get nothing. Everything else works but I don't get IRQ8.
There are two possible causes here; one is that PIC2 isn't wired up correctly to serve IRQ>=8 , the other is that IRQ8 isn't firing at all.
So my questions are:
* is there a *known* good reason why this wouldn't just work (as in; "oh, didn't you know that X needs to be divided by Pi first")?
* can anyone recommend a way to narrow this down? I can't trigger an IRQ from software to test if it's actually working (or can I...?), and I can't use Bochs for debugging since it's 64 bit and UEFI...
* other inspired ideas?
cheers,
Jarl