k-tana-zero/k/idt.c

21 lines
309 B
C
Raw Normal View History

2021-07-14 19:32:15 +00:00
#include "idt.h"
static struct idt idt = { 0 };
static void load_idt()
{
struct idt_r idtr;
idtr.addr = (uint32_t)&idt;
idtr.limit = IDT_SIZE - 1;
asm volatile("lidt %0\n"
:
: "m" (idtr)
: "memory");
}
void init_idt()
{
load_idt();
}