summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordzwdz2023-06-10 19:12:49 +0200
committerdzwdz2023-06-10 19:12:49 +0200
commitff154205e1671e11ed8566740c1cefaad79c2512 (patch)
tree480320e570a9e7006faac25306e89aa28feb78e8 /src
parent06ac0bafe94a847395346fec33de59b71b89b4a4 (diff)
user: fix floating point operations
Diffstat (limited to 'src')
-rw-r--r--src/user/lib/_start.s6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/user/lib/_start.s b/src/user/lib/_start.s
index 0d5b5de..12d2c5f 100644
--- a/src/user/lib/_start.s
+++ b/src/user/lib/_start.s
@@ -5,6 +5,12 @@
_start:
mov %rsp, %rdi
and $~0xF, %rsp
+
+ /* prevent floating point crashes. thanks heat */
+ push $0x1f80
+ ldmxcsr (%rsp)
+ add $8, %rsp
+
call _start2
hlt
/* the call shouldn't return, thus the hlt.