summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Gavrilov <rebovas@yahoo.com>2024-03-05 17:20:53 +0700
committerAlexey Gavrilov <rebovas@yahoo.com>2024-03-05 17:20:53 +0700
commit1af53b431da6d3b5dcf7132f98f9eb2af88b57fa (patch)
tree730528109a1ffbd5505f05f3457156a68394d339
parent976575c12b5da66996a3204ec711e4937a3ef240 (diff)
GDT rename procedure + edit .gitignore
-rw-r--r--.gitignore4
-rwxr-xr-xarch/x86/gdt/Gdt.cpp2
-rwxr-xr-xarch/x86/gdt/Gdt.h2
-rw-r--r--arch/x86/gdt/SwitchToGdt.s13
4 files changed, 19 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 5fdcd7a..403b290 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,7 @@ build
# Operarting system's files needed to boot
iso/os/*
+
+# LSP configuration files
+.clangd
+compile_flags.txt
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: