40 lines
704 B
C
40 lines
704 B
C
#ifndef _KERNEL_AMD64_GDT_H
|
|
#define _KERNEL_AMD64_GDT_H
|
|
|
|
#include <aux/compiler.h>
|
|
#include <libk/std.h>
|
|
#include <proc/proc.h>
|
|
|
|
/// Size of kernel stack
|
|
#define KSTACK_SIZE (32 * 1024)
|
|
|
|
/**
|
|
* @file
|
|
*
|
|
* @brief 64-bit GDT structure. For more info see:
|
|
* - https://wiki.osdev.org/Global_Descriptor_Table
|
|
* - https://wiki.osdev.org/GDT_Tutorial
|
|
*/
|
|
|
|
struct gdt_entry {
|
|
uint16_t limitlow;
|
|
uint16_t baselow;
|
|
uint8_t basemid;
|
|
uint8_t access;
|
|
uint8_t gran;
|
|
uint8_t basehigh;
|
|
} PACKED;
|
|
|
|
struct gdt_ptr {
|
|
uint16_t limit;
|
|
uint64_t base;
|
|
} PACKED;
|
|
|
|
struct gdt_extended {
|
|
struct gdt_entry old[5];
|
|
struct gdt_entry tsslow;
|
|
struct gdt_entry tsshigh;
|
|
} PACKED;
|
|
|
|
#endif // _KERNEL_AMD64_GDT_H
|