2025-01-05 22:00:08 -08:00
commit dada247460
36 changed files with 3294 additions and 0 deletions

15
src/fpu.c Normal file
View File

@@ -0,0 +1,15 @@
#include "fpu.h"
void fpu_init() {
size_t t;
asm("clts");
asm("mov %%cr0, %0" : "=r"(t));
t &= ~(1 << 2);
t |= (1 << 1);
asm("mov %0, %%cr0" :: "r"(t));
asm("mov %%cr4, %0" : "=r"(t));
t |= 3 << 9;
asm("mov %0, %%cr4" :: "r"(t));
asm("fninit");
}