summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index ff965bd..123a91d 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -35,6 +35,7 @@
#include <sys/exec.h>
#include <sys/driver.h>
#include <sys/panic.h>
+#include <sys/systm.h>
#include <dev/acpi/uacpi.h>
#include <dev/cons/cons.h>
#include <dev/acpi/acpi.h>
@@ -43,7 +44,7 @@
#include <vm/vm.h>
#include <string.h>
-static struct proc proc0;
+struct proc g_proc0;
static void
copyright(void)
@@ -52,6 +53,18 @@ copyright(void)
"Copyright (c) 2023-2025 Ian Marco Moffett and the OSMORA team\n");
}
+#if defined(_INSTALL_MEDIA)
+static void
+begin_install(void)
+{
+ struct cpu_info *ci;
+
+ ci = this_cpu();
+ ci->curtd = &g_proc0;
+ hyra_install();
+}
+#endif
+
static void
start_init(void)
{
@@ -84,11 +97,6 @@ main(void)
kprintf("Starting Hyra/%s v%s: %s\n", HYRA_ARCH, HYRA_VERSION,
HYRA_BUILDDATE);
-#if _INSTALL_MEDIA
- kprintf("Hyra install media detected\n");
- kprintf("Reform Industry!\n");
-#endif /* _INSTALL_MEDIA */
-
/* Start the ACPI subsystem */
acpi_init();
@@ -107,17 +115,29 @@ main(void)
md_intoff();
sched_init();
- memset(&proc0, 0, sizeof(proc0));
+ memset(&g_proc0, 0, sizeof(g_proc0));
/* Startup pid 1 */
- spawn(&proc0, start_init, NULL, 0, NULL);
-
- /* Load all drivers */
+ spawn(&g_proc0, start_init, NULL, 0, NULL);
md_inton();
+
+ /* Load all early drivers */
DRIVERS_INIT();
- /* Bootstrap APs and here we go! */
+#if defined(_INSTALL_MEDIA)
+ kprintf("Hyra install media detected\n");
+ kprintf("Reform Industry!\n");
+ begin_install();
+#endif
+
+ syslog_silence(true);
+
+ /*
+ * Bootstrap APs, schedule all other drivers
+ * and here we go!
+ */
mp_bootstrap_aps(&g_bsp_ci);
+ DRIVERS_SCHED();
sched_enter();
__builtin_unreachable();
}