summaryrefslogtreecommitdiffstats
path: root/arch/i386/boot/video.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/boot/video.h')
-rw-r--r--arch/i386/boot/video.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/i386/boot/video.h b/arch/i386/boot/video.h
index 29eca1710b2..b92447d5121 100644
--- a/arch/i386/boot/video.h
+++ b/arch/i386/boot/video.h
@@ -117,8 +117,15 @@ extern int graphic_mode; /* Graphics mode with linear frame buffer */
* int $0x10 is notorious for touching registers it shouldn't.
* gcc doesn't like %ebp being clobbered, so define it as a push/pop
* sequence here.
+ *
+ * A number of systems, including the original PC can clobber %bp in
+ * certain circumstances, like when scrolling. There exists at least
+ * one Trident video card which could clobber DS under a set of
+ * circumstances that we are unlikely to encounter (scrolling when
+ * using an extended graphics mode of more than 800x600 pixels), but
+ * it's cheap insurance to deal with that here.
*/
-#define INT10 "pushl %%ebp; int $0x10; popl %%ebp"
+#define INT10 "pushl %%ebp; pushw %%ds; int $0x10; popw %%ds; popl %%ebp"
/* Accessing VGA indexed registers */
static inline u8 in_idx(u16 port, u8 index)