diff options
Diffstat (limited to 'arch/x86')
| -rwxr-xr-x | arch/x86/gdt/Gdt.cpp | 2 | ||||
| -rwxr-xr-x | arch/x86/gdt/Gdt.h | 2 | ||||
| -rw-r--r-- | arch/x86/gdt/SwitchToGdt.s | 13 |
3 files changed, 15 insertions, 2 deletions
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: |
