diff options
Diffstat (limited to 'Source/Kernel/MemoryManager/GDT.ns.h')
-rw-r--r-- | Source/Kernel/MemoryManager/GDT.ns.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/Kernel/MemoryManager/GDT.ns.h b/Source/Kernel/MemoryManager/GDT.ns.h index 7a9f95f..94306a4 100644 --- a/Source/Kernel/MemoryManager/GDT.ns.h +++ b/Source/Kernel/MemoryManager/GDT.ns.h @@ -13,12 +13,44 @@ namespace GDT { u8int base_high; } __attribute__((packed)); + // A struct describing a Task State Segment. + struct tss_entry_t { + u32int prev_tss; // The previous TSS - if we used hardware task switching this would form a linked list. + u32int esp0; // The stack pointer to load when we change to kernel mode. + u32int ss0; // The stack segment to load when we change to kernel mode. + u32int esp1; // Unused... + u32int ss1; + u32int esp2; + u32int ss2; + u32int cr3; + u32int eip; + u32int eflags; + u32int eax; + u32int ecx; + u32int edx; + u32int ebx; + u32int esp; + u32int ebp; + u32int esi; + u32int edi; + u32int es; // The value to load into ES when we change to kernel mode. + u32int cs; // The value to load into CS when we change to kernel mode. + u32int ss; // The value to load into SS when we change to kernel mode. + u32int ds; // The value to load into DS when we change to kernel mode. + u32int fs; // The value to load into FS when we change to kernel mode. + u32int gs; // The value to load into GS when we change to kernel mode. + u32int ldt; // Unused... + u16int trap; + u16int iomap_base; + } __attribute__((packed)); + struct gdt_ptr_t { u16int limit; u32int base; } __attribute__((packed)); void init(); + extern tss_entry_t tss_entry; //Used for setting kernel stack } #endif |