Commit 71351b98 authored by H. Peter Anvin's avatar H. Peter Anvin

[x86 setup] Make sure AH=00h when setting a video mode

Passing a u8 into a register doesn't mean gcc will zero-extend it.
Also, don't depend on thhe register not to change.

Per bug report from Saul Tamari.
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent b015124e
...@@ -73,9 +73,10 @@ static u8 vga_set_basic_mode(void) ...@@ -73,9 +73,10 @@ static u8 vga_set_basic_mode(void)
mode = 3; mode = 3;
/* Set the mode */ /* Set the mode */
ax = mode;
asm volatile(INT10 asm volatile(INT10
: : "a" (mode) : "+a" (ax)
: "ebx", "ecx", "edx", "esi", "edi"); : : "ebx", "ecx", "edx", "esi", "edi");
do_restore = 1; do_restore = 1;
return mode; return mode;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment