summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Soltys <soltys@ziu.info>2011-03-30 15:50:10 +0200
committerMichal Soltys <soltys@ziu.info>2011-03-30 15:50:10 +0200
commit22411fad71c8949dbbe5880ae8a65043ca858872 (patch)
tree9a123893f2dc821284654d968ead762ca194689b
parent0fa69a9b3538d1981bfc00b5444d038aba20ebe3 (diff)
parent0620743d1e54cf48aa8e5cf5636739addae49d60 (diff)
downloadsyslinux-22411fad71c8949dbbe5880ae8a65043ca858872.tar.gz
Merge branch 'master' into chaindev
-rw-r--r--com32/lib/syslinux/load_linux.c27
-rw-r--r--core/fs/pxe/pxe.c6
2 files changed, 23 insertions, 10 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index 3ac6e5d0..c1ce875c 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 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2011 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
@@ -87,6 +87,13 @@ struct linux_header {
uint8_t relocatable_kernel;
uint8_t pad2[3];
uint32_t cmdline_max_len;
+ uint32_t hardware_subarch;
+ uint64_t hardware_subarch_data;
+ uint32_t payload_offset;
+ uint32_t payload_length;
+ uint64_t setup_data;
+ uint64_t pref_address;
+ uint32_t init_size;
} __packed;
#define BOOT_MAGIC 0xAA55
@@ -272,6 +279,17 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
prot_mode_base = (hdr.loadflags & LOAD_HIGH) ? 0x100000 : 0x10000;
prot_mode_size = kernel_size - real_mode_size;
+ if (hdr.version < 0x020a) {
+ /*
+ * The 3* here is a total fudge factor... it's supposed to
+ * account for the fact that the kernel needs to be
+ * decompressed, and then followed by the BSS and BRK regions.
+ * This doesn't, however, account for the fact that the kernel
+ * is decompressed into a whole other place, either.
+ */
+ hdr.init_size = 3 * prot_mode_size;
+ }
+
if (!(hdr.loadflags & LOAD_HIGH) && prot_mode_size > 512 * 1024)
goto bail; /* Kernel cannot be loaded low */
@@ -341,12 +359,7 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
if (start >= end)
continue;
- /* The 3* here is a total fudge factor... it's supposed to
- account for the fact that the kernel needs to be decompressed,
- and then followed by the BSS and BRK regions. This doesn't,
- however, account for the fact that the kernel is decompressed
- into a whole other place, either. */
- if (end - start >= 3 * prot_mode_size) {
+ if (end - start >= hdr.init_size) {
whdr->code32_start += start - prot_mode_base;
prot_mode_base = start;
ok = true;
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index aef2e7e1..12bbdad0 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -754,9 +754,6 @@ static void __pxe_searchdir(const char *filename, struct file *file)
break;
}
- if (!ip)
- return; /* No server */
-
buf++; /* Point *past* the final NULL */
memcpy(buf, rrq_tail, sizeof rrq_tail);
buf += sizeof rrq_tail;
@@ -792,6 +789,9 @@ static void __pxe_searchdir(const char *filename, struct file *file)
}
#endif /* GPXE */
+ if (!ip)
+ goto done; /* No server */
+
timeout_ptr = TimeoutTable; /* Reset timeout */
sendreq: