diff --git a/src/system/boot/loader/elf.cpp b/src/system/boot/loader/elf.cpp index fbb5e3611a..a00b6a45d3 100644 --- a/src/system/boot/loader/elf.cpp +++ b/src/system/boot/loader/elf.cpp @@ -126,9 +126,9 @@ load_elf_symbol_table(int fd, preloaded_image *image) status = B_ERROR; goto error1; } - + // find symbol table in section headers - + for (int32 i = 0; i < elfHeader.e_shnum; i++) { if (sectionHeaders[i].sh_type == SHT_SYMTAB) { stringHeader = §ionHeaders[sectionHeaders[i].sh_link]; @@ -423,7 +423,11 @@ elf_load_image(Directory *directory, const char *path) status_t status = elf_load_image(fd, image); if (status == B_OK) { - image->name = kernel_args_strdup(path); + char tmpPath[B_PATH_NAME_LENGTH]; + if (directory->GetPath(path, tmpPath, sizeof(tmpPath)) == B_OK) + image->name = kernel_args_strdup(tmpPath); + else + image->name = kernel_args_strdup(path); image->inode = stat.st_ino; // insert to kernel args diff --git a/src/system/boot/loader/loader.cpp b/src/system/boot/loader/loader.cpp index 0bf41f65df..1fb0ab9b7f 100644 --- a/src/system/boot/loader/loader.cpp +++ b/src/system/boot/loader/loader.cpp @@ -51,7 +51,7 @@ is_bootable(Directory *volume) } -status_t +status_t load_kernel(stage2_args *args, Directory *volume) { int fd = open_from(volume, KERNEL_PATH, O_RDONLY); @@ -75,6 +75,12 @@ load_kernel(stage2_args *args, Directory *volume) return status; } + char tmpPath[B_PATH_NAME_LENGTH]; + if (volume->GetPath(KERNEL_PATH, tmpPath, sizeof(tmpPath)) == B_OK) + gKernelArgs.kernel_image.name = kernel_args_strdup(tmpPath); + else + gKernelArgs.kernel_image.name = kernel_args_strdup("kernel"); + return B_OK; } @@ -162,7 +168,7 @@ load_module(Directory *volume, const char *name) } -status_t +status_t load_modules(stage2_args *args, Directory *volume) { int32 failed = 0; diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index a446a02960..d6ab9302b8 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -4052,8 +4052,6 @@ vm_init(kernel_args *args) allocate_kernel_args(args); - args->kernel_image.name = "kernel"; - // the lazy boot loader currently doesn't set the kernel's name... create_preloaded_image_areas(&args->kernel_image); // allocate areas for preloaded images