feat: input device subsystem to resolve race condition on polling input
[lunaix-os.git] / lunaix-os / kernel / proc0.c
index 3c2ea5f3b91be794c9fa306c29439f05f8bc6841..c02cbe1f3087f35ad9f2e4a6587c57a15f2c4411 100644 (file)
@@ -47,7 +47,8 @@ __do_reserved_memory(int unlock);
 #define USE_DEMO
 // #define DEMO_SIGNAL
 // #define DEMO_READDIR
-#define DEMO_IOTEST
+// #define DEMO_IOTEST
+#define DEMO_INPUT_TEST
 
 extern void
 _pconsole_main();
@@ -64,6 +65,9 @@ _readdir_main();
 extern void
 _iotest_main();
 
+extern void
+input_test();
+
 void __USER__
 __proc0_usr()
 {
@@ -74,9 +78,9 @@ __proc0_usr()
     int stdin = dup2(stdout, 1);
 
     pid_t p;
-    if (!fork()) {
-        _pconsole_main();
-    }
+    // if (!fork()) {
+    //     _pconsole_main();
+    // }
 
     if (!(p = fork())) {
 #ifndef USE_DEMO
@@ -87,9 +91,12 @@ __proc0_usr()
         _readdir_main();
 #elif defined DEMO_IOTEST
         _iotest_main();
+#elif defined DEMO_INPUT_TEST
+        input_test();
 #else
         _lxinit_main();
 #endif
+        _exit(0);
     }
 
     waitpid(p, 0, 0);