aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-02-04 11:23:20 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2013-02-04 11:23:20 -0800
commitb9911b669ba6c0118431df0675ba4df14abb21d8 (patch)
tree684695c856380fe77c6847388638b6a978e3d179
parentb02169f660c5d6095beb5981d790172bc492b8a1 (diff)
downloadsyslinux-b9911b669ba6c0118431df0675ba4df14abb21d8.tar.gz
syslinux-b9911b669ba6c0118431df0675ba4df14abb21d8.tar.xz
syslinux-b9911b669ba6c0118431df0675ba4df14abb21d8.zip
load_linux: the command line pointer depends on real_mode_base
The command line pointer depends on real_mode_base, so we can't set it up until we know where the real mode code will actually land. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--com32/lib/syslinux/load_linux.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index 89e43d24..f70682f0 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -301,18 +301,6 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
}
}
- /* 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;
- }
- }
-
/* Get the memory map */
mmap = syslinux_memory_map(); /* Memory map for shuffle_boot */
amap = syslinux_dup_memmap(mmap); /* Keep track of available memory */
@@ -401,6 +389,18 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
}
}
+ /* Set up the command line information in the header */
+ 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;
+ }
+ }
+
if (syslinux_add_movelist(&fraglist, real_mode_base, (addr_t) kernel_buf,
real_mode_size))
goto bail;