feat: device subsystem rework
[lunaix-os.git] / lunaix-os / kernel / proc0.c
index 64dbcd9a4520d9c713db77f671111057a748ff44..4b430b5a15d801943b3244e9380b25768b6b82ee 100644 (file)
@@ -1,6 +1,5 @@
 #include <lunaix/block.h>
 #include <lunaix/boot_generic.h>
 #include <lunaix/block.h>
 #include <lunaix/boot_generic.h>
-#include <lunaix/common.h>
 #include <lunaix/exec.h>
 #include <lunaix/foptions.h>
 #include <lunaix/fs.h>
 #include <lunaix/exec.h>
 #include <lunaix/foptions.h>
 #include <lunaix/fs.h>
@@ -11,7 +10,6 @@
 #include <lunaix/mm/pmm.h>
 #include <lunaix/mm/valloc.h>
 #include <lunaix/mm/vmm.h>
 #include <lunaix/mm/pmm.h>
 #include <lunaix/mm/valloc.h>
 #include <lunaix/mm/vmm.h>
-#include <lunaix/peripheral/ps2kbd.h>
 #include <lunaix/peripheral/serial.h>
 #include <lunaix/spike.h>
 #include <lunaix/syscall.h>
 #include <lunaix/peripheral/serial.h>
 #include <lunaix/spike.h>
 #include <lunaix/syscall.h>
 
 #include <sdbg/protocol.h>
 
 
 #include <sdbg/protocol.h>
 
-#include <hal/acpi/acpi.h>
-#include <hal/ahci/ahci.h>
-#include <hal/pci.h>
-
 #include <klibc/string.h>
 
 LOG_MODULE("PROC0")
 #include <klibc/string.h>
 
 LOG_MODULE("PROC0")
@@ -78,8 +72,8 @@ void
 __proc0()
 {
     /*
 __proc0()
 {
     /*
-     * We must defer boot code/data cleaning after we successfully escape that
-     * area
+     * We must defer boot code/data cleaning to here, after we successfully
+     * escape that area
      */
     boot_cleanup();
 
      */
     boot_cleanup();
 
@@ -102,19 +96,16 @@ init_platform()
             __VERSION__,
             __TIME__);
 
             __VERSION__,
             __TIME__);
 
+    device_poststage();
+
     twifs_register_plugins();
 
     twifs_register_plugins();
 
-    /* we must start probing pci after all drivers are registered! */
-    pci_load_devices();
+    // FIXME This 8025 serial should integrated into device layer
+    serial_init();
 
     // debugger
 
     // debugger
-    serial_init();
     sdbg_init();
 
     sdbg_init();
 
-    // FIXME ps2 kbd is x86 PC specific, not here.
-    // peripherals & chipset features
-    ps2_kbd_init();
-
     // console
     console_start_flushing();
     console_flush();
     // console
     console_start_flushing();
     console_flush();