blu_os
Loading...
Searching...
No Matches
idt.h
1//
2// Created by dylan on 10/07/2026.
3//
4
5#ifndef BLU_OS_IDT_H
6#define BLU_OS_IDT_H
7#include <stdint.h>
8
9#define IDT_MAX_DESCRIPTORS 256
10
11typedef struct {
12 uint16_t isrLow;
13 uint16_t kernelCs;
14 uint8_t reserved;
15 uint8_t attributes;
16 uint16_t isrHigh;
17} __attribute__((packed)) IDTEntry;
18
19typedef struct {
20 uint16_t limit;
21 uint32_t base;
22} __attribute__((packed)) IDTR;
23
24extern void* isrStubTable[];
25
26extern void* irqStubTable[];
27
28__attribute__((noreturn))
29void exceptionHandler(uint32_t vector, uint32_t errorCode);
30
31void irqHandler(uint32_t vector, uint32_t errorCode);
32
33void idtSetDescriptor(uint8_t vector, void* isr, uint8_t flags);
34
35void initIdt();
36
37#endif //BLU_OS_IDT_H
Fixed-width integer types.
Definition idt.h:11