diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile index 353d59766f..cc8a13cfc7 100644 --- a/src/system/kernel/Jamfile +++ b/src/system/kernel/Jamfile @@ -29,7 +29,7 @@ KernelMergeObject kernel_core.o : kernel_daemon.cpp linkhack.c lock.cpp - main.c + main.cpp module.cpp Notifications.cpp port.cpp diff --git a/src/system/kernel/main.c b/src/system/kernel/main.cpp similarity index 91% rename from src/system/kernel/main.c rename to src/system/kernel/main.cpp index 8a573d0778..935cf631bd 100644 --- a/src/system/kernel/main.c +++ b/src/system/kernel/main.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -21,6 +22,8 @@ #include #include #include +#include +#include #include #include #include @@ -61,8 +64,17 @@ static uint32 sCpuRendezvous; static uint32 sCpuRendezvous2; static int32 main2(void *); -int _start(kernel_args *bootKernelArgs, int cpu); /* keep compiler happy */ +#ifdef __cplusplus +extern "C" { +#endif + +extern int _start(kernel_args *bootKernelArgs, int cpu); + /* keep compiler happy */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif int _start(kernel_args *bootKernelArgs, int currentCPU) @@ -292,8 +304,19 @@ main2(void *unused) // start the init process { - const char *args[] = {"/bin/sh", "/boot/beos/system/boot/Bootscript", - NULL}; + KPath bootScriptPath; + status_t status = find_directory(B_BEOS_SYSTEM_DIRECTORY, gBootDevice, + false, bootScriptPath.LockBuffer(), bootScriptPath.BufferSize()); + if (status != B_OK) + dprintf("main2: find_directory() failed: %s\n", strerror(status)); + bootScriptPath.UnlockBuffer(); + status = bootScriptPath.Append("boot/Bootscript"); + if (status != B_OK) { + dprintf("main2: constructing path to Bootscript failed: " + "%s\n", strerror(status)); + } + + const char *args[] = { "/bin/sh", bootScriptPath.Path(), NULL }; int32 argc = 2; thread_id thread;