|
@@ -753,21 +753,25 @@ payload_death_message:
|
753
|
753
|
lcall *init_libkir_vector
|
754
|
754
|
#else
|
755
|
755
|
/* Find a suitable decompression temporary area, if none specified */
|
|
756
|
+ pushl %eax
|
756
|
757
|
testl %ebp, %ebp
|
757
|
758
|
jnz 1f
|
758
|
759
|
/* Use INT 15,88 to find the highest available address via INT
|
759
|
760
|
* 15,88. This limits us to around 64MB, which should avoid
|
760
|
761
|
* all of the POST-time memory map failure modes.
|
761
|
762
|
*/
|
762
|
|
- pushl %eax
|
763
|
763
|
movb $0x88, %ah
|
764
|
764
|
int $0x15
|
765
|
765
|
movw %ax, %bp
|
766
|
766
|
addl $0x400, %ebp
|
767
|
767
|
subl $_textdata_memsz_kb, %ebp
|
768
|
768
|
shll $10, %ebp
|
769
|
|
- popl %eax
|
770
|
|
-1:
|
|
769
|
+ /* Sanity check: if we have ended up below 1MB, use 1MB */
|
|
770
|
+ cmpl $0x100000, %ebp
|
|
771
|
+ jae 1f
|
|
772
|
+ movl $0x100000, %ebp
|
|
773
|
+1: popl %eax
|
|
774
|
+
|
771
|
775
|
/* Install .text and .data to temporary area in high memory,
|
772
|
776
|
* prior to reading the E820 memory map and relocating
|
773
|
777
|
* properly.
|