summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/firmware/pcbios/bios_console.c
diff options
context:
space:
mode:
authorMichael Brown2014-03-21 12:07:29 +0100
committerMichael Brown2014-03-21 17:56:34 +0100
commitc1595129b51940bb620302d6da5accef50626da9 (patch)
tree9a3d41a9495ecbd454982861016fb00857203c67 /src/arch/i386/firmware/pcbios/bios_console.c
parent[realtek] Clear bit 24 of RCR (diff)
downloadipxe-c1595129b51940bb620302d6da5accef50626da9.tar.gz
ipxe-c1595129b51940bb620302d6da5accef50626da9.tar.xz
ipxe-c1595129b51940bb620302d6da5accef50626da9.zip
[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>
Diffstat (limited to 'src/arch/i386/firmware/pcbios/bios_console.c')
-rw-r--r--src/arch/i386/firmware/pcbios/bios_console.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/arch/i386/firmware/pcbios/bios_console.c b/src/arch/i386/firmware/pcbios/bios_console.c
index 035831c8..b2b7bf2d 100644
--- a/src/arch/i386/firmware/pcbios/bios_console.c
+++ b/src/arch/i386/firmware/pcbios/bios_console.c
@@ -101,7 +101,9 @@ static void bios_handle_ed ( struct ansiesc_context *ctx __unused,
"int $0x10\n\t"
"cli\n\t" )
: : "a" ( 0x0600 ), "b" ( bios_attr << 8 ),
- "c" ( 0 ), "d" ( 0xfefe ) );
+ "c" ( 0 ),
+ "d" ( ( ( console_height - 1 ) << 8 ) |
+ ( console_width - 1 ) ) );
}
/**