From 1af53b431da6d3b5dcf7132f98f9eb2af88b57fa Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Tue, 5 Mar 2024 17:20:53 +0700 Subject: GDT rename procedure + edit .gitignore --- arch/x86/gdt/Gdt.cpp | 2 +- arch/x86/gdt/Gdt.h | 2 +- arch/x86/gdt/SwitchToGdt.s | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 arch/x86/gdt/SwitchToGdt.s (limited to 'arch/x86/gdt') diff --git a/arch/x86/gdt/Gdt.cpp b/arch/x86/gdt/Gdt.cpp index 88c7bbd..80fcd13 100755 --- a/arch/x86/gdt/Gdt.cpp +++ b/arch/x86/gdt/Gdt.cpp @@ -88,7 +88,7 @@ bool MngGdt::loadGdt() pointer <<= 16; pointer |= size; - GOTOGDTMEMSEG(pointer); + SWITCHTOGDT(pointer); isGdtLoaded = 1; return true; diff --git a/arch/x86/gdt/Gdt.h b/arch/x86/gdt/Gdt.h index a8d7dc2..6667d93 100755 --- a/arch/x86/gdt/Gdt.h +++ b/arch/x86/gdt/Gdt.h @@ -59,7 +59,7 @@ class DescSeg32 // Segment descriptor #ifdef __cplusplus extern "C" { #endif -extern void GOTOGDTMEMSEG(uint64 pointer); +extern void SWITCHTOGDT(uint64 pointer); #ifdef __cplusplus }; #endif diff --git a/arch/x86/gdt/SwitchToGdt.s b/arch/x86/gdt/SwitchToGdt.s new file mode 100644 index 0000000..52ebbc7 --- /dev/null +++ b/arch/x86/gdt/SwitchToGdt.s @@ -0,0 +1,13 @@ +global SWITCHTOGDT +SWITCHTOGDT: + lgdt [esp + 4] + jmp 0x08:.reloadCS +.reloadCS: + mov ax, 0x10 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + ret +.end: -- cgit v1.2.3