On Wed, 5 Nov 2003, Gerhard W. Gruber wrote:

>>nvidia.o is not a kernel module.  It is just a dynamically loaded object
>>file that gets loaded by the XFree86 dynamic loader and called entirely in
>>user mode.  It could have been done as an ordinary .so DLL, but the design
>>objective was to have these work regardless of operating system.  That's
>>why there is a loader built-in to XFree86.
>
>I think I know now where the confusion comes from. There is a kernel module
>for nVidia which you can download at their site and there is also, seemingly,
>a module within XFree86. I suppose the kernel part from nVidia is only there
>for 3D acceleration stuff, right? I looked into what functions this module
>exports but I can't make much of it. Seems mostly to do with register/memory
>access.

There seems to still be some confusion here, let me try to
clarify in more detail:

There are 2 completely different Nvidia video drivers:

1) The open source one that comes with XFree86, as shipped by 
   XFree86.org.  This driver is called the "nv" driver as this is 
   the name you specify for it in the XFree86 X server config 
   file.  The filename of this driver is "nv_drv.o" and this is 
   the XFree86 2D driver which resides in the 
   /usr/X11R6/lib/modules/drivers directory.  This driver is 2D 
   only and does not support 3D acceleration.  It does not have a 
   kernel module associated with it.

2) The proprietary closed source binary only video driver that is 
   provided by Nvidia on their web site.  This driver is called 
   the "nvidia" driver because that is the name you specify for 
   it in the XFree86 X server config file.  The filename of this 
   driver is "nvidia_drv.o" and this is the XFree86 2D driver
   which resides in the /usr/X11R6/lib/modules/drivers directory.
   This driver package also comes with Nvidia's proprietary libGL 
   implementation, libglx module replacement, and Nvidia's 
   proprietary binary only kernel module, as well as a binary 
   blob and small amount of source code glue to relink it for 
   new kernels.  This kernel module resides in the kernel module 
   heirarchy under /lib/modules and is named "nvidia.o".  All of 
   the different parts of the Nvidia driver are proprietary, and
   provide 2D and 3D acceleration, etc.


>>Some drivers DO have kernel modules, to handle the DMA transfers that are
>>necessary for adequate 3D operation.  However, kernel drivers are loaded
>>with insmod.  If you specify a driver name in the Device section of an
>>XF86Config file, it is NOT a kernel driver.  It is a user-mode library.
>
>There is a module which has to be loaded with insmod (or depmod
>if you prefer :) ), so I was wondering what this module is
>exactly doing and how it is related to XFree86.

You never need to kernel modules by hand as the X server will do 
this for you automatically.   When DRI is enabled in the open 
source drivers, and the driver also supports DRI, this will cause 
the X server to use modprobe to load the proper module for that 
card.  Presumeably the Nvidia binary drivers work in a similar 
manner.

Also, whenever one does load kernel modules by hand, using 
modprobe is generally speaking, the preferred method as it 
handles various things automatically.  modprobe is more or less a 
front end to insmod so to speak.

depmod does not load modules, it is ran during boot time, or 
after updating kernel modules and calculates kernel module 
interdependancies.


>>Have you never looked at the XFree86 source code?  You need to do so. 
>>Really.  Much of this would be cleared up.
>
>I had a look at the source code, but the code base for XFree86
>is not exactly small, so I didn't knew where to start.

xc/programs/Xserver/hw/xfree86/drivers

>I looked into the kernel sources and I found some support for
>switching non-standard consoles (meaning non-textmode) which is
>aparently used by XFree86 and others like SVGAlib.

The X server handles saving the current text mode, prior to then 
programming a new video mode itself, and then handles restoring 
the text mode when a VTswitch occurs.


>>If you have a kernel module that you load with insmod, there
>>still needs to be an XFree86 board-specific driver that can
>>talk to that kernel driver.
>
>Yes. That's what I meant. I already looked into the code of
>XFree86 nVidia driver, but this will take some time to figure it
>out. :)

I presume you mean the "nv" driver.


>>    Driver   "nvidia"
>>then XFree86 will load /usr/X11R6/lib/modules/drivers/nvidia_drv.o.  The
>>name of the EnterVT entry point is up to the driver, but it will usually
>>be based on the driver name, just like you said.
>
>The module of XFree86 is nv for nVidia. The proprietary drivers are called
>nvidia. Apparently nVidia open sourced only that small part needed on the side
>of XFree86 and closed source on the kernel part.

No, there are two completely different drivers.  One is "nv" 
which is 2D only as described above, and is open source and 
maintained by Mark Vojkovich at Nvidia.  The other proprietary 
driver does not use the "nv" driver at all, it is a total 
replacement for it, and it is completely proprietary.  There is a 
very small part of it which the source code is available for 
which is not driver related, but which is a glue or shim later to 
glue the Nvidia binary blob to the kernel.  This small bit of 
code is not helpful for video driver authors however, it contains 
no video control bits, just kernel glue.


>>There are documents on DGA in the XFree86 tree, and you can
>>probably find pointers on the XFree86 web site.  As others have
>>said, however, I'm not sure it will help you, because DGA is an
>>application interface that gets called from user-mode.
>
>Even if I can't use DGA directly, the source should provide
>information on how to handle the hardware, so that would help me
>also. I have to take a look at these.

Look at the driver source in XFree86 for foo_dga.c files for 
example stuff.

Hope this helps.  Good luck with your work!

Take care,
TTYL



-- 
Mike A. Harris

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to