* Removed old /bin/init startup code - it hasn't been needed for ages anymore.
* Some cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24743 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+15
-29
@@ -6,7 +6,7 @@
|
|||||||
* Distributed under the terms of the NewOS License.
|
* Distributed under the terms of the NewOS License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! This is main - initializes processors and starts init */
|
/*! This is main - initializes the kernel and launches the Bootscript */
|
||||||
|
|
||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
//#define TRACE_BOOT 1
|
//#define TRACE_BOOT
|
||||||
#ifdef TRACE_BOOT
|
#ifdef TRACE_BOOT
|
||||||
# define TRACE(x...) dprintf("INIT: " x)
|
# define TRACE(x...) dprintf("INIT: " x)
|
||||||
#else
|
#else
|
||||||
@@ -70,7 +70,8 @@ _start(kernel_args *bootKernelArgs, int currentCPU)
|
|||||||
// This is something we cannot handle right now - release kernels
|
// This is something we cannot handle right now - release kernels
|
||||||
// should always be able to handle the kernel_args of earlier
|
// should always be able to handle the kernel_args of earlier
|
||||||
// released kernels.
|
// released kernels.
|
||||||
debug_early_boot_message("Version mismatch between boot loader and kernel!\n");
|
debug_early_boot_message("Version mismatch between boot loader and "
|
||||||
|
"kernel!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +178,8 @@ _start(kernel_args *bootKernelArgs, int currentCPU)
|
|||||||
TRACE("exiting kernel startup\n");
|
TRACE("exiting kernel startup\n");
|
||||||
kernel_startup = false;
|
kernel_startup = false;
|
||||||
|
|
||||||
smp_cpu_rendezvous(&sCpuRendezvous2, 0); // release the AP cpus to go enter the scheduler
|
smp_cpu_rendezvous(&sCpuRendezvous2, 0);
|
||||||
|
// release the AP cpus to go enter the scheduler
|
||||||
|
|
||||||
TRACE("enabling interrupts and starting scheduler on cpu 0\n");
|
TRACE("enabling interrupts and starting scheduler on cpu 0\n");
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
@@ -190,11 +192,11 @@ _start(kernel_args *bootKernelArgs, int currentCPU)
|
|||||||
resume_thread(thread);
|
resume_thread(thread);
|
||||||
} else {
|
} else {
|
||||||
// lets make sure we're in sync with the main cpu
|
// lets make sure we're in sync with the main cpu
|
||||||
// the boot processor has probably been sending us
|
// the boot processor has probably been sending us
|
||||||
// tlb sync messages all along the way, but we've
|
// tlb sync messages all along the way, but we've
|
||||||
// been ignoring them
|
// been ignoring them
|
||||||
arch_cpu_global_TLB_invalidate();
|
arch_cpu_global_TLB_invalidate();
|
||||||
|
|
||||||
// this is run for each non boot processor after they've been set loose
|
// this is run for each non boot processor after they've been set loose
|
||||||
cpu_init_percpu(&sKernelArgs, currentCPU);
|
cpu_init_percpu(&sKernelArgs, currentCPU);
|
||||||
smp_per_cpu_init(&sKernelArgs, currentCPU);
|
smp_per_cpu_init(&sKernelArgs, currentCPU);
|
||||||
@@ -219,9 +221,9 @@ static int32
|
|||||||
main2(void *unused)
|
main2(void *unused)
|
||||||
{
|
{
|
||||||
(void)(unused);
|
(void)(unused);
|
||||||
|
|
||||||
TRACE("start of main2: initializing devices\n");
|
TRACE("start of main2: initializing devices\n");
|
||||||
|
|
||||||
boot_splash_init();
|
boot_splash_init();
|
||||||
|
|
||||||
TRACE("Init modules\n");
|
TRACE("Init modules\n");
|
||||||
@@ -259,9 +261,6 @@ main2(void *unused)
|
|||||||
TRACE("Add preloaded old-style drivers\n");
|
TRACE("Add preloaded old-style drivers\n");
|
||||||
devfs_add_preloaded_drivers(&sKernelArgs);
|
devfs_add_preloaded_drivers(&sKernelArgs);
|
||||||
|
|
||||||
// ToDo: device manager starts here, bus_init()/dev_init() won't be necessary anymore,
|
|
||||||
// but instead, the hardware and drivers are rescanned then.
|
|
||||||
|
|
||||||
int_init_post_device_manager(&sKernelArgs);
|
int_init_post_device_manager(&sKernelArgs);
|
||||||
|
|
||||||
TRACE("Mount boot file system\n");
|
TRACE("Mount boot file system\n");
|
||||||
@@ -275,7 +274,7 @@ main2(void *unused)
|
|||||||
TRACE("vm_init_post_modules\n");
|
TRACE("vm_init_post_modules\n");
|
||||||
boot_splash_set_stage(BOOT_SPLASH_STAGE_6_INIT_VM_MODULES);
|
boot_splash_set_stage(BOOT_SPLASH_STAGE_6_INIT_VM_MODULES);
|
||||||
vm_init_post_modules(&sKernelArgs);
|
vm_init_post_modules(&sKernelArgs);
|
||||||
|
|
||||||
TRACE("debug_init_post_modules\n");
|
TRACE("debug_init_post_modules\n");
|
||||||
debug_init_post_modules(&sKernelArgs);
|
debug_init_post_modules(&sKernelArgs);
|
||||||
|
|
||||||
@@ -285,24 +284,11 @@ main2(void *unused)
|
|||||||
boot_splash_set_stage(BOOT_SPLASH_STAGE_7_RUN_BOOT_SCRIPT);
|
boot_splash_set_stage(BOOT_SPLASH_STAGE_7_RUN_BOOT_SCRIPT);
|
||||||
// start the init process
|
// start the init process
|
||||||
{
|
{
|
||||||
const char *shellArgs[] = {"/bin/sh", "/boot/beos/system/boot/Bootscript", NULL};
|
const char *args[] = {"/bin/sh", "/boot/beos/system/boot/Bootscript",
|
||||||
const char *initArgs[] = {"/bin/init", NULL};
|
NULL};
|
||||||
const char **args;
|
int32 argc = 2;
|
||||||
int32 argc;
|
|
||||||
thread_id thread;
|
thread_id thread;
|
||||||
|
|
||||||
struct stat st;
|
|
||||||
if (stat(shellArgs[1], &st) == 0) {
|
|
||||||
// start Bootscript
|
|
||||||
args = shellArgs;
|
|
||||||
argc = 2;
|
|
||||||
} else {
|
|
||||||
// ToDo: this is only necessary as long as we have the bootdir mechanism
|
|
||||||
// start init
|
|
||||||
args = initArgs;
|
|
||||||
argc = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
thread = load_image(argc, args, NULL);
|
thread = load_image(argc, args, NULL);
|
||||||
if (thread >= B_OK) {
|
if (thread >= B_OK) {
|
||||||
resume_thread(thread);
|
resume_thread(thread);
|
||||||
|
|||||||
Reference in New Issue
Block a user