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 ist;
15 uint8_t attributes;
16 uint16_t isrMid;
17 uint32_t isrHigh;
18 uint32_t reserved;
19} __attribute__((packed)) IDTEntry;
20
21typedef struct {
22 uint16_t limit;
23 uint64_t base;
24} __attribute__((packed)) IDTR;
25
26extern void* isrStubTable[];
27
28extern void* irqStubTable[];
29
30__attribute__((noreturn))
31void exceptionHandler(uint64_t vector, uint64_t errorCode);
32
33void irqHandler(uint64_t vector, uint64_t errorCode);
34
35void idtSetDescriptor(uint8_t vector, void* isr, uint8_t flags);
36
37void initIdt();
38
39#endif //BLU_OS_IDT_H
Fixed-width integer types.
Definition idt.h:11