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

@ -1,7 +1,7 @@
#ifndef __memPrint__
#define __memPrint__
//Define the bios color
enum colorBios{
BLACK=0x0,
@ -23,8 +23,10 @@ enum colorBios{
};
//Type def for biosColor
typedef enum colorBios colorBios;
// Define class to print text on screen
#endif

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)

View file

@ -1,4 +1,7 @@
//To load GDT
#include "GDT/gdt.hpp"
//To print text
#include "Drivers/memPrint/memPrint.hpp"
@ -15,7 +18,6 @@ int main(){
//----- PiegOS kernel boot -----
//Mangling the _boot function
extern "C" void _boot(){