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.
If you're using the IOAPIC you'll need to route the PIT's interrupt to a core, or use the LAPIC timer instead. Assuming you're using the 8259 PIC, have you reprogrammed it to route the interrupts to your desired range (0x20 to 0x30)?
Does your function "idt_set_descriptor" actually set the given function as the IDT entry? If so, your function will need the appropriate prologue and epilogue. Either mark pit_irq_handler with __attribute__((interrupt)), or write an interrupt stub that calls into a central function, which can then call out into your registered function, pit_irq_handler. The stub function is preferable as it gives you more control over the information you save.
As Barry already mentioned, placing an ordinary function pointer in your IDT will cause problems because the ABI is incorrect. GCC and Clang support a function attribute that can correct the ABI for basic ring 0 bare-metal applications, but for a proper OS you'll need to write some assembly code.
FunnyGuy9796 wrote:I receive other interrupts so I know that it does not have to do with my IDT but I still am unable to figure it out.
There can be more than one problem. Did you unmask IRQ0 after setting up the IDT?