33 lines
644 B
C++
33 lines
644 B
C++
#include "gdt.hpp"
|
|
#include "../Types/types.hpp"
|
|
|
|
|
|
Gdt::Gdt(){
|
|
//Init desc 1 (0 conventional)
|
|
//Init desc 2 (code segment)
|
|
//Init desc 3 (data segment)
|
|
//Init desc 4 (stack segment)
|
|
|
|
|
|
|
|
}
|
|
|
|
Gdt::~Gdt(){
|
|
|
|
}
|
|
|
|
void Gdt::initGdtDesc(u32 base, u32 limit, u8 access, u8 flags, gdtDescriptorStruct *Descriptor){
|
|
Descriptor->limit1 = limit & 0xFFFF;
|
|
Descriptor->base1 = base & 0xFFFF;
|
|
Descriptor->base2 = (base & 0xFF0000) >> 16;
|
|
Descriptor->access = access;
|
|
Descriptor->limit2 = (limit & 0xF0000 ) >> 16;
|
|
Descriptor->flags = flags & 0xFF;
|
|
Descriptor->base3 = (base & 0xFF000000) >> 24;
|
|
}
|
|
|
|
void Gdt::loadGdt(){
|
|
//Copy Gdt into memory
|
|
}
|
|
|
|
|