mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-17 18:21:46 +00:00
Add implementation for GDT & IDT on x32 and QoL fixes
This commit is contained in:
@@ -22,6 +22,48 @@
|
||||
|
||||
namespace InterruptDescriptorTable
|
||||
{
|
||||
typedef enum _InterruptGateType
|
||||
{
|
||||
TASK = 0b101,
|
||||
INT_16BIT = 0b110,
|
||||
TRAP_16BIT = 0b111,
|
||||
INT_32BIT = 0b1110,
|
||||
TRAP_32BIT = 0b1111,
|
||||
} InterruptGateType;
|
||||
|
||||
typedef enum _InterruptRingType
|
||||
{
|
||||
RING0 = 0b0,
|
||||
RING1 = 0b1,
|
||||
RING2 = 0b10,
|
||||
RING3 = 0b11,
|
||||
} InterruptRingType;
|
||||
|
||||
typedef struct _InterruptDescriptorTableEntry
|
||||
{
|
||||
uint32_t LowOffset : 16;
|
||||
uint32_t SegmentSelector : 16;
|
||||
uint32_t Reserved0 : 5;
|
||||
uint32_t Flags : 4;
|
||||
uint32_t Reserved1 : 1;
|
||||
uint32_t Ring : 2;
|
||||
uint32_t Present : 1;
|
||||
uint32_t HighOffset : 16;
|
||||
} __packed InterruptDescriptorTableEntry;
|
||||
|
||||
typedef struct _InterruptDescriptorTableDescriptor
|
||||
{
|
||||
uint16_t Length;
|
||||
InterruptDescriptorTableEntry *Entries;
|
||||
} __packed InterruptDescriptorTableDescriptor;
|
||||
|
||||
void SetEntry(uint8_t Index,
|
||||
void (*Base)(),
|
||||
InterruptGateType Gate,
|
||||
InterruptRingType Ring,
|
||||
bool Present,
|
||||
uint16_t SegmentSelector);
|
||||
|
||||
void Init(int Core);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user