PCI/BIOS/int10 handling in X.org

Jon Smirl jonsmirl at gmail.com
Fri Jul 15 19:36:12 PDT 2005


On 7/15/05, Thomas Winischhofer <thomas at winischhofer.net> wrote:
> >               last_image = readb(pds + 21) & 0x80;
> >               /* this length is reliable */
> 
> 
> No, it's not. Whatever whoever says.

There are two size bytes. The other one is the third byte in the ROM:
55 AA size
That's the one that is unreliable. 

> >               image += readw(pds + 16) * 512;
> >       } while (!last_image);
> >
> >	*size = image - rom;
> 
> At least check that the size returned is not bigger than the
> (preliminaray) size you submitted to ioremap.

Is this what you are suggesting?

	*size = min(image - rom, *size);

That would be a messed up piece of hardware, it is reporting its ROM
size larger than its PCI resource window. I don't think you could boot
a card messed up like that as the primary video device, it would fail
checks in the system BIOS.

But I have seen the other case of a card reporting a PCI resource
window much larger than the actual ROM size. That's why the size code
is there, to get the smaller size in case the ROM has to be copied.

I can add the code, it won't hurt anything.

-- 
Jon Smirl
jonsmirl at gmail.com



More information about the xorg mailing list