]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* stage2/boot.c: Imply --no-mem-option for Linux kernels with
authorproski <proski@localhost>
Mon, 29 Mar 2004 14:54:30 +0000 (14:54 +0000)
committerproski <proski@localhost>
Mon, 29 Mar 2004 14:54:30 +0000 (14:54 +0000)
protocol version 2.03 and above (Linux 2.4.18 and newer).

ChangeLog
NEWS
docs/grub.texi
stage2/boot.c

index cb0f8167d93167306396b9265363905f91adb853..673b9641984ab3147f23562a7fafc795b055452c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-28  Pavel Roskin  <proski@gnu.org>
+
+       * stage2/boot.c: Imply --no-mem-option for Linux kernels with
+       protocol version 2.03 and above (Linux 2.4.18 and newer).
+
 2004-03-27  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * stage2/char_io.c [!GRUB_UTIL] (memcpy): New function. It is
diff --git a/NEWS b/NEWS
index ecb841ca473d0fc7677773e4106290578db98c99..988a257ddf0ea2f75a1ee5d3836bffd500448685 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ New:
 * Support ATARAID for Linux in the grub shell and grub-install.
 * Add CDROM support for El Torito with no emulation mode. You can use
   (cd) as a CDROM drive in the config file.
+* Option --no-mem-option is implied for Linux 2.4.18 and newer.
 
 New in 0.94 - 2004-01-25:
 * Support building on x86-64 with gcc -m32.
index 5f8f62e5958f9ffa14e8018ce9b48454d37f55f4..e0096be999e533301aff144c50f510602f0d8667 100644 (file)
@@ -2735,7 +2735,7 @@ a kernel type in the other cases, quite safely.
 
 The option @option{--no-mem-option} is effective only for Linux. If the
 option is specified, GRUB doesn't pass the option @option{mem=} to the
-kernel.
+kernel.  This option is implied for Linux kernels 2.4.18 and newer.
 @end deffn
 
 
index b49f9fe97ff5bf89523e52b0509c62e83ea64fe3..4185d23e3b8641d898dd4514129d71ec4f3ca31d 100644 (file)
@@ -407,10 +407,24 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
            while (dest < linux_data_tmp_addr + LINUX_CL_END_OFFSET && *src)
              *(dest++) = *(src++);
        
-           /* Add a mem option automatically only if the user doesn't
-              specify it explicitly.  */
+           /* Old Linux kernels have problems determining the amount of
+              the available memory.  To work around this problem, we add
+              the "mem" option to the kernel command line.  This has its
+              own drawbacks because newer kernels can determine the
+              memory map more accurately.  Boot protocol 2.03, which
+              appeared in Linux 2.4.18, provides a pointer to the kernel
+              version string, so we could check it.  But since kernel
+              2.4.18 and newer are known to detect memory reliably, boot
+              protocol 2.03 already implies that the kernel is new
+              enough.  The "mem" option is added if neither of the
+              following conditions is met:
+              1) The "mem" option is already present.
+              2) The "kernel" command is used with "--no-mem-option".
+              3) GNU GRUB is configured not to pass the "mem" option.
+              4) The kernel supports boot protocol 2.03 or newer.  */
            if (! grub_strstr (arg, "mem=")
                && ! (load_flags & KERNEL_LOAD_NO_MEM_OPTION)
+               && lh->version < 0x0203         /* kernel version < 2.4.18 */
                && dest + 15 < linux_data_tmp_addr + LINUX_CL_END_OFFSET)
              {
                *dest++ = ' ';