1000Hz PIC timer working + IDT dispatch/handler fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user