Browse Source

[bios] Fix screen clearing on even more buggy BIOSes

Some BIOSes (observed with a ProLiant DL360p Gen8 SE) perform no range
checking whatsoever on the parameters passed to INT10,06 and will
therefore happily write to an area beyond the end of video RAM.  The
area immediately following the video RAM tends to be the VGA BIOS ROM
image.  Overwriting the VGA BIOS leads to an interesting variety of
crashes and reboots.

Fix by specifying an exact width and height to be cleared, rather than
passing in large values and relying upon the BIOS to truncate them to
the appropriate range.

Reported-by: Alex Davies <adavies@jumptrading.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
c1595129b5
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/arch/i386/firmware/pcbios/bios_console.c

+ 3
- 1
src/arch/i386/firmware/pcbios/bios_console.c View File

@@ -101,7 +101,9 @@ static void bios_handle_ed ( struct ansiesc_context *ctx __unused,
101 101
 					   "int $0x10\n\t"
102 102
 					   "cli\n\t" )
103 103
 			       : : "a" ( 0x0600 ), "b" ( bios_attr << 8 ),
104
-			           "c" ( 0 ), "d" ( 0xfefe ) );
104
+				   "c" ( 0 ),
105
+				   "d" ( ( ( console_height - 1 ) << 8 ) |
106
+					 ( console_width - 1 ) ) );
105 107
 }
106 108
 
107 109
 /**

Loading…
Cancel
Save