aboutsummaryrefslogtreecommitdiff
path: root/src/gdt
diff options
context:
space:
mode:
authorMarvin Borner2019-09-15 15:10:05 +0200
committerMarvin Borner2019-09-15 15:10:05 +0200
commit4292369d5c80afe71479228e79969855f449f1c3 (patch)
tree6719a5e57d4ccf512a4fb378c6f6aa327cee2c17 /src/gdt
parenta9ede4d173bcb2a8e3dbd794e1cf6c9c89b4ae88 (diff)
Abstracted ASM files/functions
Diffstat (limited to 'src/gdt')
-rw-r--r--src/gdt/gdt.asm14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gdt/gdt.asm b/src/gdt/gdt.asm
new file mode 100644
index 0000000..c2128e4
--- /dev/null
+++ b/src/gdt/gdt.asm
@@ -0,0 +1,14 @@
+; GDT flush function
+global gdt_flush
+extern gp
+gdt_flush:
+ lgdt [gp]
+ mov ax, 0x10 ; Data segment offset of GDT
+ mov ds, ax
+ mov es, ax
+ mov fs, ax
+ mov gs, ax
+ mov ss, ax
+ jmp 0x08:flush2 ; Code segment offset
+flush2:
+ ret ; Returns to C code \ No newline at end of file