瀏覽代碼

fix(sse): use cpu SandyBridge to enable SSE

greatbridf 2 年之前
父節點
當前提交
7936499704
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 1 1
      Makefile.src
  2. 3 1
      src/asm/port_io.s

+ 1 - 1
Makefile.src

@@ -3,7 +3,7 @@ QEMU_BIN=##PLACEHOLDER_1##
 GDB_BIN=##PLACEHOLDER_2##
 QEMU_ACCELERATION_FLAG=##PLACEHOLDER_3##
 QEMU_DEBUG_FLAG=#-d cpu_reset,int
-QEMU_ARGS=-drive file=build/boot.img,format=raw -no-reboot -no-shutdown $(QEMU_ACCELERATION_FLAG) $(QEMU_DEBUG_FLAG)
+QEMU_ARGS=-cpu SandyBridge,check -drive file=build/boot.img,format=raw -no-reboot -no-shutdown $(QEMU_ACCELERATION_FLAG) $(QEMU_DEBUG_FLAG)
 CROSS_COMPILE=##PLACEHOLDER_4##
 .PHONY: run
 run: build

+ 3 - 1
src/asm/port_io.s

@@ -45,9 +45,11 @@ asm_sti:
 .type  asm_enable_sse @function
 asm_enable_sse:
 	movl %cr0, %eax
-	orl $0b10, %eax
+    andl $0xfffffff3, %eax
+	orl $0b100010, %eax
 	movl %eax, %cr0
 	movl %cr4, %eax
 	orl $0b11000000000, %eax
 	movl %eax, %cr4
+    fninit
 	ret