From owner-freebsd-hackers Thu Jan 27 14:37: 4 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from server.baldwin.cx (jobaldwi.campus.vt.edu [198.82.67.146]) by hub.freebsd.org (Postfix) with ESMTP id D83FF15877; Thu, 27 Jan 2000 14:36:47 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from john.baldwin.cx (john [10.0.0.2]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id RAA54160; Thu, 27 Jan 2000 17:36:45 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-Id: <200001272236.RAA54160@server.baldwin.cx> X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 27 Jan 2000 17:36:45 -0500 (EST) From: John Baldwin To: Brian Fundakowski Feldman Subject: RE: VGA card (mis)behavior Cc: yokota@FreeBSD.org, hackers@FreeBSD.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 -- 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