GDT
include/boot/gdt.h View source View on GitHubStructs
Section titled “Structs”gdt_entry
Section titled “gdt_entry” struct gdt_entry (6 fields) source
gdt_ptr
Section titled “gdt_ptr”gdt_entry_tss
Section titled “gdt_entry_tss” struct gdt_entry_tss (8 fields) source
Functions
Section titled “Functions”gdt_load
Section titled “gdt_load”void gdt_load(void) source Macros
Section titled “Macros”ACCESS_CODE_RING0
Section titled “ACCESS_CODE_RING0”#define ACCESS_CODE_RING0 0x9A source exec/read, ring 0
ACCESS_DATA_RING0
Section titled “ACCESS_DATA_RING0”#define ACCESS_DATA_RING0 0x92 source read/write, ring 0
ACCESS_CODE_RING3
Section titled “ACCESS_CODE_RING3”#define ACCESS_CODE_RING3 0xFA source exec/read, ring 3
ACCESS_DATA_RING3
Section titled “ACCESS_DATA_RING3”#define ACCESS_DATA_RING3 0xF2 source read/write, ring 3
GRAN_CODE
Section titled “GRAN_CODE”#define GRAN_CODE 0xAF source G=1, D/B=0, L=1, AVL=0
GRAN_DATA
Section titled “GRAN_DATA”#define GRAN_DATA 0xAF source G=1, D/B=0, L=0, AVL=0
GDT_KERNEL_CODE
Section titled “GDT_KERNEL_CODE”#define GDT_KERNEL_CODE 0x08 source Kernel selectors (RPL = 0)
index 1
GDT_KERNEL_DATA
Section titled “GDT_KERNEL_DATA”#define GDT_KERNEL_DATA 0x10 source index 2
KERNEL_CS
Section titled “KERNEL_CS”#define KERNEL_CS GDT_KERNEL_CODE source KERNEL_DS
Section titled “KERNEL_DS”#define KERNEL_DS GDT_KERNEL_DATA source GDT_USER_CODE
Section titled “GDT_USER_CODE”#define GDT_USER_CODE 0x28 source User selectors (RPL = 3)
index 5 << 3
GDT_USER_DATA
Section titled “GDT_USER_DATA”#define GDT_USER_DATA 0x30 source index 6 << 3
USER_CS
Section titled “USER_CS”#define USER_CS (GDT_USER_CODE | 0x3) source == 0x2B
USER_DS
Section titled “USER_DS”#define USER_DS (GDT_USER_DATA | 0x3) source == 0x33