LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How are video drivers loaded after startx is initiated (https://www.linuxquestions.org/questions/linux-software-2/how-are-video-drivers-loaded-after-startx-is-initiated-573703/)

Defunct 07-31-2007 12:07 PM

How are video drivers loaded after startx is initiated
 
Hi everyone,

I am trying to understand in depth how video drivers are loaded after startx is initiated. I am a software engineering intern at company that primarily writes special video drivers for Windows. They do have a few drivers in linux but no one here seems to know much about them (I have no idea how they were wrote in the first place). I have done my modifications to the linux driver that they have me working on, but now I have really messed some stuff up and need to use gdb to debug. I have to either attach gdb to a running pid or I have to give it a program name that is started. I have neither of these, and I have no idea how my driver is getting loaded (When I do an lsmod or ps -A I do not see the name of the program). Could someone explain in detail/give a link on how a video module is loaded when startx is entered? I understand that my driver could be loaded very differently than from how a standard module is loaded (like nvidia or ati), but I think a general understanding would help me a lot. Please move this thread if it is in the wrong place.

Thanks,
Matt

jay73 08-01-2007 09:29 AM

http://www.xml.com/ldd/chapter/book/

This is the free version of the second edition that covers the 2.4 kernel. I believe that the most recent edition is only available in paper form. Chapter 11 seems to be the most relevant.

Defunct 08-01-2007 11:12 AM

I actually have that book and it has been some help. After greping around in the xfree86 code I found the function pointer which is the entry point to the driver I am working on. So, I am hoping to begin debugging today. Thanks for your help though.

studioj 08-01-2007 02:19 PM

yea back in xfree3 there were actually different binaries for x instead of loadable drivers.
starting with xfree4 they went to a built in runtime dynamic loader for video drivers.
then X11R7.0 switched to a libdl based module loader instead of implementing its own ELF loading and parsing mechanism. I think there are still some core calls that are nothing more than dlopen or some extended version of dlopen. certainly before X11R7 all it was doing was dlopen i think.


All times are GMT -5. The time now is 05:42 PM.