#ifndef __GDT__ #define __GDT__ #include "../Helpers/types.hpp" //Define GDT pointer struct gdtPointerStruct{ u16 size; u32 segment; } __attribute__ ((packed)); //Define GDT descriptor struct gdtDescriptorStruct{ u16 limit1; u16 base1; u8 base2; u8 access; u8 limit2 : 4; u8 flags : 4; u8 base3; } __attribute__ ((packed)); //Typedef : typedef struct gdtPointerStruct gdtPointerStruct; typedef struct gdtDescriptorStruct gdtDescriptorStruct; //Gdt class class Gdt{ private: //Data members gdtDescriptorStruct m_Descriptors[4]; gdtPointerStruct m_Pointer; //Methods void initGdtDesc(u32 base, u32 limit, u8 access, u8 flags, gdtDescriptorStruct *Descriptor); public: //Constructor Gdt(); //Destructor ~Gdt(); //Methods void loadGdt(); }; #endif