From owner-freebsd-hackers  Sat Oct 28  5: 7:10 2000
Delivered-To: freebsd-hackers@freebsd.org
Received: from altos.rsu.ru (altos.rsu.ru [195.208.252.79])
	by hub.freebsd.org (Postfix) with ESMTP id BE30537B479
	for <freebsd-hackers@freebsd.org>; Sat, 28 Oct 2000 05:05:51 -0700 (PDT)
Received: from localhost (os@localhost [127.0.0.1])
	by altos.rsu.ru (8.11.0/8.9.3) with ESMTP id e9SC5b563100
	for <freebsd-hackers@freebsd.org>; Sat, 28 Oct 2000 16:05:41 +0400 (MSD)
Date: Sat, 28 Oct 2000 16:05:37 +0400 (MSD)
From: Oleg Sharoiko <os@rsu.ru>
To: freebsd-hackers@freebsd.org
Subject: Problem with 2 video cards: /src/sys/pci.c code question
Message-ID: <Pine.BSF.4.21.0010281539460.60115-100000@altos.rsu.ru>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-freebsd-hackers@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

Hello!

I've just tried to install second video card into Intel L440GX+ based box
running FreeBSD and this broke the system: the screen output is messed (even
during device probing), some characters are not printed, scrolling doesn't
work well and after some short time it dies with only 'reset' key working.

I also noticed that kernel.GENERIC from 4.1-RELEASE works fine. I tried to
compile different versions of kernel and found that my problem caused by the
following change in src/sys/pci/pci.c (between 2000-09-02 and 2000-09-03):

<  * $FreeBSD: src/sys/pci/pci.c,v 1.141.2.2 2000/07/04 01:35:10 mjacob Exp $
---
>  * $FreeBSD: src/sys/pci/pci.c,v 1.141.2.3 2000/09/01 23:29:34 msmith Exp $
1082,1085c1082,1089
< 	if (type == SYS_RES_IOPORT && !pci_porten(cfg))
< 		return 1;
< 	if (type == SYS_RES_MEMORY && !pci_memen(cfg))
< 		return 1;
---
> 	if (type == SYS_RES_IOPORT && !pci_porten(cfg)) {
> 		cfg->cmdreg |= PCIM_CMD_PORTEN;
> 		pci_cfgwrite(cfg, PCIR_COMMAND, cfg->cmdreg, 2);
> 	}
> 	if (type == SYS_RES_MEMORY && !pci_memen(cfg)) {
> 		cfg->cmdreg |= PCIM_CMD_MEMEN;
> 		pci_cfgwrite(cfg, PCIR_COMMAND, cfg->cmdreg, 2);
> 	}

I've looked into the log and found this
----------------------------
revision 1.141.2.3
date: 2000/09/01 23:29:34;  author: msmith;  state: Exp;  lines: +9 -5
MFC: fix up botched PCI configuration by the BIOS in the case where a
resource has been allocated but its class is not marked as enabled
in the command register.
----------------------------

So I'm wondering is this a bug or I should by some means disable first
card. There're no any jumpers or bios options to disable video card. I suppose
that kernel turns on the built-in video adapter and it conflicts with the one
I've plugged in. I don't have strong skills in PCI programming so I'm asking
for your help.

Please CC: replies to my e-mail. I would greatly appreciate that and I hope
to here your replies soon.

-- 
Oleg Sharoiko.
Software and Network Engineer
Computer Center of Rostov State University.



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