LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
idt.c File Reference

Initializes and holds the IDT for the kernel. More...

#include <arch/x86_64/idt.h>
#include <arch/x86_64/irq.h>
#include <kernel/kprintf.h>
#include <kernel/log.h>
#include <kernel/vars.h>
#include <stdint.h>
#include "mm/vmm.h"
Include dependency graph for idt.c:

Go to the source code of this file.

Macros

#define MAX_DEPTH   16

Functions

static void hcf (void)
 Halts the cpu.
void exception_handler (struct interrupt_frame *frame)
 Prints information about an exception.
void init_idt (void)
 Initializes the IDT and loads it.
void idt_set_gate (int vector, uint64_t handler, uint16_t selector, uint8_t ist, uint8_t type_attr)
 Sets a gate (entry) for the idt.

Variables

const char * idt_exception_table []
 List of exceptions as strings.
struct idt_entry idt [256]
struct idtr _idtr

Detailed Description

Initializes and holds the IDT for the kernel.

Author
Matheus Boscariol
Since
18/11/2026

Definition in file idt.c.

Function Documentation

◆ exception_handler()

void exception_handler ( struct interrupt_frame * frame)

Prints information about an exception.

Parameters
frameThe frame that caused the exception

Definition at line 63 of file idt.c.

Here is the call graph for this function:

◆ hcf()

void hcf ( void )
static

Halts the cpu.

Definition at line 197 of file idt.c.

◆ idt_set_gate()

void idt_set_gate ( int vector,
uint64_t handler,
uint16_t selector,
uint8_t ist,
uint8_t type_attr )

Sets a gate (entry) for the idt.

Parameters
vectorThe exception vector
handlerThe address of the handler
selectorThe GDT selector
istThe ist used (0 = none, 1-7)
type_attrThe type attribute

Definition at line 188 of file idt.c.

◆ init_idt()

void init_idt ( void )

Initializes the IDT and loads it.

Definition at line 172 of file idt.c.

Here is the call graph for this function:

Variable Documentation

◆ _idtr

struct idtr _idtr

Definition at line 61 of file idt.c.

◆ idt

struct idt_entry idt[256]

Definition at line 59 of file idt.c.

◆ idt_exception_table

const char* idt_exception_table[]

List of exceptions as strings.

Definition at line 24 of file idt.c.