summaryrefslogtreecommitdiff
path: root/kernel/GDT/gdt.cpp
blob: a01477f4538fdded7d807958e6c098ea5e9ae779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#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
}