summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/GDT/gdt.cpp10
-rw-r--r--kernel/GDT/gdt.hpp7
2 files changed, 11 insertions, 6 deletions
diff --git a/kernel/GDT/gdt.cpp b/kernel/GDT/gdt.cpp
index c3a5d43..a01477f 100644
--- a/kernel/GDT/gdt.cpp
+++ b/kernel/GDT/gdt.cpp
@@ -16,8 +16,14 @@ Gdt::~Gdt(){
}
-void Gdt::initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *Descriptor){
- //Load parameter into "Descriptor"
+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(){
diff --git a/kernel/GDT/gdt.hpp b/kernel/GDT/gdt.hpp
index 607cc72..a7966d6 100644
--- a/kernel/GDT/gdt.hpp
+++ b/kernel/GDT/gdt.hpp
@@ -14,10 +14,9 @@ struct gdtDescriptorStruct{
u16 limit1;
u16 base1;
u8 base2;
- u8 type : 4;
- u8 param1 : 4;
+ u8 access : 4;
u8 limit2 : 4;
- u8 param2 : 4;
+ u8 flags : 4;
u8 base3;
} __attribute__ ((packed));
@@ -36,7 +35,7 @@ class Gdt{
gdtPointerStruct m_Pointer;
//Methods
- void initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *Descriptor);
+ void initGdtDesc(u32 base, u32 limit, u8 access, u8 flags, gdtDescriptorStruct *Descriptor);
public: