Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2000 14:32:49 -0700
From:      "Steve Shoecraft" <sshoecraft@1-link.net>
To:        <freebsd-hackers@freebsd.org>
Subject:   RE: Accessing the Video Bios on a PCI card?? (vm_map ?)
Message-ID:  <000001c06483$1479e4c0$b2ac30d0@max.home.org>
In-Reply-To: <000401c0641a$2b382140$9a3184ce@max.home.org>

next in thread | previous in thread | raw e-mail | index | archive | help

	Ok.  I've been looking at the kernel source for a bit, and come up with a
couple ideas how to do this.  I wanted to run it by you guys to see if this
is the "right way."

	I'm guessing I'm gonna need to write the address where I WANT the bios to
show up in the PCIR_BIOS register.  The problem is, how do I get that addr.
Do I:

		/* Alloc 4k region */
		/* XXX should I use kmem_alloc_nofault? */
		addr = kmem_alloc(kernel_map, PAGE_SIZE);

		/* Get physical addr */
		/* XXX do I need this? */
		paddr = vtophys(addr);

		/* Enable BIOS */
		pci_write_config(dev, PCIR_BIOS, paddr | PCIM_BIOS_ENABLE);

	Will this work?  I haven't tried it yet, but it sure looks like it's the
wrong way to do it.  It seems like as soon as I access the addr, i.e.:

		value = *addr;

	it will cause a fault to occur and have a page of physical memory attached
(& zero'd ??) and my read will return from the memory, instead of the bios.
Is that what will happen here?

- Steve

-----Original Message-----
From: owner-freebsd-hackers@FreeBSD.ORG
[mailto:owner-freebsd-hackers@FreeBSD.ORG]On Behalf Of Steve Shoecraft
Sent: Tuesday, December 12, 2000 2:02 AM
To: freebsd-hackers@freebsd.org
Subject: Accessing the Video Bios on a PCI card??



	I have a ATI rage 128 all-in-blunder agp card.  I'm currently writing a
driver for video capture.  I got everything to work properly so far, but I'm
using "plugged-in" values for certain things that REQUIRE I get them from
the video bios on the card (multimedia table, tv-out table, etc.).  The
sample source that ATI doles out directly accesses the 0xC000-0xC800 region
to get the info (the example is a linux implementation).  This will only
work if the card is the primary adapter.  If it's not, another way must be
found.  No matter what, I still don't want to do that, as it seems "cheesy."

	I've tried using the pci_read_config(dev, PCIR_BIOS, 4) command to get the
base of the card's video bios, but it comes up empty.

	Ok, so, how do I get the address of the video bios of the card?  I've tried
writing to the PCIR_BIOS register with the BIOS_ENABLE bit, but I'm pretty
sure that's to SET the (physical) address of the video bios.  I need to GET
it.  Any ideas?  Suggestions?

- Steve



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



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?000001c06483$1479e4c0$b2ac30d0>