[SeaBIOS] [PATCH v2 6/6] cbvga_set_mode: disable clearmem in windows x86 emulator.

Kevin O'Connor kevin at koconnor.net
Mon Jun 4 15:31:51 CEST 2018


On Mon, Jun 04, 2018 at 09:29:17AM +0200, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
> ---
>  vgasrc/cbvga.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c
> index 3f16bee10c..f6ebe71242 100644
> --- a/vgasrc/cbvga.c
> +++ b/vgasrc/cbvga.c
> @@ -192,8 +192,16 @@ int
>  cbvga_set_mode(struct vgamode_s *vmode_g, int flags)
>  {
>      u8 emul = vmode_g == &CBemulinfo || GET_GLOBAL(CBmode) == 0x03;
> +    /*
> +     * The extra_stack flag is false when running in windows x86
> +     * emulator, to avoid stack switching triggering bugs.  Using the
> +     * same flag here to skip screen clearing, because the windows
> +     * emulator seems to have problems to handle the int 1587 call
> +     * too, and GO_MEMSET uses that.
> +     */
> +    u8 extra_stack = GET_BDA_EXT(flags) & BF_EXTRA_STACK;
>      MASK_BDA_EXT(flags, BF_EMULATE_TEXT, emul ? BF_EMULATE_TEXT : 0);
> -    if (!(flags & MF_NOCLEARMEM)) {
> +    if (!(flags & MF_NOCLEARMEM) && extra_stack) {

FYI, extra_stack will only be true if CONFIG_VGA_ALLOCATE_EXTRA_STACK
is set, but I guess that's okay.

Thanks, the series looks good to me.
-Kevin



More information about the SeaBIOS mailing list