summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmiles@google.com <smiles@google.com@ca484b36-2546-0410-af21-7957cbf944c2>2009-11-13 00:21:26 +0000
committersmiles@google.com <smiles@google.com@ca484b36-2546-0410-af21-7957cbf944c2>2009-11-13 00:21:26 +0000
commit8eb5346034c7dbd15694d59d7e1db2eec8a689f9 (patch)
tree3bb381dfe914f85b155671ddf3328a3be712282f
parent920f770ac1285d99d1fde703fd1f22355e8114a8 (diff)
downloadqemu-sgabios-8eb5346034c7dbd15694d59d7e1db2eec8a689f9.tar.gz
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
-rw-r--r--sgabios.S5
1 files changed, 5 insertions, 0 deletions
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
/*