[syslinux:elflink] load_linux: boot protocol < 2.00 could still have a command line

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Mon Feb 4 11:15:08 PST 2013


Commit-ID:  b02169f660c5d6095beb5981d790172bc492b8a1
Gitweb:     http://www.syslinux.org/commit/b02169f660c5d6095beb5981d790172bc492b8a1
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Mon, 4 Feb 2013 11:07:11 -0800
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Mon, 4 Feb 2013 11:12:52 -0800

load_linux: boot protocol < 2.00 could still have a command line

The command line existed before the 2.00 boot protocol, it was the
initrd which was the new addition to that version.  Therefore, allow
the command line to be set even for the ancient kernels.

This is necessary to specify a command line for memtest86+.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>

---
 com32/lib/syslinux/load_linux.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index c0335dc..89e43d2 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -1,7 +1,7 @@
 /* ----------------------------------------------------------------------- *
  *
  *   Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
- *   Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin
+ *   Copyright 2009-2013 Intel Corporation; author: H. Peter Anvin
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -299,11 +299,15 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
 	    whdr->heap_end_ptr = cmdline_offset - 0x0200;
 	    whdr->loadflags |= CAN_USE_HEAP;
 	}
-	if (hdr.version >= 0x0202) {
-	    whdr->cmd_line_ptr = real_mode_base + cmdline_offset;
-	} else {
-	    whdr->old_cmd_line_magic = OLD_CMDLINE_MAGIC;
-	    whdr->old_cmd_line_offset = cmdline_offset;
+    }
+
+    /* Set up the command line */
+    if (hdr.version >= 0x0202) {
+	whdr->cmd_line_ptr = real_mode_base + cmdline_offset;
+    } else {
+	whdr->old_cmd_line_magic = OLD_CMDLINE_MAGIC;
+	whdr->old_cmd_line_offset = cmdline_offset;
+	if (hdr.version >= 0x0200) {
 	    /* Be paranoid and round up to a multiple of 16 */
 	    whdr->setup_move_size = (cmdline_offset + cmdline_size + 15) & ~15;
 	}


More information about the Syslinux-commits mailing list