The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
idt.c File Reference
#include "idt.h"
#include "common/stdint.h"
#include "kernel/assert.h"

Functions

struct idt_entry __attribute__ ((packed))
void idt_load (uint32_t idt_ptr_addr)
 defined in idt_load.asm, loads the IDT descriptor into the IDTR register.
void idt_set_gate (int vector, void *base, uint16_t segment, uint8_t flags)
 configure a single IDT gate entry.
void idt_enable_gate (int vector)
 enable an IDT gate by setting its present bit.
void idt_disable_gate (int vector)
 disable an IDT gate by clearing its present bit.
void idt_initialize (void)
 initialize the Interrupt Descriptor Table (IDT) and load it into the IDTR register.
void idt_load_core (void)
 load the IDT into the IDTR of the core that runs the call.

Variables

uint16_t base_low
uint16_t segment_selector
uint8_t reserved
uint8_t flags
uint16_t base_high
uint16_t limit
uint32_t base

Function Documentation

◆ __attribute__()

struct idt_entry __attribute__ ( (packed) )

◆ idt_load()

void idt_load ( uint32_t idt_ptr_addr)
extern

defined in idt_load.asm, loads the IDT descriptor into the IDTR register.

◆ idt_set_gate()

void idt_set_gate ( int vector,
void * base,
uint16_t segment,
uint8_t flags )

configure a single IDT gate entry.

Parameters
vectorinterrupt vector number (0–255).
basepointer to the interrupt service routine.
segmentcode segment selector for the ISR.
flagsgate type and attribute flags (see idt_flags).

◆ idt_enable_gate()

void idt_enable_gate ( int vector)

enable an IDT gate by setting its present bit.

Parameters
vectorinterrupt vector number (0–255).

◆ idt_disable_gate()

void idt_disable_gate ( int vector)

disable an IDT gate by clearing its present bit.

Parameters
vectorinterrupt vector number (0–255).

◆ idt_initialize()

void idt_initialize ( void )

initialize the Interrupt Descriptor Table (IDT) and load it into the IDTR register.

◆ idt_load_core()

void idt_load_core ( void )

load the IDT into the IDTR of the core that runs the call.

idt_initialize() does it for the boot core; each other core calls this when it starts.

Variable Documentation

◆ base_low

uint16_t base_low

◆ segment_selector

uint16_t segment_selector

◆ reserved

uint8_t reserved

◆ flags

uint8_t flags

◆ base_high

uint16_t base_high

◆ limit

uint16_t limit

◆ base

uint32_t base