summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-27 01:41:17 -0400
committerIan Moffett <ian@osmora.org>2025-05-27 01:41:17 -0400
commit055835295e4ea578d3f6346fde1c2ac44eb8f787 (patch)
tree998cca4b80f9cfd1f47c8d4363b860d2bfc35e1b /sys/kern/init_main.c
parent4d423137ba180d252088c3925587057abd02d084 (diff)
kernel: Add initial installer impl
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index ff965bd..76fa6fd 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>
@@ -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 = &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();
@@ -111,11 +119,17 @@ main(void)
/* Startup pid 1 */
spawn(&proc0, start_init, NULL, 0, NULL);
+ md_inton();
/* Load all drivers */
- md_inton();
DRIVERS_INIT();
+#if defined(_INSTALL_MEDIA)
+ kprintf("Hyra install media detected\n");
+ kprintf("Reform Industry!\n");
+ begin_install();
+#endif
+
/* Bootstrap APs and here we go! */
mp_bootstrap_aps(&g_bsp_ci);
sched_enter();