summaryrefslogtreecommitdiffstats
path: root/arch/x86/gdt/SwitchToGdt.nasm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/gdt/SwitchToGdt.nasm')
-rw-r--r--arch/x86/gdt/SwitchToGdt.nasm13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/gdt/SwitchToGdt.nasm b/arch/x86/gdt/SwitchToGdt.nasm
new file mode 100644
index 0000000..52ebbc7
--- /dev/null
+++ b/arch/x86/gdt/SwitchToGdt.nasm
@@ -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: