summaryrefslogtreecommitdiff
path: root/asm/helpers.s
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-02 00:08:42 +0200
committerMiguel <m.i@gmx.at>2018-09-02 00:08:42 +0200
commit8e3411139b27a3421e9ac75c13f14f99f6dd3137 (patch)
treecf8b53ab02863117c310bde11ee4683e134cf1b2 /asm/helpers.s
parent0fff2e6dc6fae82da1c7978918a490c25cc36f04 (diff)
syscalls
Diffstat (limited to 'asm/helpers.s')
-rw-r--r--asm/helpers.s44
1 files changed, 0 insertions, 44 deletions
diff --git a/asm/helpers.s b/asm/helpers.s
deleted file mode 100644
index 135443d..0000000
--- a/asm/helpers.s
+++ /dev/null
@@ -1,44 +0,0 @@
-//http://wiki.osdev.org/GDT_Tutorial
-.global setup_gdt
-.global tss_flush
-
-// call as setup_gdt(GDT,sizeof(GDT))
-setup_gdt:
-
- // re-fill gdt_descriptor with new GDT location and size
- movl 4(%esp),%eax
- movl %eax, gdt_descriptor+2
-
- movw 8(%esp),%ax
- movw %ax, gdt_descriptor
- //
-
- lgdt gdt_descriptor #load new descriptor table!
-
- // reload to take effect
- reloadSegments:
-
- #Reload CS register containing code selector:
- jmp $0x08,$reload_CS # 0x08 points at the new code selector
-
- reload_CS:
- mov $0x10, %ax #0x10 points at the new data selector
- mov %ax, %ds
- mov %ax, %es
- mov %ax, %fs
- mov %ax, %gs
- mov %ax, %ss
-
- tss_flush:
-
- movw $0x2B,%ax # Load the index of our TSS structure - The index is
- # 0x28, as it is the 5th selector and each is 8 bytes
- # long, but we set the bottom two bits (making 0x2B)
- # so that it has an RPL of 3, not zero.
- ltr %ax # Load 0x2B into the task state register.
-
- ret
-
-
-
-ret