]> Zhao Yanbai Git Server - minix.git/commitdiff
Fixes for loading kernel with multiboot
authorBen Gras <ben@minix3.org>
Thu, 9 Feb 2012 17:49:24 +0000 (18:49 +0100)
committerBen Gras <ben@minix3.org>
Thu, 9 Feb 2012 17:54:45 +0000 (18:54 +0100)
While parsing command line, only consider "variable=value" to
be part of environment.

Patch by Antoine Leca.

kernel/arch/i386/pre_init.c

index 9dbd07491990fd39df6ce5cf7de4f6d30a35824f..fe020b9f6f209a62b271b1024f096a44f7bf8441 100644 (file)
@@ -13,7 +13,6 @@
 #include <minix/com.h>
 #include <sys/param.h>
 #include <machine/partition.h>
-#include "../../../boot/image.h"
 #include "string.h"
 #include "arch_proto.h"
 #include "libexec.h"
@@ -147,6 +146,8 @@ PRIVATE void mb_print(char *str)
        while (*str) {
                if (*str == '\n') {
                        str++;
+                       while (print_col < MULTIBOOT_CONSOLE_COLS)
+                               mb_put_char(' ', print_line, print_col++);
                        print_line++;
                        print_col = 0;
                        continue;
@@ -283,10 +284,10 @@ PRIVATE void get_parameters(multiboot_info_t *mbi)
                        value_i = 0;
                        while (*p == ' ') p++;
                        if (!*p) break;
-                       while (*p && *p != '=' && var_i < GRAN - 1) 
+                       while (*p && *p != '=' && *p != ' ' && var_i < GRAN - 1) 
                                var[var_i++] = *p++ ;
                        var[var_i] = 0;
-                       p++; /* skip '=' */
+                       if (*p++ != '=') continue; /* skip if not name=value */
                        while (*p && *p != ' ' && value_i < GRAN - 1) 
                                value[value_i++] = *p++ ;
                        value[value_i] = 0;