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

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

#include <stdint.h>
Include dependency graph for idt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  interrupt_frame
 The frame holding the registers when an interrupt happens. More...

Functions

struct __attribute__ ((packed)) idt_entry
 Entry for the ist holding information about the interrupt.
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.
uint64_t isr_stub_table [48]

Detailed Description

Initializes and holds the IDT for the kernel.

Author
Matheus Boscariol
Since
18/11/2026

Definition in file idt.h.

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed) )

Entry for the ist holding information about the interrupt.

The idtr register holding information about the idt.

The size of the idt

The base address of the idt

Definition at line 22 of file idt.h.

◆ 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:

◆ 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

◆ idt_exception_table

const char* idt_exception_table[]
extern

List of exceptions as strings.

Definition at line 24 of file idt.c.