diff --git a/Makefile b/Makefile index 2c3a5c2..5804777 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,6 @@ CXXFLAGS := \ -Wextra \ -Wpedantic \ -O2 \ - -mno-sse \ - -mno-sse2 \ - -mno-mmx \ - -mno-80387 ASFLAGS := \ --64 diff --git a/kernel/boot.S b/kernel/boot.S index 609eb7d..5b9e367 100644 --- a/kernel/boot.S +++ b/kernel/boot.S @@ -80,6 +80,17 @@ _start: .code64 +enable_sse: + movq %cr0, %rax + andw $0xFFFB, %ax + orw $0x0002, %ax + movq %rax, %cr0 + + movq %cr4, %rax + orw $0x600, %ax + movq %rax, %cr4 + ret + long_mode_entry: movw $0x10, %ax @@ -97,6 +108,8 @@ long_mode_entry: call run_global_constructors + call enable_sse + call kmain .hang: cli