BarinkOS/source/kernel/memory/gdt/gdtc.h

29 lines
648 B
C
Raw Normal View History

#pragma once
2021-05-12 22:03:00 +00:00
#include <stdint.h>
2021-11-16 20:17:49 +00:00
struct SegmentDescriptor {
unsigned short limit_low;
unsigned short base_low;
unsigned char base_middle;
unsigned char access;
unsigned char granularity;
unsigned char base_high;
}__attribute__((packed));
struct tss32 {
uint64_t bits;
uint8_t other_bits :5;
}__attribute__((packed));
2021-11-16 20:17:49 +00:00
struct GlobalDescriptorTableDescriptor{
unsigned short limit;
unsigned int base;
}__attribute__((packed)) ;
2021-11-16 20:17:49 +00:00
void add_descriptor(int which , unsigned long base, unsigned long limit, unsigned char access, unsigned char granularity );
extern "C" void LoadGlobalDescriptorTable();
void initGDT();