Page 1 of 1

Trouble with Timer Interrupt(PIT)

Posted: Sun May 17, 2020 1:24 am
by crescent
Hello Everyone,

I recently got started with my hobby OS . I am following James M's tutorial for the basics. However, I am having trouble getting timer interrupt to work. I do enable interrupts after setting up gdt, idt, remapping and installing irqs. The Timer driver seems straightforward to implement. I doubt that the driver itself is the problem as the IRQ doesn't fire for some reason(not even once).

I'd appreciate it if anyone could point out where I am going wrong.

Github: https://github.com/Crescent92/testOS

Re: Trouble with Timer Interrupt(PIT)

Posted: Mon May 25, 2020 7:41 am
by Octocontrabass
Your irq_handler() function takes one pointer to registers_t as an argument, but you don't pass that pointer to it. You probably want to add a "push esp" instruction right before the call, and appropriate stack cleanup right after.

Re: Trouble with Timer Interrupt(PIT)

Posted: Tue May 26, 2020 1:53 am
by crescent
Yep. That was the problem.