Browse Source

[bios] Set character attributes only when necessary

There is no INT 10 call for "display character with attribute,
advancing the cursor and scrolling the screen as necessary".  We
therefore make two INT 10 calls: INT 10,09 to write the character with
its attribute at the current cursor position, and then INT 10,0e to
(re)write the character (leaving the attribute unchanged), advance the
cursor position and scroll as necessary.

This confuses the serial-over-LAN console redirection feature provided
by some BIOSes.

Fix by performing the INT10,09 only when necessary to change the
existing attribute.

Reported-by: Itay Gazit <itaygazit@gmail.com>
Tested-by: Itay Gazit <itaygazit@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
efb0c7fce4
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/arch/i386/firmware/pcbios/bios_console.c

+ 8
- 0
src/arch/i386/firmware/pcbios/bios_console.c View File

163
 					   /* Skip non-printable characters */
163
 					   /* Skip non-printable characters */
164
 					   "cmpb $0x20, %%al\n\t"
164
 					   "cmpb $0x20, %%al\n\t"
165
 					   "jb 1f\n\t"
165
 					   "jb 1f\n\t"
166
+					   /* Read attribute */
167
+					   "movb %%al, %%cl\n\t"
168
+					   "movb $0x08, %%ah\n\t"
169
+					   "int $0x10\n\t"
170
+					   "xchgb %%al, %%cl\n\t"
171
+					   /* Skip if attribute matches */
172
+					   "cmpb %%ah, %%bl\n\t"
173
+					   "je 1f\n\t"
166
 					   /* Set attribute */
174
 					   /* Set attribute */
167
 					   "movw $0x0001, %%cx\n\t"
175
 					   "movw $0x0001, %%cx\n\t"
168
 					   "movb $0x09, %%ah\n\t"
176
 					   "movb $0x09, %%ah\n\t"

Loading…
Cancel
Save