From owner-freebsd-hackers Tue Dec 12 13:31: 8 2000 From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 12 13:31:05 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from smtp05.primenet.com (smtp05.primenet.com [206.165.6.135]) by hub.freebsd.org (Postfix) with ESMTP id 4D29537B402 for ; Tue, 12 Dec 2000 13:31:04 -0800 (PST) Received: (from daemon@localhost) by smtp05.primenet.com (8.9.3/8.9.3) id OAA16856 for ; Tue, 12 Dec 2000 14:27:32 -0700 (MST) Received: from 208-48-172-178.nas-2.scf.primenet.com(208.48.172.178), claiming to be "max" via SMTP by smtp05.primenet.com, id smtpdAAAuXay2G; Tue Dec 12 14:27:24 2000 Reply-To: From: "Steve Shoecraft" To: Subject: RE: Accessing the Video Bios on a PCI card?? (vm_map ?) Date: Tue, 12 Dec 2000 14:32:49 -0700 Message-ID: <000001c06483$1479e4c0$b2ac30d0@max.home.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal In-Reply-To: <000401c0641a$2b382140$9a3184ce@max.home.org> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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