feat(pic): add pic functions to idt

This commit is contained in:
Malo Lecomte 2021-07-15 16:53:58 +02:00
parent d5a8623acd
commit f636fcbadf
2 changed files with 13 additions and 2 deletions

10
k/idt.c
View File

@ -4,6 +4,7 @@
static struct idt idt = { 0 };
static struct idt_entry_info infos[] = {
// Intel-defined (0-20)
{int_de, INTERRUPT_TYPE}, {int_db, INTERRUPT_TYPE},
{int_nmi, INTERRUPT_TYPE}, {int_bp, TRAP_TYPE},
{int_of, TRAP_TYPE}, {int_br, INTERRUPT_TYPE},
@ -14,7 +15,14 @@ static struct idt_entry_info infos[] = {
{int_pf, INTERRUPT_TYPE}, {0, INTERRUPT_TYPE},
{int_mf, INTERRUPT_TYPE}, {int_ac, INTERRUPT_TYPE},
{int_mc, INTERRUPT_TYPE}, {int_xm, INTERRUPT_TYPE},
{int_ve, INTERRUPT_TYPE}
{int_ve, INTERRUPT_TYPE},
// Intel-reserved (21-31)
{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
// user-defined (32-255)
{0, INTERRUPT_TYPE}, {pic_keyboard, INTERRUPT_TYPE}
};
void handle_interrupt(struct int_args *args)

View File

@ -5,9 +5,12 @@
#include "gdt.h"
#include "isr.h"
#define IDT_NB_ENTRIES 21
#define IDT_NB_ENTRIES 34
#define IDT_SIZE (IDT_NB_ENTRIES * sizeof(struct idt_entry))
#define INTEL_DEFINED 21
#define INTEL_UNUSED 31
#define INTERRUPT_TYPE 0x6
#define TRAP_TYPE 0x7