TSS setup
This commit is contained in:
+14
-1
@@ -13,19 +13,32 @@
|
||||
// we'll only use this as a requirement for paging, not more.
|
||||
// This means base 0 and no limit (whole address space)
|
||||
|
||||
#define NUM_GDT_ENTRIES 5
|
||||
#define NUM_GDT_ENTRIES 7
|
||||
|
||||
#define NULL_SELECTOR 0x00
|
||||
#define KERNEL_CODE_SEGMENT 0x08
|
||||
#define KERNEL_DATA_SEGMENT 0x10
|
||||
#define USER_CODE_SEGMENT 0x18
|
||||
#define USER_DATA_SEGMENT 0x20
|
||||
#define TSS_SEGMENT 0x28
|
||||
|
||||
struct GDTR {
|
||||
uint16_t limit;
|
||||
uint64_t address;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct tss {
|
||||
uint32_t reserved0;
|
||||
uint64_t rsp0;
|
||||
uint64_t rsp1;
|
||||
uint64_t rsp2;
|
||||
uint64_t reserved1;
|
||||
uint64_t ist[7];
|
||||
uint64_t reserved2;
|
||||
uint16_t reserved3;
|
||||
uint16_t iopb;
|
||||
} __attribute__((packed));
|
||||
|
||||
void gdt_init(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user