From 4578da13a412c3166d580c91a6b3019df79e1cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 14 Oct 2004 18:18:22 +0000 Subject: [PATCH] main() now waits until interrupts are available before bringing the device drivers up. Switched to load_image() instad of using the old team_create_team() to start "init". git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9361 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/kernel/core/main.c b/src/kernel/core/main.c index d99a017277..e2193299c4 100644 --- a/src/kernel/core/main.c +++ b/src/kernel/core/main.c @@ -160,6 +160,11 @@ main2(void *unused) TRACE(("Bootstrap file systems\n")); vfs_bootstrap_file_systems(); + // before we bring up the device drivers, we better wait until + // interrupts become available, to make sure they'll work as expected + while (!are_interrupts_enabled()) + snooze(10000); + TRACE(("Init Device Manager\n")); device_manager_init(&ka); @@ -203,12 +208,14 @@ main2(void *unused) #endif // start the init process { - team_id pid; - pid = team_create_team("/bin/init", "init", NULL, 0, NULL, 0, B_NORMAL_PRIORITY); + const char *args[] = {"/bin/init", NULL}; - TRACE(("Init started\n")); - if (pid < 0) - kprintf("error starting 'init' error = %ld \n", pid); + thread_id thread = load_image(1, args, NULL); + if (thread >= B_OK) { + resume_thread(thread); + TRACE(("Init started\n")); + } else + dprintf("error starting 'init' error = %ld \n", thread); } return 0;