[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Wed, Dec 15, 1999 at 03:25:53PM +1100, Peter Wang wrote:
> Would it be possible to move the `__al_linux_init_console' call (and
> related stuff) out of the Linux system driver, and into the specific
> graphics drivers that need them?
>
> The reason I ask is because the SVGAlib and GGI drivers both do this
> bit of work themselves (finding the tty fd, etc.) and I think Allegro
> is conflicting with them.
I sort of guessed this would be the case... But that routine
really does very little, if the game is run from a real vt. If
the game isn't run from a real vt then this routine might need
root privileges, which makes it desirable to run it from
`allegro_init' rather than later on. Where possible it's nice
to undo all the locks before the user gets a chance to throw
away the privileges. :)
> If it's feasible I will do the work, but I'd need a list of drivers
> (just VGA and fbcon?) and subsystems (vga helpers, VT switching?)
> which depend on the current behavior. Otherwise I'll figure out some
> ugly work arounds.
All the drivers apart from GGI and SVGAlib will depend upon
this, along with the keyboard driver. If we rely on the
keyboard being initialised after the graphics mode is set then
there's no problem here -- you can make a special keyboard
driver that chains to SVGAlib or GGI. But Allegro's API doesn't
assure that.
You're *almost* talking about a separate system driver for
SVGAlib and GGI here. :) That might not be such a bad idea, if
we can reliably detect these things at initialisation and don't
need to wait until the graphics mode gets set. But I don't
think we can -- fbcon is such a safe system it's much better to
use that when it's available. If these things go into a
separate system driver then it would really have to be
secondary, so only detected if it's explicitly asked for or,
better, specified in the config file.
It is possible to unhook from the tty we were allocated,
pointing the fd somewhere else while SVGAlib initialises, and
then, if we can find out what SVGAlib's fd for the console is,
we can dup2 that to our original fd. Then the rest of our
routines *might* work. This might be a better solution.
George