Date: Thu, 27 Jan 2000 12:44:10 -0500 (EST) From: Brian Fundakowski Feldman <green@FreeBSD.org> To: hackers@FreeBSD.org, yokota@FreeBSD.org Subject: VGA card (mis)behavior Message-ID: <Pine.BSF.4.21.0001271237500.95997-100000@green.dyndns.org>
next in thread | raw e-mail | index | archive | help
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. -- 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0001271237500.95997-100000>