mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
Got IDT & ISRs working!
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef _IDT_H
|
||||
#define _IDT_H
|
||||
|
||||
#include <kernel.h>
|
||||
|
||||
#define IDT_ENTRIES 256
|
||||
#define IDT_FLAG_TRAP 0x8f // P = 1, Priv = 00, S = 0, Type = 1111 (32-bit trap)
|
||||
#define IDT_FLAG_INT 0x8e // P = 1, Priv = 00, S = 0, Type = 1110 (32-bit int)
|
||||
#define IDT_FLAG_USER 0xee // P = 1, Priv = 11, S = 0, Type = 1110 (32-bit int)
|
||||
|
||||
struct idt_entry {
|
||||
uint16_t offsetLow;
|
||||
uint16_t selector;
|
||||
uint8_t __unused;
|
||||
uint8_t flags;
|
||||
uint16_t offsetHigh;
|
||||
} __packed;
|
||||
|
||||
struct idt_pointer {
|
||||
uint16_t limit;
|
||||
uint32_t base;
|
||||
} __packed;
|
||||
|
||||
int idt_init(void);
|
||||
void idt_setGate(uint8_t i, void* handler, uint8_t flags);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user