Bläddra i källkod

Check to see if we've reached the end of the map before attempting to

skip past an empty region, otherwise we end up generating an infinitely
long e820 map.  (Yes, there *are* real systems that provide e820 maps
with a zero-length region at the end...)
tags/v0.9.3
Michael Brown 19 år sedan
förälder
incheckning
78dd963c1f
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5
    0
      src/arch/i386/firmware/pcbios/e820mangler.S

+ 5
- 0
src/arch/i386/firmware/pcbios/e820mangler.S Visa fil

361
 	pushl	%edx	
361
 	pushl	%edx	
362
 	call	split_e820
362
 	call	split_e820
363
 	pushfw
363
 	pushfw
364
+	/* Skip empty region checking if we've reached the end of the
365
+	 * map or hit an error, to avoid a potential endless loop.
366
+	 */
364
 	jc	1f
367
 	jc	1f
368
+	testl	%ebx, %ebx
369
+	jz	1f
365
 	/* Check for an empty region */
370
 	/* Check for an empty region */
366
 	pushl	%eax
371
 	pushl	%eax
367
 	movl	%es:8(%di), %eax
372
 	movl	%es:8(%di), %eax

Laddar…
Avbryt
Spara