forked from PoliEcho-holding-org/kern
The great 64-bit rewrite
* We did loose tasking and only have a paging skeleton, but hey it took like 4 months so i'm happy that there's something :p
This commit is contained in:
+18
-8
@@ -4,21 +4,31 @@
|
||||
#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)
|
||||
#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)
|
||||
|
||||
/*
|
||||
* Attribute field explanation
|
||||
* 0..3 Gate type
|
||||
* 4 Zero (unused)
|
||||
* 5..6 DPL (privilege)
|
||||
* 7 Present
|
||||
*/
|
||||
|
||||
struct idt_entry {
|
||||
uint16_t offset_low;
|
||||
uint16_t selector;
|
||||
uint8_t __unused;
|
||||
uint8_t flags;
|
||||
uint16_t offset_high;
|
||||
uint8_t ist; // Only 3 low bits, rest is reserved
|
||||
uint8_t attrib;
|
||||
uint16_t offset_mid;
|
||||
uint32_t offset_high;
|
||||
uint32_t __reserved;
|
||||
} __packed;
|
||||
|
||||
struct idt_pointer {
|
||||
uint16_t limit;
|
||||
uint32_t base;
|
||||
uint16_t size;
|
||||
uint64_t offset;
|
||||
} __packed;
|
||||
|
||||
int idt_init(void);
|
||||
|
||||
Reference in New Issue
Block a user