diff --git a/src/system/boot/platform/bios_ia32/multiboot.cpp b/src/system/boot/platform/bios_ia32/multiboot.cpp index 0eb241b762..31a1f2cca5 100644 --- a/src/system/boot/platform/bios_ia32/multiboot.cpp +++ b/src/system/boot/platform/bios_ia32/multiboot.cpp @@ -21,12 +21,17 @@ dump_multiboot_info(void) return; dprintf("Found MultiBoot Info at %p\n", gMultiBootInfo); dprintf(" flags: 0x%lx\n", gMultiBootInfo->flags); + if (gMultiBootInfo->flags & MULTIBOOT_INFO_BOOTDEV) dprintf(" boot_device: 0x%lx\n", gMultiBootInfo->boot_device); - if (gMultiBootInfo->flags & MULTIBOOT_INFO_CMDLINE && gMultiBootInfo->cmdline) + + if (gMultiBootInfo->flags & MULTIBOOT_INFO_CMDLINE + && gMultiBootInfo->cmdline) dprintf(" cmdline: '%s'\n", (char *)gMultiBootInfo->cmdline); + if (gMultiBootInfo->boot_loader_name) - dprintf(" boot_loader_name: '%s'\n", (char *)gMultiBootInfo->boot_loader_name); + dprintf(" boot_loader_name: '%s'\n", + (char *)gMultiBootInfo->boot_loader_name); } @@ -34,10 +39,13 @@ status_t parse_multiboot_commandline(stage2_args *args) { static const char *sArgs[] = { NULL, NULL }; - if (!gMultiBootInfo || !(gMultiBootInfo->flags & MULTIBOOT_INFO_CMDLINE) || !gMultiBootInfo->cmdline) + + if (!gMultiBootInfo || !(gMultiBootInfo->flags & MULTIBOOT_INFO_CMDLINE) + || !gMultiBootInfo->cmdline) return B_ENTRY_NOT_FOUND; - + const char *cmdline = (const char *)gMultiBootInfo->cmdline; + // skip kernel (bootloader) name cmdline = strchr(cmdline, ' '); if (!cmdline) @@ -45,7 +53,9 @@ parse_multiboot_commandline(stage2_args *args) cmdline++; if (*cmdline == '\0') return B_ENTRY_NOT_FOUND; + sArgs[0] = cmdline; args->arguments = sArgs; + return B_OK; }