diff options
author | Tyler Murphy <=> | 2023-07-16 02:54:32 -0400 |
---|---|---|
committer | Tyler Murphy <=> | 2023-07-16 02:54:32 -0400 |
commit | fbf131b5c043b27e0b1543374bb144e3e426f723 (patch) | |
tree | 07f0ab2fc107b36621d5ae95480e6a91e332548b /kernel/src/cpu/fpu.asm | |
download | finix-fbf131b5c043b27e0b1543374bb144e3e426f723.tar.gz finix-fbf131b5c043b27e0b1543374bb144e3e426f723.tar.bz2 finix-fbf131b5c043b27e0b1543374bb144e3e426f723.zip |
initial
Diffstat (limited to '')
-rw-r--r-- | kernel/src/cpu/fpu.asm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/src/cpu/fpu.asm b/kernel/src/cpu/fpu.asm new file mode 100644 index 0000000..e49ab6f --- /dev/null +++ b/kernel/src/cpu/fpu.asm @@ -0,0 +1,19 @@ +global fpu_init + +fpu_init: + mov edx, cr0 + and edx, (-1) - ((1 << 3) + (1 << 4)) + mov cr0, edx + fninit + fnstsw [test] + cmp word [test], 0 + jne no_fpu + + xor eax, 0 + ret + +no_fpu: + mov eax, 1 + ret + +test: dw 0x55AA |