irq: begin moving away from 8259

8259 PIC was used for interrupts for bootstrap development while the memory manager was being constructed. now that this is complete, a transition to the apic will begin

this patch fixes memory mapping issues with the reserved regions that caused page faults before.
This commit is contained in:
Michael Shaw 2023-04-22 12:58:53 -04:00
commit 22762339f9
6 changed files with 37 additions and 7 deletions

View file

@ -1,5 +1,6 @@
#include <kernel/acpi.h>
#include <kernel/mem.h>
#include <kernel/slab.h>
#include <dev/apic.h>
#include <stdint.h>
@ -81,7 +82,7 @@ int madt_parse_next_entry(int offset)
printf(LOG_INFO "LAPIC ID: %xh\n", m_lapic->apic_id);
break;
case MADT_IOAPIC:
ioapic_addr = m_ioapic->ioapic_addr;
ioapic_addr = m_ioapic->ioapic_addr | hhdm_start;
printf(LOG_INFO "IOAPIC address: %xh\n", m_ioapic->ioapic_addr);
break;
case MADT_IOAPIC_OVRD:
@ -125,7 +126,7 @@ void apic_init()
while ((offset = madt_parse_next_entry(offset)))
;
lapic_addr = __madt->lapic_addr;
lapic_addr = __madt->lapic_addr | hhdm_start;
printf(LOG_INFO "IOAPIC ADDR: %X\n", ioapic_addr);
printf(LOG_INFO "LAPIC ADDR : %X\n", lapic_addr);

View file

@ -17,6 +17,7 @@
popq %rsi
movq $\nr, %rdi
call exception
call yield
iretq
.endm