Make userspace actually work.
[pintos-anon] / src / threads / loader.S
index 18086ede8993c44805e6ebe742c64bd2cdc5c524..c60e8dd6bd3347551b30f727617b113b88494388 100644 (file)
@@ -153,6 +153,13 @@ read_sector:
        movl %eax, %cr0
        jmp 1f
 1:
+
+##### Turn on EM bit in CR0, forcing most floating-point instructions
+##### to trap.  We don't support floating-point or MMX.
+
+       movl %cr0, %eax
+       orl $CR0_EM, %eax
+       movl %eax, %cr0
        
 ##### Jump to kernel entry point.