summaryrefslogtreecommitdiffstats
path: root/arch/x86/gdt/Gdt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/gdt/Gdt.cpp')
-rwxr-xr-xarch/x86/gdt/Gdt.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/gdt/Gdt.cpp b/arch/x86/gdt/Gdt.cpp
index 63c70ef..88c7bbd 100755
--- a/arch/x86/gdt/Gdt.cpp
+++ b/arch/x86/gdt/Gdt.cpp
@@ -57,7 +57,7 @@ uint64 DescSeg32::flatDataUser()
MngGdt::MngGdt()
{
- this->gdt[0] = 0;
+ gdt[0] = 0;
currIdx = 1;
isGdtLoaded = 0;
};
@@ -82,7 +82,7 @@ bool MngGdt::loadGdt()
uint64 pointer = 0;
uint16 size = sizeof(uint64) * this->size - 1;
- uint16 offset = (uint32)((void *)(&gdt));
+ uint32 offset = (uint32)((void *)(&gdt));
pointer |= offset;
pointer <<= 16;
@@ -98,3 +98,16 @@ bool MngGdt::getIsGdtLoaded()
{
return isGdtLoaded;
};
+
+void MngGdt::operator=(const MngGdt& src)
+{
+ if(this->isGdtLoaded == 1 || src.isGdtLoaded == 1)
+ {
+ return;
+ }
+
+ // Fix it. Write method to copy from ... to ...
+ for(int i = 0; i < this->size; i++) this->gdt[i] = src.gdt[i];
+ this->isGdtLoaded = src.isGdtLoaded;
+ this->currIdx = src.currIdx;
+};