Skip to content

Commit efb0c7f

Browse files
committedMar 22, 2012
[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>
1 parent 7ace2eb commit efb0c7f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/arch/i386/firmware/pcbios/bios_console.c

+8
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ static void bios_putchar ( int character ) {
163163
/* Skip non-printable characters */
164164
"cmpb $0x20, %%al\n\t"
165165
"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"
166174
/* Set attribute */
167175
"movw $0x0001, %%cx\n\t"
168176
"movb $0x09, %%ah\n\t"

0 commit comments

Comments
 (0)