From owner-freebsd-alpha Sat Oct 14 15:21:38 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from po6.andrew.cmu.edu (PO6.ANDREW.CMU.EDU [128.2.10.106]) by hub.freebsd.org (Postfix) with ESMTP id BC01F37B670 for ; Sat, 14 Oct 2000 15:21:30 -0700 (PDT) Received: (from postman@localhost) by po6.andrew.cmu.edu (8.9.3/8.9.3) id SAA03645; Sat, 14 Oct 2000 18:21:25 -0400 (EDT) Received: via switchmail; Sat, 14 Oct 2000 18:21:25 -0400 (EDT) Received: from unix15.andrew.cmu.edu via qmail ID ; Sat, 14 Oct 2000 18:20:28 -0400 (EDT) Received: from unix15.andrew.cmu.edu via qmail ID ; Sat, 14 Oct 2000 18:20:27 -0400 (EDT) Received: from mms.4.60.May..8.2000.10.35.10.sun4.57.EzMail.2.0.CUILIB.3.45.SNAP.NOT.LINKED.unix15.andrew.cmu.edu.sun4x.57 via MS.5.6.unix15.andrew.cmu.edu.sun4_57; Sat, 14 Oct 2000 18:20:27 -0400 (EDT) Message-ID: Date: Sat, 14 Oct 2000 18:20:27 -0400 (EDT) From: Thomas Valentino Crimi To: "Andrew M. Miklic" Subject: Re: TGA and PCI Cc: freebsd-alpha@freebsd.org In-Reply-To: <39E87745.596865AC@attglobal.net> References: <39E87745.596865AC@attglobal.net> Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I tried to write a TGA driver as well although but never finished it. At the point I left it the driver registered itself with syscons and drew a pattern on the screen. I'd be more than happy to send you the source if it can help any. From reading the code the driver is both registed as a PCI device and as a VIDEO_DRIVER, the PCI probe and attach functions are called first. In tga_pci_probe I use pci_get_vendor/device on the device_t structure passed. tga_pci_attach maps the video car into memory using: res = bus_alloc_resource(dev, SYS_RES_MEMORY, ®, 0, ~0, 1, RF_ACTIVE | PCI_RF_DENSE); where reg = PCIR_MAPS and puts necessary information in tga_adapter[i], an array of video_adapter_t, and calls vidregister() on it. So, before anything happens with sccnattach all pci configuration data has been read. If the card didn't sucessfully probe and attach the vi_probe_t or backdoor function would never find it. syscons eventually calls the backdoor fucnction which checks that something has been set in tga_adapters[] and calls the card initialization function on it, which find out which version of TGA card is present, sets up the resolution and draws the pattern. Best of luck finishing up the driver -- Tom To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message