MyOS Kernel
idt.c File Reference
#include "idt.h"
#include <stdint.h>

Data Structures

struct  idt_gate_t
 
struct  idt_register_t
 

Macros

#define KERNEL_CS   0x08
 Kernel code segemnt selector.
 
#define IDT_ENTRIES   256
 Number of entries in the IDT.
 
#define LOW_16(address)   (uint16_t)((address) & 0xFFFF)
 Macro to get the low 16 bits of an address.
 
#define HIGH_16(address)   (uint16_t)(((address) >> 16) & 0xFFFF)
 Macro to get the high 16 bits of an address.
 

Functions

void idt_set_gate (int n, uint32_t handler)
 
void load_idt ()
 

Variables

static idt_gate_t idt [IDT_ENTRIES]
 The IDT.
 
static idt_register_t idt_reg
 The value to load into the IDTR.
 

Function Documentation

◆ idt_set_gate()

void idt_set_gate ( int  n,
uint32_t  handler 
)

Sets an IDT gate.

Parameters
nthe IDT gate to set
handlerthe handler for the gate.

◆ load_idt()

void load_idt ( )

Loads the IDT