aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-02-04 11:07:11 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2013-02-04 11:12:52 -0800
commitb02169f660c5d6095beb5981d790172bc492b8a1 (patch)
treec20e32a8e9ef80a73a3114bdae0e95b9c9db254d
parenta2d79191b501276026a0a16ec2fa664630a20476 (diff)
downloadsyslinux-b02169f660c5d6095beb5981d790172bc492b8a1.tar.gz
syslinux-b02169f660c5d6095beb5981d790172bc492b8a1.tar.xz
syslinux-b02169f660c5d6095beb5981d790172bc492b8a1.zip
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@linux.intel.com>
-rw-r--r--com32/lib/syslinux/load_linux.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index c0335dc9..89e43d24 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;
}