Переглянути джерело

[prefix] Add .hrom prefix for a ROM that loads high under PCI3 without PMM

gPXE currently takes advantage of the feature of PCI3.0 that allows
option ROMs to relocate the bulk of their code to high memory and so
take up only a small amount of space in the option ROM area. Currently,
the relocation can only take place if the BIOS's implementation of PMM
can be made to return blocks aligned to an even megabyte, because of
the A20 gate. AMI BIOSes, in particular, will not return allocations
that gPXE can use.

Ameliorate the situation somewhat by adding a prefix, .hrom, that works
identically to .rom except in the case that PMM allocation fails. Where
.rom would give up and place itself entirely in option ROM space, .hrom
moves to a block (assumed free) at HIGHMEM_LOADPOINT = 4MB. This allows
for the use of larger gPXE ROMs than would otherwise be possible.

Because there is no way to check that the area at HIGHMEM_LOADPOINT is
really free, other devices using that memory during the boot process
will cause failure for gPXE, the other device, or both. In practice
such conflicts will likely not occur, but this prefix should still be
considered EXPERIMENTAL.

Signed-off-by: Marty Connor <mdc@etherboot.org>
tags/v1.0.0-rc1
Joshua Oreman 14 роки тому
джерело
коміт
5736f5eb32

+ 1
- 0
src/Makefile.housekeeping Переглянути файл

830
 #
830
 #
831
 FINALISE_rom	= $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
831
 FINALISE_rom	= $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
832
 		  -i$(IDENT) -s 0 $@
832
 		  -i$(IDENT) -s 0 $@
833
+FINALISE_hrom	= $(FINALISE_rom)
833
 
834
 
834
 # Some ROMs require specific flags to be passed to makerom.pl
835
 # Some ROMs require specific flags to be passed to makerom.pl
835
 #
836
 #

+ 2
- 0
src/arch/i386/Makefile.pcbios Переглянути файл

11
 # Media types.
11
 # Media types.
12
 #
12
 #
13
 MEDIA		+= rom
13
 MEDIA		+= rom
14
+MEDIA		+= hrom
14
 MEDIA		+= pxe
15
 MEDIA		+= pxe
15
 MEDIA		+= kpxe
16
 MEDIA		+= kpxe
16
 MEDIA		+= kkpxe
17
 MEDIA		+= kkpxe
30
 # Padding rules
31
 # Padding rules
31
 #
32
 #
32
 PAD_rom		= $(PADIMG) --blksize=512 --byte=0xff $@
33
 PAD_rom		= $(PADIMG) --blksize=512 --byte=0xff $@
34
+PAD_hrom	= $(PAD_rom)
33
 PAD_dsk		= $(PADIMG) --blksize=512 $@
35
 PAD_dsk		= $(PADIMG) --blksize=512 $@
34
 PAD_hd		= $(PADIMG) --blksize=32768 $@
36
 PAD_hd		= $(PADIMG) --blksize=32768 $@
35
 
37
 

+ 12
- 0
src/arch/i386/prefix/hromprefix.S Переглянути файл

1
+/*****************************************************************************
2
+ * ROM prefix that relocates to HIGHMEM_LOADPOINT during POST if PMM allocation
3
+ * fails. Intended to be used, with caution, on BIOSes that support PCI3.00 but
4
+ * have limited PMM support, such as most AMI BIOSes.
5
+ *****************************************************************************
6
+ */
7
+
8
+FILE_LICENCE ( GPL2_OR_LATER )
9
+
10
+#define SHRINK_WITHOUT_PMM
11
+
12
+#include "romprefix.S"

+ 13
- 0
src/arch/i386/prefix/romprefix.S Переглянути файл

351
 	call	print_character
351
 	call	print_character
352
 	movw	%si, %ax
352
 	movw	%si, %ax
353
 	call	print_hex_byte
353
 	call	print_hex_byte
354
+pmm_copy:
354
 	/* Copy ROM to PMM block */
355
 	/* Copy ROM to PMM block */
355
 	xorw	%ax, %ax
356
 	xorw	%ax, %ax
356
 	movw	%ax, %es
357
 	movw	%ax, %es
362
 	movl	%edi, decompress_to
363
 	movl	%edi, decompress_to
363
 	/* Shrink ROM */
364
 	/* Shrink ROM */
364
 	movb	$_prefix_memsz_sect, romheader_size
365
 	movb	$_prefix_memsz_sect, romheader_size
366
+#ifdef SHRINK_WITHOUT_PMM
367
+	jmp	pmm_done
365
 pmm_fail:
368
 pmm_fail:
369
+	/* Print marker and copy ourselves to high memory */
370
+	movl	$HIGHMEM_LOADPOINT, image_source
371
+	xorw	%di, %di
372
+	movb	$( '!' ), %al
373
+	call	print_character
374
+	jmp	pmm_copy
375
+pmm_done:
376
+#else
377
+pmm_fail:
378
+#endif
366
 	/* Restore upper register halves */
379
 	/* Restore upper register halves */
367
 	popal
380
 	popal
368
 no_pmm:
381
 no_pmm:

Завантаження…
Відмінити
Зберегти