On Sat, Dec 17, 2011 at 04:44:52PM +0000, Julian Pidancet wrote:
Also, I implemented this vbe driver skeleton with an interface which could be as generic as possible to allow to implement several different drivers. But I am actually wondering now what would be the best way for several drivers to share the same interface in terms of code.
That is an interesting issue. The current lgpl seems to use two schemes - the bochs vbe interface is inline with the standard vga interface and uses "#ifdef VBE" guards - the cirrus interface takes the int10 vector, checks for the calls it needs to handle and then calls the standard vga interface for the rest.
A couple of years back, a geode interface was written for seabios - see the thread at (look for the code in attachments):
http://www.coreboot.org/pipermail/coreboot/2009-August/051624.html
I'm don't recall why the above didn't get merged. The Geode interface only needed to override the legacy timing parameter table and be called during init.
I'm not sure which scheme makes the most sense. I could see using the "cirrus" scheme - each hardware type defines its own "handle_10" and "vga_post" in a file dedicated to that hardware, which then check for hardware specific functions and call "library" code for the standard stuff. However, I'm not sure how much code duplication there would be for things like the VBE calls which seem to contain a mix of standard info and hardware specific info.
-Kevin
On Wed, Dec 21, 2011 at 5:39 PM, Kevin O'Connor kevin@koconnor.net wrote:
I'm not sure which scheme makes the most sense. I could see using the "cirrus" scheme - each hardware type defines its own "handle_10" and "vga_post" in a file dedicated to that hardware, which then check for hardware specific functions and call "library" code for the standard stuff. However, I'm not sure how much code duplication there would be for things like the VBE calls which seem to contain a mix of standard info and hardware specific info.
Happy new year,
I havn't studied the cirrus code yet, but the part which implements the VBE interface should be quite simillar from one driver to another, so I don't think it is necessary to let every hardware type redefine its own int10 handler, at least for the vesa part.
Julian.