fix: load x87 fpu default settings
[lunaix-os.git] / lunaix-os / kernel / k_init.c
index a82df947d16a40f6164508b60fb90f1ff75c0e52..ce4ac6aab8d44585c04e04a0e219da3283e68741 100644 (file)
@@ -78,12 +78,15 @@ _kernel_init()
     fsm_init();
     input_init();
 
     fsm_init();
     input_init();
 
+    vfs_export_attributes();
+
     if ((errno = vfs_mount_root("ramfs", NULL))) {
         panickf("Fail to mount root. (errno=%d)", errno);
     }
 
     vfs_mount("/dev", "devfs", NULL, 0);
     vfs_mount("/sys", "twifs", NULL, MNT_RO);
     if ((errno = vfs_mount_root("ramfs", NULL))) {
         panickf("Fail to mount root. (errno=%d)", errno);
     }
 
     vfs_mount("/dev", "devfs", NULL, 0);
     vfs_mount("/sys", "twifs", NULL, MNT_RO);
+    vfs_mount("/task", "taskfs", NULL, MNT_RO);
 
     lxconsole_init();
 
 
     lxconsole_init();
 
@@ -161,6 +164,11 @@ spawn_proc0()
                  : "i"(KSTACK_TOP), "i"(KCODE_SEG), "r"(proc0->intr_ctx.eip)
                  : "%ebx", "memory");
 
                  : "i"(KSTACK_TOP), "i"(KCODE_SEG), "r"(proc0->intr_ctx.eip)
                  : "%ebx", "memory");
 
+    // 加载x87默认配置
+    asm volatile("fninit\n"
+                 "fxsave (%%eax)" ::"a"(proc0->fxstate)
+                 : "memory");
+
     // 向调度器注册进程。
     commit_process(proc0);
 
     // 向调度器注册进程。
     commit_process(proc0);