Ensure that empty e820 regions are skipped even at the end of the
memory map. (We achieve this by setting CF on the last entry if it is zero-length; this avoids the need to look ahead to see at each entry if the *next* entry would be both the last entry and zero-length). This fixes the "0kB base memory" error message upon starting Windows 2003 on a SunFire X2100.
This commit is contained in:
parent
2303c45d65
commit
e445c2c07c
|
@ -361,26 +361,33 @@ int15_e820:
|
||||||
pushl %edx
|
pushl %edx
|
||||||
call split_e820
|
call split_e820
|
||||||
pushfw
|
pushfw
|
||||||
/* Skip empty region checking if we've reached the end of the
|
/* If we've hit an error, exit immediately */
|
||||||
* map or hit an error, to avoid a potential endless loop.
|
jc 99f
|
||||||
*/
|
/* If region is non-empty, return this region */
|
||||||
jc 1f
|
|
||||||
testl %ebx, %ebx
|
|
||||||
jz 1f
|
|
||||||
/* Check for an empty region */
|
|
||||||
pushl %eax
|
pushl %eax
|
||||||
movl %es:8(%di), %eax
|
movl %es:8(%di), %eax
|
||||||
orl %es:12(%di), %eax
|
orl %es:12(%di), %eax
|
||||||
popl %eax
|
popl %eax
|
||||||
jnz 1f
|
jnz 99f
|
||||||
/* Strip empty regions out of the returned map */
|
/* Region is empty. If this is not the end of the map,
|
||||||
|
* skip over this region.
|
||||||
|
*/
|
||||||
|
testl %ebx, %ebx
|
||||||
|
jz 1f
|
||||||
popfw
|
popfw
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
popl %eax
|
popl %eax
|
||||||
jmp int15_e820
|
jmp int15_e820
|
||||||
/* Restore flags from original INT 15,e820 call and return */
|
1: /* Region is empty and this is the end of the map. Return
|
||||||
1: popfw
|
* with CF set to avoid placing an empty region at the end of
|
||||||
|
* the map.
|
||||||
|
*/
|
||||||
|
popfw
|
||||||
|
stc
|
||||||
|
pushfw
|
||||||
|
99: /* Restore flags from original INT 15,e820 call and return */
|
||||||
|
popfw
|
||||||
addr32 leal 12(%esp), %esp /* avoid changing flags */
|
addr32 leal 12(%esp), %esp /* avoid changing flags */
|
||||||
lret $2
|
lret $2
|
||||||
.size int15_e820, . - int15_e820
|
.size int15_e820, . - int15_e820
|
||||||
|
|
Reference in New Issue