[Open-graphics] From PCI to VGA registers

Anton Soppelsa anton.soppelsa at igi.cnr.it
Wed Sep 5 10:05:54 EDT 2007


Hi all,

by mistake, a week ago, I sent the following mail to Timothy instead of 
the entire list. I've been asked to repost it so all the community can 
benefit from it. Despite I don't think the community will benefit that 
much reading my silly questions, :) I re-post it now. Please consider, 
however, that Timothy has already very well answered to my questions. 
Timothy's answer can be found at the end of the mail.

Cheers,
  Anton

Timothy Normand Miller wrote:
> On 8/10/07, Michael Meeuwisse <mickeymeeuw at gmail.com> wrote:
>
>   
>> I don't completely get it yet. The main BIOS will write 0xFFFFFFFF to
>> it on boot, we set it to how much memory we want, and then the BIOS
>> will set a particular address in it which is then where we're
>> 'mapped'? That's how I understood section 6.2.5.1 of spec 2.2, which
>> sounds like these registers have a dual purpose. Am I right?
>>     
>
> Yeah, sorta.  The BARs don't allow all bits to get written.  Let me
> give you an example.  Let's say that the aperture is going to be 65536
> bytes.  (This is a demand made by the PCI target.)  The BIOS will
> write 0xFFFFFFFF, but when it reads the register back, it'll get
> 0xFFFF0000 (the lowest 2 bits may not be zero).  Based on that, the
> BIOS figures out that it needs a 64KiB area in address space.  These
> memory spaces are always 2**N in size, and they also have to be placed
> on 2**N boundaries.  The bits that read back 0 can never be anything
> else.  The BIOS finds an aligned 64KiB area and writes the address of
> that into the BAR.  Done.
>
>   
...
Hi, all

Sorry for the simple question, but I get a little bit confused when you 
talk about BIOS or VGA BIOS doing something. I work with a Motorola 
Single Board Computer (MVME5500) built around a PowerPC CPU, a Marvell 
GT-64260B host bridge and a couple of PCI buses, using both the VxWorks 
and Linux Operative Systems. I know that after power on or some 
particular exceptions, the CPU starts executing fetching at a particular 
address. So the first code executed by the CPU after reset has to be 
placed at that address. From there one can configure all the system 
(MMU, L3 Cache, Host Bridge, PCI Bridges and so) how he/she wants. Of 
course this works because the Host Bridge is in a predefined default 
state at power on and the particular address gets somehow hard-wired to 
the FLASH storing the boot loader.

* Isn't the same for an x86 processor?

* When you say that the BIOS does something, do you mean that the CPU 
executes a sequence of instructions in order to initialise the board, or 
that in the system there is an entity which control how and at what time 
the system components are initialised, including the CPU itself?

* I taught BIOS were more a static sequence of code than a sequential 
machine. Did they became so complex to execute instructions by their own 
without me knowing nothing about ? :)

* From the discussion going on here, it looks like initialising the 
video card is not straightforward at all. Is a PCI VGA card more 
difficult to set up that any other types of PCI cards?

Cheers,

  Anton


*****************************************************************************

You didn't post to the list.  Did you mean to?  If so, please do
forward your email and mine to the list so others can benefit from it.

On 8/31/07, Anton Soppelsa <anton.soppelsa at igi.cnr.it> wrote:

> > particular exceptions, the CPU starts executing fetching at a particular
> > address. So the first code executed by the CPU after reset has to be
> >
> > * Isn't the same for an x86 processor?
>   

Yes.


> > * When you say that the BIOS does something, do you mean that the CPU
> > executes a sequence of instructions in order to initialise the board, or
> > that in the system there is an entity which control how and at what time
> > the system components are initialised, including the CPU itself?
>   

The CPU executes some code in ROM, and we call that code the BIOS.
This is similar to saying that Firefox does something, while it would
be perhaps more precise to say that the CPU is executing Firefox.


> > * I taught BIOS were more a static sequence of code than a sequential
> > machine. Did they became so complex to execute instructions by their own
> > without me knowing nothing about ?  :) 
>   

No.  Just a chunk of code in ROM.


> > * From the discussion going on here, it looks like initialising the
> > video card is not straightforward at all. Is a PCI VGA card more
> > difficult to set up that any other types of PCI cards?
>   

It's totally straightforward, if you have proper documentation.  The
VGA BIOS, also, is just code in ROM that the CPU executes.  It is
called from the system BIOS at an appropriate time.  VGA is only made
complex by the fact that PC BIOS and software assume certain specific
capabilities of the graphics card.

-- Timothy Normand Miller http://www.cse.ohio-state.edu/~millerti Open 
Graphics Project

-------------- next part --------------
A non-text attachment was scrubbed...
Name: anton.soppelsa.vcf
Type: text/x-vcard
Size: 251 bytes
Desc: not available
Url : http://lists.duskglow.com/open-graphics/attachments/20070905/bd6ac164/anton.soppelsa.vcf


More information about the Open-graphics mailing list