mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
Windows Server 2003 sulks if we feed it an empty region in base memory
as a result of our memory map editing, so strip out any empty regions.
This commit is contained in:
@@ -296,11 +296,19 @@ patch_e820:
|
|||||||
.size patch_e820, . - patch_e820
|
.size patch_e820, . - patch_e820
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* INT 15,e820 handler
|
* Split E820 memory map entry if necessary
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* As for INT 15,e820
|
||||||
|
* Returns:
|
||||||
|
* As for INT 15,e820
|
||||||
|
*
|
||||||
|
* Calls the underlying INT 15,e820 and returns a modified memory map.
|
||||||
|
* Regions will be split around any hidden regions.
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
.section ".text16"
|
.section ".text16"
|
||||||
int15_e820:
|
split_e820:
|
||||||
pushw %si
|
pushw %si
|
||||||
pushw %bp
|
pushw %bp
|
||||||
/* Caller's %bx => %si, real %ebx to %ebx, call previous handler */
|
/* Caller's %bx => %si, real %ebx to %ebx, call previous handler */
|
||||||
@@ -334,14 +342,44 @@ int15_e820:
|
|||||||
popfw
|
popfw
|
||||||
popw %bp
|
popw %bp
|
||||||
popw %si
|
popw %si
|
||||||
lret $2
|
ret
|
||||||
.size int15_e820, . - int15_e820
|
.size split_e820, . - split_e820
|
||||||
|
|
||||||
.section ".text16.data"
|
.section ".text16.data"
|
||||||
real_ebx:
|
real_ebx:
|
||||||
.long 0
|
.long 0
|
||||||
.size real_ebx, . - real_ebx
|
.size real_ebx, . - real_ebx
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* INT 15,e820 handler
|
||||||
|
****************************************************************************
|
||||||
|
*/
|
||||||
|
.section ".text16"
|
||||||
|
int15_e820:
|
||||||
|
pushl %eax
|
||||||
|
pushl %ecx
|
||||||
|
pushl %edx
|
||||||
|
call split_e820
|
||||||
|
pushfw
|
||||||
|
jc 1f
|
||||||
|
/* Check for an empty region */
|
||||||
|
pushl %eax
|
||||||
|
movl %es:8(%di), %eax
|
||||||
|
orl %es:12(%di), %eax
|
||||||
|
popl %eax
|
||||||
|
jnz 1f
|
||||||
|
/* Strip empty regions out of the returned map */
|
||||||
|
popfw
|
||||||
|
popl %edx
|
||||||
|
popl %ecx
|
||||||
|
popl %eax
|
||||||
|
jmp int15_e820
|
||||||
|
/* Restore flags from original INT 15,e820 call and return */
|
||||||
|
1: popfw
|
||||||
|
leal 12(%esp), %esp /* avoid changing flags */
|
||||||
|
lret $2
|
||||||
|
.size int15_e820, . - int15_e820
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* INT 15,e801 handler
|
* INT 15,e801 handler
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user