From cbcbf6e7d614ecf94dd7e1b9033f8d599f48662e Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Thu, 22 Feb 2024 14:18:39 +0700 Subject: Implement support of cpuid instruction + include folder + some updates --- arch/x86/gdt/Gdt.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'arch/x86/gdt/Gdt.cpp') 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; +}; -- cgit v1.2.3