Date: Thu, 27 Jan 2000 17:36:45 -0500 (EST) From: John Baldwin <jhb@FreeBSD.org> To: Brian Fundakowski Feldman <green@FreeBSD.org> Cc: yokota@FreeBSD.org, hackers@FreeBSD.org Subject: RE: VGA card (mis)behavior Message-ID: <200001272236.RAA54160@server.baldwin.cx> In-Reply-To: <Pine.BSF.4.21.0001271237500.95997-100000@green.dyndns.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 27-Jan-00 Brian Fundakowski Feldman wrote: > This really does need to be fixed for 4.0-RELEASE. There exists the problem > where certain BIOSes will whack a VGA card out of shape, preventing > FreeBSD from recognizing the card. The proper solution is to whack it > into shape ASAP, and ASAP here would be the loader: you need to be able > to interact with the loader, and weird BIOS modes making things impossible > to read are _bad_. It's been tested for a while here, and works, setting > the card to the correct mode. What needs work is to have the right > mode for monochromatic cards set, which it isn't now. Would someone > in the know review, (fix WRT mono) and commit these diffs? It's very > important to be done. I originally got these diffs from W. Gerald Hicks. There is a way to detect monochrome or color via one of the 0x3dX registers. It's the register that tells you if the rest of the vido registers are at 0x3bX (mono) or 0x3cX (color). I can't remember which bit in which register that is though. If someone can find that out, then we can fix this properly. > -- > Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / > green@FreeBSD.org `------------------------------' > > Index: i386/libi386/vidconsole.c > =================================================================== > RCS file: /usr2/ncvs/src/sys/boot/i386/libi386/vidconsole.c,v > retrieving revision 1.12 > diff -u -r1.12 vidconsole.c > --- i386/libi386/vidconsole.c 1999/08/28 00:40:16 1.12 > +++ i386/libi386/vidconsole.c 2000/01/19 08:16:17 > @@ -42,6 +42,7 @@ > #endif > static void vidc_probe(struct console *cp); > static int vidc_init(int arg); > +static void vidc_setmode(int mode); > static void vidc_putchar(int c); > static int vidc_getchar(void); > static int vidc_ischar(void); > @@ -106,6 +107,7 @@ > if (vidc_started && arg == 0) > return; > vidc_started = 1; > + vidc_setmode(3); /* XXX - set 80x25 16 color text mode */ > #ifdef TERM_EMU > /* Init terminal emulator */ > end_term(); > @@ -117,6 +119,15 @@ > for(i = 0; i < 10 && vidc_ischar(); i++) > (void)vidc_getchar(); > return(0); /* XXX reinit? */ > +} > + > +static void > +vidc_setmode(int mode) > +{ > + v86.ctl = 0; > + v86.addr = 0x10; > + v86.eax = mode & 0xff; /* AH=0, AL=mode */ > + v86int(); > } > > static void > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001272236.RAA54160>