42_KFS/headers/gdt.h

22 lines
421 B
C

#pragma once
#include <stdint.h>
#define GDT_BASE 0x00000800
// sizeof(Segment Descriptor) * nb(Segment Descriptor)
#define GDT_SIZE 8 * 7
struct gdt_entry {
uint32_t limit;
uint32_t base;
uint8_t access_byte;
uint8_t flags;
};
// https://wiki.osdev.org/Global_Descriptor_Table#GDTR
struct gdt_descriptor {
uint16_t size;
uint32_t base;
} __attribute__((packed));
void initGdt();