1000Hz PIC timer working + IDT dispatch/handler fixes

This commit is contained in:
2025-12-27 13:52:05 +01:00
parent 24d75463b8
commit 54f26c506e
9 changed files with 204 additions and 52 deletions

View File

@@ -9,6 +9,9 @@ struct idtr idt_reg;
// Address to our first interrupt handler
extern char vector_0_handler[];
// Timer ticks
extern uint64_t ticks;
void idt_set_entry(uint8_t vector, void* handler, uint8_t dpl)
{
uint64_t handler_addr = (uint64_t)handler;
@@ -119,6 +122,13 @@ struct cpu_status_t* interrupt_dispatch(struct cpu_status_t* context)
serial_kputs("kernel: idt: Control Protection Exception!\n");
break;
case 32:
serial_kputs("Tick!");
ticks++;
// Send an EOI so that we can continue having interrupts
outb(0x20, 0x20);
break;
default:
serial_kputs("kernel: idt: Unexpected interrupt\n");
break;