|
@@ -21,16 +21,6 @@ FILE_LICENCE ( GPL2_OR_LATER )
|
21
|
21
|
|
22
|
22
|
.arch i386
|
23
|
23
|
|
24
|
|
-/**
|
25
|
|
- * High memory temporary load address
|
26
|
|
- *
|
27
|
|
- * Temporary buffer into which to copy (or decompress) our runtime
|
28
|
|
- * image, prior to calling get_memmap() and relocate(). We don't
|
29
|
|
- * actually leave anything here once install() has returned.
|
30
|
|
- */
|
31
|
|
- .globl HIGHMEM_LOADPOINT
|
32
|
|
- .equ HIGHMEM_LOADPOINT, ( 1 << 20 )
|
33
|
|
-
|
34
|
24
|
/* Image compression enabled */
|
35
|
25
|
#define COMPRESS 1
|
36
|
26
|
|
|
@@ -451,8 +441,8 @@ install:
|
451
|
441
|
call alloc_basemem
|
452
|
442
|
/* Image source = %cs:0000 */
|
453
|
443
|
xorl %esi, %esi
|
454
|
|
- /* Image destination = HIGHMEM_LOADPOINT */
|
455
|
|
- movl $HIGHMEM_LOADPOINT, %edi
|
|
444
|
+ /* Image destination = default */
|
|
445
|
+ xorl %edi, %edi
|
456
|
446
|
/* Install text and data segments */
|
457
|
447
|
call install_prealloc
|
458
|
448
|
/* Restore registers and return */
|
|
@@ -470,7 +460,7 @@ install:
|
470
|
460
|
* %ax : .text16 segment address
|
471
|
461
|
* %bx : .data16 segment address
|
472
|
462
|
* %esi : Image source physical address (or zero for %cs:0000)
|
473
|
|
- * %edi : Decompression temporary area physical address
|
|
463
|
+ * %edi : Decompression temporary area physical address (or zero for default)
|
474
|
464
|
* Corrupts:
|
475
|
465
|
* none
|
476
|
466
|
****************************************************************************
|
|
@@ -550,6 +540,22 @@ a20_death_message:
|
550
|
540
|
movw %ax, (init_libkir_vector+2)
|
551
|
541
|
lcall *init_libkir_vector
|
552
|
542
|
#else
|
|
543
|
+ /* Find a suitable decompression temporary area, if none specified */
|
|
544
|
+ testl %ebp, %ebp
|
|
545
|
+ jnz 1f
|
|
546
|
+ /* Use INT 15,88 to find the highest available address via INT
|
|
547
|
+ * 15,88. This limits us to around 64MB, which should avoid
|
|
548
|
+ * all of the POST-time memory map failure modes.
|
|
549
|
+ */
|
|
550
|
+ pushl %eax
|
|
551
|
+ movb $0x88, %ah
|
|
552
|
+ int $0x15
|
|
553
|
+ movw %ax, %bp
|
|
554
|
+ addl $0x400, %ebp
|
|
555
|
+ subl $_textdata_memsz_kb, %ebp
|
|
556
|
+ shll $10, %ebp
|
|
557
|
+ popl %eax
|
|
558
|
+1:
|
553
|
559
|
/* Install .text and .data to temporary area in high memory,
|
554
|
560
|
* prior to reading the E820 memory map and relocating
|
555
|
561
|
* properly.
|