Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed Mar 22, 2012
1 parent 7ace2eb commit efb0c7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/arch/i386/firmware/pcbios/bios_console.c
Expand Up @@ -163,6 +163,14 @@ static void bios_putchar ( int character ) {
/* Skip non-printable characters */
"cmpb $0x20, %%al\n\t"
"jb 1f\n\t"
/* Read attribute */
"movb %%al, %%cl\n\t"
"movb $0x08, %%ah\n\t"
"int $0x10\n\t"
"xchgb %%al, %%cl\n\t"
/* Skip if attribute matches */
"cmpb %%ah, %%bl\n\t"
"je 1f\n\t"
/* Set attribute */
"movw $0x0001, %%cx\n\t"
"movb $0x09, %%ah\n\t"
Expand Down

0 comments on commit efb0c7f

Please sign in to comment.