From b02169f660c5d6095beb5981d790172bc492b8a1 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 4 Feb 2013 11:07:11 -0800 Subject: 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 --- com32/lib/syslinux/load_linux.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'com32/lib/syslinux/load_linux.c') 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; } -- cgit v1.2.1