Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2000 13:58:40 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        sshoecraft@1-link.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Accessing the Video Bios on a PCI card?? (vm_map ?) 
Message-ID:  <200012122158.eBCLwe305252@mass.osd.bsdi.com>
In-Reply-To: Your message of "Tue, 12 Dec 2000 14:32:49 MST." <000001c06483$1479e4c0$b2ac30d0@max.home.org> 

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

(please wrap your messages in a sane fashion!)

> 	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:

This is mostly correct, however the system BIOS should have done this for 
you already.  Is this card your primary video card?

> 	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.:

No, you should not do it like that.  The problem is depressingly difficult
to resolve "cleanly".

If you just want to rummage through the BIOS, and don't actually want to 
call any code in it, it's a little simpler.

Start off by writing 0xfffffffe to the bios base address register.  Then 
read it back and note that what you'll get is an address mask which tells 
you how big the ROM is.  (You can convert to a size by flipping the bits 
and adding 1).

Find a free memory area (start off by just guessing; later you'll need to 
use the resource manager to actually find a block) and write the physical 
base address of this area into the bios base address register, 
remembering to set the LSB to enable the decoder.  Also make sure that 
the memory enable bit is set in the command register.

Then use pmap_mapdev() to map that physical range into kernel space.

That should get you going; you can look at the cardbus code to see how to 
find a memory range once you get to that point.  (It's not perfect yet, 
but it works.)

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E




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?200012122158.eBCLwe305252>