progress?

This commit is contained in:
2025-05-31 20:28:00 -04:00
parent 013b5a557e
commit c50d3f14a6
4 changed files with 39 additions and 2 deletions

View File

@ -20,7 +20,13 @@ void exception_handler(unsigned int i)
kerror("EXCEPTION");
printf("Exeption: %u\n", i);
#endif
__asm__ volatile ("cli; hlt"); // hangs the computer
if (i <= 31)
__asm__ volatile ("cli; hlt"); // hangs the computer
if (i == PIC_PIT) {
printf("Sending EOI instruction to PIT\n");
PIC_sendEOI(0);
}
}
void idt_set_descriptor(uint8_t vector, void *isr, uint8_t flags)
@ -52,7 +58,8 @@ void idt_init(void)
__asm__ volatile("lidt %0" : : "m"(idtr)); // load the new IDT
PIC_remap(0x20, 0x28);
IRQ_set_mask(0xfd); // unmask IRQ1
//IRQ_set_mask(0xfd); // unmask IRQ1
pic_disable(); //TODO: this is ending a timer interrupt even though its masked off..
__asm__ volatile("sti"); // set the interrupt flag
#ifdef __TESTING__

View File

@ -3,6 +3,7 @@ extern exception_handler
%macro isr_err_stub 1
isr_stub_%+%1:
pushad
cld
push dword %1
call exception_handler
popad
@ -12,6 +13,7 @@ isr_stub_%+%1:
%macro isr_no_err_stub 1
isr_stub_%+%1:
pushad
cld
push dword %1
call exception_handler
popad