summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-07-21 17:25:36 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-07-21 17:25:36 +0400
commitbf534139e35b78535d4c9d8522376a1df5db84b4 (patch)
treecf1dc3f9f54ccc45f1061ad520f6ae847983fae7
parentdd6a7fb6fa4e1f81895f09d52797f51ca662e65a (diff)
Add some comment
-rw-r--r--kernel/Drivers/memPrint/memPrint.hpp4
-rw-r--r--kernel/GDT/gdt.cpp9
-rw-r--r--kernel/main.cpp4
3 files changed, 13 insertions, 4 deletions
diff --git a/kernel/Drivers/memPrint/memPrint.hpp b/kernel/Drivers/memPrint/memPrint.hpp
index 7d9a4bc..71d934b 100644
--- a/kernel/Drivers/memPrint/memPrint.hpp
+++ b/kernel/Drivers/memPrint/memPrint.hpp
@@ -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
diff --git a/kernel/GDT/gdt.cpp b/kernel/GDT/gdt.cpp
index 3b84e71..8c6d9d9 100644
--- a/kernel/GDT/gdt.cpp
+++ b/kernel/GDT/gdt.cpp
@@ -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)
diff --git a/kernel/main.cpp b/kernel/main.cpp
index 15eb154..1b62de8 100644
--- a/kernel/main.cpp
+++ b/kernel/main.cpp
@@ -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(){