Edit GDT class
This commit is contained in:
parent
9b856ae4d7
commit
3b171151bd
3 changed files with 60 additions and 9 deletions
|
@ -2,10 +2,26 @@
|
|||
#include "../Types/types.hpp"
|
||||
|
||||
|
||||
void initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *descriptor){
|
||||
Gdt::Gdt(){
|
||||
//Init desc 1 (0 conventional)
|
||||
//Init desc 2 (code segment)
|
||||
//Init desc 3 (data segment)
|
||||
//Init desc 4 (stack segment)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void initGdt(){
|
||||
Gdt::~Gdt(){
|
||||
|
||||
}
|
||||
|
||||
void Gdt::initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *Descriptor){
|
||||
//Load parameter into "Descriptor"
|
||||
}
|
||||
|
||||
void Gdt::loadGdt(){
|
||||
//Copy Gdt into memory
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,13 +21,36 @@ struct gdtDescriptorStruct{
|
|||
u8 base3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
//Typedef :
|
||||
typedef struct gdtPointerStruct gdtPointerStruct;
|
||||
typedef struct gdtDescriptorStruct gdtDescriptorStruct;
|
||||
|
||||
//Functions :
|
||||
void initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *descriptor);
|
||||
void initGdt();
|
||||
|
||||
//Gdt class
|
||||
class Gdt{
|
||||
|
||||
private:
|
||||
|
||||
//Data members
|
||||
gdtDescriptorStruct m_Descriptor[4];
|
||||
gdtPointerStruct m_Pointer;
|
||||
|
||||
//Methods
|
||||
void initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *Descriptor);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//Constructor
|
||||
Gdt();
|
||||
|
||||
//Destructor
|
||||
~Gdt();
|
||||
|
||||
//Methods
|
||||
void loadGdt();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue