summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authordzwdz2021-07-10 16:17:07 +0200
committerdzwdz2021-07-10 16:17:07 +0200
commit1cc98d32bf344691c73fcc7b64e2ed2755f17ede (patch)
treee79afa2f1b6d24e9fe9be6280276a6134ea099f6 /platform
parent3fe1cfd4518ab8ace87d08796fe2f38d66598a1d (diff)
update all segment registers when setting the GDT
not doing that caused interrupts to break on Bochs
Diffstat (limited to 'platform')
-rw-r--r--platform/boot.s10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/boot.s b/platform/boot.s
index c2a06c3..d5bfda5 100644
--- a/platform/boot.s
+++ b/platform/boot.s
@@ -34,4 +34,14 @@ halt_cpu:
1: hlt
jmp 1b
+// temporary, will be moved to another file soon
+.global change_cs
+.type change_cs, @function
+change_cs:
+ /* retf pops off the return address and code segment off the stack.
+ * it turns out that in the i386 cdecl calling convention they're in
+ * the correct place already.
+ */
+ retf
+
.size _start, . - _start