summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2011-03-28 01:55:15 +0200
committerMichael Brown2011-03-28 02:00:59 +0200
commit5924e65cea135ecac66953e583f4cf40d31d06e8 (patch)
tree58529b82ed3a9e83604bc38f83a633ee9e7a636a /src
parent[build] Generate hybrid ISO images if isohybrid is available (diff)
downloadipxe-5924e65cea135ecac66953e583f4cf40d31d06e8.tar.gz
ipxe-5924e65cea135ecac66953e583f4cf40d31d06e8.tar.xz
ipxe-5924e65cea135ecac66953e583f4cf40d31d06e8.zip
[prefix] Avoid using base memory for temporary decompression area
In the unlikely (but observable) event that INT 15,88 returns less memory above 1MB than is required for the temporary decompression area, ignore it and use the 1MB point anyway. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/prefix/libprefix.S10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S
index 76f455862..77151a67e 100644
--- a/src/arch/i386/prefix/libprefix.S
+++ b/src/arch/i386/prefix/libprefix.S
@@ -753,21 +753,25 @@ payload_death_message:
lcall *init_libkir_vector
#else
/* Find a suitable decompression temporary area, if none specified */
+ pushl %eax
testl %ebp, %ebp
jnz 1f
/* Use INT 15,88 to find the highest available address via INT
* 15,88. This limits us to around 64MB, which should avoid
* all of the POST-time memory map failure modes.
*/
- pushl %eax
movb $0x88, %ah
int $0x15
movw %ax, %bp
addl $0x400, %ebp
subl $_textdata_memsz_kb, %ebp
shll $10, %ebp
- popl %eax
-1:
+ /* Sanity check: if we have ended up below 1MB, use 1MB */
+ cmpl $0x100000, %ebp
+ jae 1f
+ movl $0x100000, %ebp
+1: popl %eax
+
/* Install .text and .data to temporary area in high memory,
* prior to reading the E820 memory map and relocating
* properly.