aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/boot/tty.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-07-16 14:58:24 -0400
committerH. Peter Anvin <hpa@zytor.com>2007-07-18 14:36:17 -0400
commit8c027ae2dcfa7b9130941a2a743c735c1fee04ee (patch)
treecf0f803ee6f3dcaa323f171b58da0bf0b70c9899 /arch/i386/boot/tty.c
parent7ad37df02c529525c4ad19035359af89d2d2a5bd (diff)
[x86 setup] Save/restore DS around invocations of INT 10h
There exists at least one card, Trident TVGA8900CL (BIOS dated 1992/9/8) which clobbers DS when "scrolling in an SVGA text mode of more than 800x600 pixels." Although we are extremely unlikely to run into that situation, it is cheap insurance to save and restore DS, and it only adds a grand total of 50 bytes to the total output. Pointed out by Etienne Lorrain. Cc: Etienne Lorrain <etienne_lorrain@yahoo.fr> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/i386/boot/tty.c')
-rw-r--r--arch/i386/boot/tty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/i386/boot/tty.c b/arch/i386/boot/tty.c
index a8db78736b02..9c668aad3515 100644
--- a/arch/i386/boot/tty.c
+++ b/arch/i386/boot/tty.c
@@ -31,7 +31,7 @@ void __attribute__((section(".inittext"))) putchar(int ch)
31 31
32 /* int $0x10 is known to have bugs involving touching registers 32 /* int $0x10 is known to have bugs involving touching registers
33 it shouldn't. Be extra conservative... */ 33 it shouldn't. Be extra conservative... */
34 asm volatile("pushal; int $0x10; popal" 34 asm volatile("pushal; pushw %%ds; int $0x10; popw %%ds; popal"
35 : : "b" (0x0007), "c" (0x0001), "a" (0x0e00|ch)); 35 : : "b" (0x0007), "c" (0x0001), "a" (0x0e00|ch));
36} 36}
37 37