summaryrefslogtreecommitdiffstats
path: root/arch/x86/gdt/Gdt.cpp
diff options
context:
space:
mode:
authorAlexey Gavrilov <rebovas@yahoo.com>2024-02-22 14:18:39 +0700
committerAlexey Gavrilov <rebovas@yahoo.com>2024-02-22 14:18:39 +0700
commitcbcbf6e7d614ecf94dd7e1b9033f8d599f48662e (patch)
tree59872849d347794cc58c8ad3aa201a14e0db526f /arch/x86/gdt/Gdt.cpp
parentc18781e37e6bfe153e7c0f2bc8b04df0aecf151d (diff)
Implement support of cpuid instruction + include folder + some updates
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;
+};