[PATCH] Implement Symbol-Based Video Driver Autoloading
pcpa at mandriva.com.br
pcpa at mandriva.com.br
Fri Nov 16 07:49:46 PST 2007
Quoting Daniel Stone <daniel at fooishbar.org>:
> On Thu, Nov 15, 2007 at 08:26:02PM -0500, David Nusinow wrote:
>> On Thu, Nov 15, 2007 at 03:47:21AM -0200, pcpa at mandriva.com.br wrote:
>> > Oh, and, I am not sure, but I believe, drivers should not have
>> full access
>> > to X Server symbols. But since they all run in the same process,
>> > some kind of "ioctl like interface" probably would be pointless.
>> At least a
>> > fix for xf86ansic would also be desirable, i.e. not have some
>> modules linked
>> > to use directly libc functions, and others to use the xf86<libc-symbol>,
>> > and/or mixing them. For open source drivers, this probably isn't a
>> > but full access to closed source drivers should not be available,
>> i.e. a video
>> > driver connecting to the internet, reading/writing from/to random files,
>> > starting threads, messing with signals or kernel modules...
>> I'm not sure this is worth doing. Having the drivers as part of the running
>> process works fine for things like the linux kernel. And as more of the
>> drivers move in to the kernel itself, I think the arguments for doing this
>> become less and less worthwhile.
> ajax has already been doing this with _X_EXPORT.
This is kind of a can of worms. The only explicitly "hidden" functions I
see in a grep are in os/rpcauth.c and loader lookup tables that are close
to useless now, but should be a list of symbols that modules could access.
Maybe all server symbols should be hidden/private/internal by default, i.e.
for gcc, compile with -fvisibility=<value> (using aclocal visibility.m4
preferred), and then explicitly export the proper symbols.
Probably, the server should also refuse or be very verbose about allowing
exceptions (more than the -ignoreABI option) to load modules that aren't know
to have been compiled with proper header files, like the Linux kernel does.
Other fancy features could also be used, like sections of initialization
data that can be discarded later, etc.
A command like "for f in `find /usr/lib/xorg/modules/ -name \*.so`; do echo
$f; ldd $f; done|less" should alo probably only list loader run time
dependencies, and the server define/wrap what libc (or other system libraries)
symbols are available. This could/should be an option so that vendors
need to make a binary only module for every supported distro, i.e. make only
one that works on all Linux distros, and depending on how it is done, on other
operating systems in the same arch (easier said then done; but I understand it
as the initial loader goal).
More information about the xorg