summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-04-18 21:57:44 -0400
committerIan Moffett <ian@osmora.org>2025-04-18 21:57:44 -0400
commit9906547712a88cf4dc012a6f6bd6e2ad04c5e3f3 (patch)
tree41b40ec97f5082793b08a495f6a935bc3c1ed25f /sys/kern/init_main.c
parent0b5adaff02190dad76d845381a41b998696d9e97 (diff)
parent92d4f9dae64ab5325feca1f39e5955415e8275b9 (diff)
Merge branch 'expt' into aarch64
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index f3f88d7..799d352 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -38,14 +38,23 @@
#include <dev/cons/cons.h>
#include <dev/acpi/acpi.h>
#include <machine/cpu.h>
+#include <machine/cdefs.h>
#include <vm/vm.h>
#include <string.h>
static struct proc proc0;
static void
+copyright(void)
+{
+ kprintf(OMIT_TIMESTAMP
+ "Copyright (c) 2023-2025 Ian Marco Moffett and the OSMORA team\n");
+}
+
+static void
start_init(void)
{
+#if 0
struct proc *td = this_td();
struct execve_args execve_args;
char *argv[] = { "/usr/sbin/init", NULL };
@@ -56,6 +65,8 @@ start_init(void)
execve_args.envp = envp;
if (execve(td, &execve_args) != 0)
panic("failed to load init\n");
+#endif
+ for (;;);
}
int
@@ -64,14 +75,15 @@ main(void)
/* Setup serial driver */
serial_init();
+ /* Init the virtual memory subsystem */
+ vm_init();
+
/* Startup the console */
cons_init();
+ copyright();
kprintf("Starting Hyra/%s v%s: %s\n", HYRA_ARCH, HYRA_VERSION,
HYRA_BUILDDATE);
- /* Init the virtual memory subsystem */
- vm_init();
-
/* Start the ACPI subsystem */
acpi_init();
@@ -81,19 +93,22 @@ main(void)
/* Init the virtual file system */
vfs_init();
- DRIVERS_INIT();
-
/* Expose the console to devfs */
cons_expose();
/* Start scheduler and bootstrap APs */
+ md_intoff();
sched_init();
- mp_bootstrap_aps(&g_bsp_ci);
- /* Startup init */
+ /* Startup pid 1 */
memset(&proc0, 0, sizeof(proc0.tf));
fork1(&proc0, 0, start_init, NULL);
+ /* Load all drivers */
+ DRIVERS_INIT();
+
+ /* Bootstrap APs and here we go! */
+ mp_bootstrap_aps(&g_bsp_ci);
sched_enter();
__builtin_unreachable();
}