From owner-freebsd-hackers Sun Aug 17 20:36:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA17506 for hackers-outgoing; Sun, 17 Aug 1997 20:36:30 -0700 (PDT) Received: from nico.telstra.net (nico.telstra.net [139.130.204.16]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id UAA17500 for ; Sun, 17 Aug 1997 20:36:25 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by nico.telstra.net (8.6.10/8.6.10) with ESMTP id NAA12320; Mon, 18 Aug 1997 13:34:05 +1000 Received: (grog@localhost) by freebie.lemis.com (8.8.7/8.6.12) id NAA10140; Mon, 18 Aug 1997 13:04:03 +0930 (CST) Message-ID: <19970818130402.63952@lemis.com> Date: Mon, 18 Aug 1997 13:04:02 +0930 From: Greg Lehey To: Terry Lambert Cc: Michael Smith , sos@sos.freebsd.dk, hackers@FreeBSD.ORG Subject: Re: reset screen hardware? References: <199708170301.MAA03401@genesis.atrad.adelaide.edu.au> <199708171933.MAA07196@phaeton.artisoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Mailer: Mutt 0.81e In-Reply-To: <199708171933.MAA07196@phaeton.artisoft.com>; from Terry Lambert on Sun, Aug 17, 1997 at 12:33:21PM -0700 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog X-MIME-Autoconverted: from 8bit to quoted-printable by freebie.lemis.com id NAA10140 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id UAA17502 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, Aug 17, 1997 at 12:33:21PM -0700, Terry Lambert wrote: >>>> We wont have hundreds of K's of code like that in kernel space. >>> >>> That's for sure. But who says it'll be hundreds of Ks? >> >> Have a look at the X server sources someday. > > But be sure to only look at the DDX code for the generic VGA, since > that's the only thing that will be there by default in any sane > design. Yup. >>> 3. How to we implement it? Ah, there's the rub. I still think it >>> belongs in the probe routines when the system starts up, but on >>> the other hand I agree with S=F8ren that kernel bloat is Bad. >> >> Call the BIOS on the video card. See above. > > This won't necessarily result in the card going from some arbitrary > state to some known state, unless the BIOS was used to get the card > into that state in the first place. > > Specifically, there exist write-only registers which are shadowed > in RAM on a number of cards, and any modification outside the BIOS > will result in the shadow data being rendered stale. > > Any attempt to restore the card toa known state using BIOS will only > operate on the deltas from the shadow state to the desired state. > > Unless you modify X to use the BIOS calls to set the card state, > you will not be able to use the BIOS to reset the card state. > > Further, it's probably desirable to link the state restoration to > the *previous* state, which may not be known to the console driver, > rather than the default state (which might be). For example, consider > a 50 line text display following the manual loading of a VGA font > for support of this mode, the memory for which is subsequently > stomped by the X server. > > Consider also the possible consequences of a previous mode that > was not the default mode for the kernel debugger in a break to > kernel debugger while X is active on the console. > > If a BIOS-based approach is used, it will seriously limit the > available modes for normal console operation and for X servers; > this is probably an unacceptable consequence. Are you sure of this? Most BIOSes manage to reset to text mode every time you reboot the machine, even without a hardware reset. But in general I agree, this is a bit of a kludge. >> ... ] > >> Hah. You obviously haven't had to work with PC viode hardware, have you? > > I agree with this "hah"... that last suggestion was naieve. On the > other hand, I don't think it was punishably so, I think he was just > trying to compromise with an uncompromising opponent. 8-) 8). No, it wasn't naïve. You appear to have misinterpreted it. Sure, there's more to it than just supplying a list of register/content pairs, but not too much more. An appropriately intelligent format of the register list would handle it. >> On the other hand, the manufacturer of the card _does_ know intimately >> how it works. They write functions for manipulating the card >> hardware, and stick them in a PROM on the card. >> >> Why not use their code and save ourselves the agony? > > Because unless you use their code for all things, the result of > using their code is indeterminate. Even if the automaton involved > is determinant (it is), the results depend entirely on the start > states (they aren't). There's another point to be made that the board manufacturer's software doesn't do all the things we would like to do with it. It's optimized for Microslop, and even Microslop environments need external drivers. Sure, as I suggested in an earlier message, we can follow up the BIOS calls with appropriate calls from the video driver. And it would probably work. But it's not pretty. Greg