summaryrefslogtreecommitdiffstats
path: root/qemu/roms/seabios/vgasrc/vgabios.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/roms/seabios/vgasrc/vgabios.c')
-rw-r--r--qemu/roms/seabios/vgasrc/vgabios.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/qemu/roms/seabios/vgasrc/vgabios.c b/qemu/roms/seabios/vgasrc/vgabios.c
index 4aa50e1c1..f07e85bd3 100644
--- a/qemu/roms/seabios/vgasrc/vgabios.c
+++ b/qemu/roms/seabios/vgasrc/vgabios.c
@@ -304,6 +304,12 @@ vga_set_mode(int mode, int flags)
SET_BDA(video_mode, 0xff);
SET_BDA_EXT(vbe_mode, mode | (flags & MF_VBEFLAGS));
SET_BDA_EXT(vgamode_offset, (u32)vmode_g);
+ if (CONFIG_VGA_ALLOCATE_EXTRA_STACK)
+ // Disable extra stack if it appears a modern OS is in use.
+ // This works around bugs in some versions of Windows (Vista
+ // and possibly later) when the stack is in the e-segment.
+ MASK_BDA_EXT(flags, BF_EXTRA_STACK
+ , (flags & MF_LEGACY) ? BF_EXTRA_STACK : 0);
if (memmodel == MM_TEXT) {
SET_BDA(video_cols, width);
SET_BDA(video_rows, height-1);