NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/54767: Wrong mask constant in VESA BIOS Extensions code



The following reply was made to PR kern/54767; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/54767: Wrong mask constant in VESA BIOS Extensions code
Date: Sun, 15 Dec 2019 01:12:14 -0000 (UTC)

 elo%foobox.net@localhost writes:
 
 >	in the ModeAttributes field of the ModeInfoBlock structure for
 >	VBE Function 01h (see page 32), it is bit 7 that indicates
 >	whether linear frame-buffer mode is available, but because
 >	the mask is wrong (0x08 instead of 0x80), it is in fact the
 >	graphics/text-mode flag being tested.
 
 0x08 is a test for color mode, ruling out monochrome modes. I would
 guess that there is no support for that, and we are actually missing
 two lines like:
 
 Index: vbe.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/i386/stand/lib/vbe.c,v
 retrieving revision 1.9
 diff -p -u -r1.9 vbe.c
 --- vbe.c       24 Jan 2017 11:09:14 -0000      1.9
 +++ vbe.c       15 Dec 2019 01:10:26 -0000
 @@ -51,6 +51,8 @@ vbe_mode_is_supported(struct modeinfoblo
         if ((mi->ModeAttributes & 0x01) == 0)
                 return 0;       /* mode not supported by hardware */
         if ((mi->ModeAttributes & 0x08) == 0)
 +               return 0;       /* only color modes are supported */
 +       if ((mi->ModeAttributes & 0x80) == 0)
                 return 0;       /* linear fb not available */
         if ((mi->ModeAttributes & 0x10) == 0)
                 return 0;       /* text mode */
 
 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index