Trouble with Timer Interrupt(PIT)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
crescent
Posts: 7
Joined: Thu May 14, 2020 9:23 pm

Trouble with Timer Interrupt(PIT)

Post 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
Octocontrabass
Member
Member
Posts: 5575
Joined: Mon Mar 25, 2013 7:01 pm

Re: Trouble with Timer Interrupt(PIT)

Post 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.
crescent
Posts: 7
Joined: Thu May 14, 2020 9:23 pm

Re: Trouble with Timer Interrupt(PIT)

Post by crescent »

Yep. That was the problem.
Post Reply