Add some comment

This commit is contained in:
manzerbredes 2015-07-21 17:25:36 +04:00
parent dd6a7fb6fa
commit bf534139e3
3 changed files with 13 additions and 4 deletions

View file

@ -2,7 +2,7 @@
#include "../Helpers/types.hpp"
#include "../Helpers/memory.hpp"
//Constructor
Gdt::Gdt(){
//Init conventional segment
@ -25,10 +25,12 @@ Gdt::Gdt(){
}
//Destructor
Gdt::~Gdt(){
}
//Adapt parameter to the gdt descriptor structure
void Gdt::initGdtDesc(u32 base, u32 limit, u8 access, u8 flags, gdtDescriptorStruct *Descriptor){
Descriptor->limit1 = limit & 0xFFFF;
Descriptor->base1 = base & 0xFFFF;
@ -39,11 +41,14 @@ void Gdt::initGdtDesc(u32 base, u32 limit, u8 access, u8 flags, gdtDescriptorStr
Descriptor->base3 = (base & 0xFF000000) >> 24;
}
//Copy the gdt into mémory and load it
void Gdt::loadGdt(){
int *gdtAdress=(int *)&m_Pointer;
//Copy Gdt into memory and init registers
memcpy((u32)m_Descriptors, (u32)m_Pointer.segment, (u32)m_Pointer.size);
//Put m_Pointer in a var to pass it to assembly code
int *gdtAdress=(int *)&m_Pointer;
__asm__("lgdtl (%0);"
:
:"r"(gdtAdress)