From 8eb5346034c7dbd15694d59d7e1db2eec8a689f9 Mon Sep 17 00:00:00 2001 From: "smiles@google.com" Date: Fri, 13 Nov 2009 00:21:26 +0000 Subject: Merged the following bug fixes from the smiles branch... * Fixed bug in write_string procedure which resulted in the DS register being clobbered. * Fixed bug in write_string which would result in 64kb of garbage being written to the serial port if cx (number of characters to write) was 0. git-svn-id: http://sgabios.googlecode.com/svn/trunk@7 ca484b36-2546-0410-af21-7957cbf944c2 --- sgabios.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sgabios.S b/sgabios.S index 9ada0c2..6d63f58 100644 --- a/sgabios.S +++ b/sgabios.S @@ -1735,6 +1735,7 @@ write_char_tail: */ write_string: call set_cursor_position + pushw %ds pushw %es pushw %es popw %ds /* ds = es */ @@ -1742,7 +1743,10 @@ write_string: testb $2, %al jnz write_attr_string call send_attribute /* send attribute in %bl */ + test %cx, %cx + jz write_string_empty call send_string /* plaintext out */ +write_string_empty: jmp write_string_update_cursor write_attr_string: call send_attr_string /* text+attrib out */ @@ -1753,6 +1757,7 @@ write_string_update_cursor: call set_cursor_position write_string_tail: popw %es + popw %ds ret /* -- cgit v1.1