Re: use video ram as system ram ?

From: Helge Hafting (helgehaf@idb.hist.no)
Date: Thu Apr 06 2000 - 02:38:35 EST


> The video RAM reported on video boards as "2Mb, 4Mb,... NMb.", is
> not RAM that can be directly accessed via ISA or PCI et all, buses.
> It's SRAM mappable to the Video device chip, and assessible only
> through a port from the "outside". It isn't even the "Screen regen buffer"
> you see at 0xB8000 which is typically only 16 kb. To access that RAM, you
> have to enable "graphics mode" and then it's available as 64k pages
> from 0xA0000 by writing to page registers through a port. This is only
> 64k per page and the kernel has no way of "knowing" when to change the

Most new cards have all the video memory directly acessible via PCI (or
AGP)
busses. They have the ugly 0xA0000 64k-block stuff too, but that's only
for
backward compatibility with VGA. Most cards support a
directly accessible linear framebuffer.

And there is a hack for those old cards only acessible in 64k chunks:
Set up a linear mapping in the page tables, but mark all pages except
the
ones in the current 64k buffer as "not present" Programs can now acess
this
"linear framebuffer", and the kernel will simply get a page fault
whenever
a program steps outside the 64k block. The swapper will then change
block on the video card, and mark the new pages present and the old ones
gone. Then the process is restarted. An old trick that simplifies
programs
a lot, don't know if it is done under linux though. It is usually not
needed any more, thanks to pci/agp buses with enough adress space for
any video card.

Helge Hafting

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:16 EST