From ff154205e1671e11ed8566740c1cefaad79c2512 Mon Sep 17 00:00:00 2001
From: dzwdz
Date: Sat, 10 Jun 2023 19:12:49 +0200
Subject: user: fix floating point operations

---
 src/user/lib/_start.s | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'src/user/lib')

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.
-- 
cgit v1.2.3