diff --git a/headers/private/kernel/boot_splash.h b/headers/private/kernel/boot_splash.h index f9482e4e40..768ef0077c 100644 --- a/headers/private/kernel/boot_splash.h +++ b/headers/private/kernel/boot_splash.h @@ -29,6 +29,7 @@ extern "C" { #endif void boot_splash_init(uint8 * boot_splash); +void boot_splash_uninit(void); void boot_splash_set_stage(int stage); #ifdef __cplusplus diff --git a/src/system/kernel/boot_splash.cpp b/src/system/kernel/boot_splash.cpp index 3ee506fdc5..1e57f7856f 100644 --- a/src/system/kernel/boot_splash.cpp +++ b/src/system/kernel/boot_splash.cpp @@ -185,6 +185,13 @@ boot_splash_init(uint8 *boot_splash) } +void +boot_splash_uninit(void) +{ + sInfo = NULL; +} + + void boot_splash_set_stage(int stage) { diff --git a/src/system/kernel/main.cpp b/src/system/kernel/main.cpp index d10628ee48..cad0b6def4 100644 --- a/src/system/kernel/main.cpp +++ b/src/system/kernel/main.cpp @@ -245,17 +245,6 @@ main2(void *unused) boot_splash_set_stage(BOOT_SPLASH_STAGE_1_INIT_MODULES); module_init(&sKernelArgs); - // ToDo: the preloaded image debug data is placed in the kernel args, and - // thus, if they are enabled, the kernel args shouldn't be freed, so - // that we don't have to copy them. - // What is yet missing is a mechanism that controls this (via driver settings). - if (0) { - // module_init() is supposed to be the last user of the kernel args - // Note: don't confuse the kernel_args structure (which is never freed) - // with the kernel args ranges it contains (and which are freed here). - vm_free_kernel_args(&sKernelArgs); - } - // init userland debugging TRACE("Init Userland debugging\n"); init_user_debug(); @@ -297,9 +286,16 @@ main2(void *unused) device_manager_init_post_modules(&sKernelArgs); boot_splash_set_stage(BOOT_SPLASH_STAGE_7_RUN_BOOT_SCRIPT); -// kernel_args_free(sKernelArgs.boot_splash); -// NOTE: We could introduce a syscall to draw more icons indicating -// stages in the boot script itself. Then we should not free the image. + boot_splash_uninit(); + // NOTE: We could introduce a syscall to draw more icons indicating + // stages in the boot script itself. Then we should not free the image. + // In that case we should copy it over to the kernel heap, so that we + // can still free the kernel args. + + // The boot splash screen is the last user of the kernel args. + // Note: don't confuse the kernel_args structure (which is never freed) + // with the kernel args ranges it contains (and which are freed here). + vm_free_kernel_args(&sKernelArgs); // start the init process {