Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2002 10:51:09 -0600 (CST)
From:      "Karl L. Dunn" <kdunn@hiwaay.net>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        freebsd-alpha@FreeBSD.ORG
Subject:   Re: Multia: syscons does not find PCI vga card
Message-ID:  <Pine.OSF.4.44.0211150918260.345064-100000@fly.hiwaay.net>
In-Reply-To: <3DD2FD05.882412E3@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I put the following fix in, rebuilt the GENERIC kernel (on this Multia 
that takes about four hours), and booted it.

dmesg (verbose boot) comes out the same as before, that is, the vga card 
probe fails.  A diff between the previous dmesg and the present one shows 
only the build date stuff.

I realize there aren't many folks trying to get a Multia to run FreeBSD 
with X, but there must be some.  I want to continue to hack this by proxy 
(I'm new to kernel stuff myself), and could use any more hints you can 
think of.

BTW - how do I get X to run without syscons, once we get the vga to work?
Or do we actually have to have syscons, and a successful setup of the S3 
vga is a step in that direction?  It seems to me that X has to have a 
working console.

 ========================================================================
 --- vga.c.org	Sat Aug 11 02:58:44 2001
 +++ vga.c	Thu Nov 14 14:50:23 2002
 @@ -25,12 +25,13 @@
   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * $FreeBSD: src/sys/dev/fb/vga.c,v 1.9.2.1 2001/08/11 02:58:44 yokota Exp $
   */
 + /* Fix PCI vga probe failure per Terry Lambert msg 2002/Nov/13 -- KLD */
  
  #include "opt_vga.h"
  #include "opt_fb.h"
  #include "opt_syscons.h"	/* should be removed in the future, XXX */
  
  #include <sys/param.h>
 @@ -924,13 +925,15 @@
  #if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
      u_char *mp;
  #endif
      int i;
  
      /* do this test only once */
 -    if (vga_init_done)
 +    /* Fix PCI vga probe failure per Terry Lambert msg 2002/Nov/13 -- KLD */
 +    /* if (vga_init_done) */
 +    if (vga_init_done && (biosadapters > 0))
  	return biosadapters;
      vga_init_done = TRUE;
  
      /* 
       * Locate display adapters. 
       * The AT architecture supports upto two adapters. `syscons' allows
 ========================================================================

-- 
Karl Dunn
k.l.dunn@ieee.org

On Wed, 13 Nov 2002, Terry Lambert wrote:

> "Karl L. Dunn" wrote:
> > I have a Multia/UDB (alpha) to which I added a Diamond VGA card in the
> > internal PCI slot.  This has a S3 Trio64V+ chip.  The intent is to be able
> > to run X over FreeBSD 4.6.2.
> [ ... ]
> > The problem is that syscons can't find the S3 VGA (see the verbose dmesg
> > output below).  Maybe this is related to what the SRM leaves behind, but I
> > doubt it.  The kernel here is the GENERIC that came on the 4.6.2 CD I got
> > from the BSD mall.
> [ ... ]
> >  pci0: <S3 Trio graphics accelerator> (vendor=0x5333, dev=0x8811) at 12.0 irq 15
> [ ... ]
> >  sc0: no video adapter found.
> >  sc0: <System console> failed to probe on isa0
> 
> OK.  Probably it's because the syscons code forces vid_register()
> in the case that it's possible to use it as a console, and that
> calls probe_adapters(), which ends up returning noting, because
> the PCI bus hasn't been probed yet, and there's no BIOS knowledge
> of an adapter.  Basically, this means that "vga_init_done" is true,
> and so it doesn't get reprobed later.
> 
> The fix is to make the syscons driver inelegible as a console
> device, which should avoid the early probe, at which point the
> later probe should find it successfully, since it doesn't have
> a failed probe that won't be repeated.
> 
> Alternately, you can hack probe_agapters() in /sys/dev/fb/vga.c:
> 
> #if !defined(VGS_NO_BIOS)
>     /* do this test only once */
>     if (vga_init_done)
>         return biosadapters;
> #endif
> 
> and this will probably work for your case, but is not something
> that can be committed because it would screw up part of the time.
> 
> If you want a permanent fix, you'll want to only set vgs_init_done
> to TRUE in the case that it's found.  This *might* work satisfactorily
> (it doesn't puke out my x86 box):
> 
>     /* do this test only once */
>     if (vga_init_done && biosadapters > 0)
>         return biosadapters;
> 
> ...it causes the probe to repeat, even if it was attempted previously,
> so long as it failed previously.  IT's ugly, but if you have no console,
> you probably don't care.
> 
> Really, the console code wants to be able to be attached at any
> point in the boot process, so that your console messages end up
> going to "the no place", until the console is attached to syscons.
> 
> That's a lot of work, and it would be very hard to get past an
> x86-centric commit review, so I don't recommend it.
> 
> -- Terry
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-alpha" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.44.0211150918260.345064-100000>