My apologies if this information is otherwise available in other threads/channels. I want to make this information available regarding my particular experience in case it helps others.
I'm running Slackware 13.1. I have an nvidia Ti4200 video card which falls into nvidia's legacy driver category. I'm glad that nvidia still supports it. I run a custom compiled kernel. Generally, I download, configure and compile a new kernel whenever I see it available on kernel.org. I prefer not to use the included nv driver, but rather install my own nvidia kernel module using nvidia's installer which does taint the kernel but nvidia's drivers have been great work so far.
I've had two problems with the nvidia legacy drivers version 96.43.19 lately.
The first problem was an install failure related to kernel locking. I can't remember exactly which kernel upgrade prompted this issue, but it was a few kernel releases ago (2.6 series). It might be a crude solution, and I don't know what ill effects it might cause, but I located an #include <linux/smp_lock.h> in usr/src/nv/nv-linux.h. What if I comment it out? Installed fine after that and it seems to be working fine on my twinview setup using my TV as a second monitor.
The second problem came after installing kernel 3.0. Another nvidia legacy install failure. This one I had some help with. I'd seen a post on
another site regarding patching for kernel 3.0 release candidate. The patch didn't seem to work for the nvidia legacy source I had downloaded (96.43.19), but I was able to figure it out and get it to work. This one just involved some modification to kernel version testing in usr/src/nv/conftest.sh and another modification to usr/src/nv/nv-linux.h.
I made a patch file for the nvidia legacy drivers that I'm running (96.43.19). The patch file is attached. The patch file is also included below inline using "code" tags. The patch file addresses the kernel lock issue as well as the kernel version 3.0 issue.
To properly patch the driver, the driver must be extracted from the monolithic install file. This is easy though.
Assuming that the downloaded file is:
NVIDIA-Linux-x86-96.43.19-pkg1.run
Then just chmod a+x that file to make it executable:
bob@Moses:~$ chmod a+x NVIDIA-Linux-x86-96.43.19-pkg1
Then invoke that file with --extract-only as a command line option:
bob@Moses:~$ NVIDIA-Linux-x86-96.43.19-pkg1.run --extract-only
Once I "cd" into the newly extracted directory:
bob@Moses:~$ cd NVIDIA-Linux-x86-96.43.19-pkg1
I see the following:
bob@Moses:~/NVIDIA-Linux-x86-96.43.19-pkg1$ ls -aldh *
-r--r--r-- 1 bob users 5.6K 2010-10-27 22:23 LICENSE
-rwxr-xr-x 1 bob users 222K 2010-10-27 22:23 nvidia-installer*
-rw-r--r-- 1 bob users 7.9K 2010-10-27 22:47 pkg-history.txt
drwxr-xr-x 8 bob users 192 2010-10-27 22:23 usr/
Good stuff. Now we are ready to patch the source files. The patch file I made is designed to be run from the NVIDIA-Linux-x86-96.43.19-pkg1 directory with something like this:
bob@Moses:~/NVIDIA-Linux-x86-96.43.19-pkg1$ patch -p0 < /archive4/NVIDIA-Linux-x86-96.43.19-pkg1-Slackware-13.1-kernel-3.0.patch.txt (my patch file was saved to /archive4).
After that, just "su" (or "su -") to root and run the nvidia-installer executable located in the NVIDIA-Linux-x86-96.43.19-pkg1 directory.
All the patch does is comment out an smp_lock.h reference in nv-linux.h, modifies another line in nv-linux.h and also modifies a line in conftest.sh. The patch is pretty self explanatory.
I'm currently running the nvidia legacy driver kernel module on my Slackware 13.1 install running custom compiled 3.0 kernel with twinview enabled so I can watch movies on my TV. These modifications seem to make the nvidia legacy kernel driver as useful as it has ever been. I'm glad that nvidia still supports older cards like my Ti4200.
NVIDIA-Linux-x86-96.43.19-pkg1-Slackware-13.1-kernel-3.0.patch.txt:
Code:
--- usr/src/nv/conftest.sh.orig 2011-07-30 12:24:39.770031044 -0400
+++ usr/src/nv/conftest.sh 2011-07-30 12:25:49.059315428 -0400
@@ -77,7 +77,7 @@
build_cflags() {
ARCH=`uname -m | sed -e 's/i.86/i386/'`
- BASE_CFLAGS="-D__KERNEL__ \
+ BASE_CFLAGS="-O2 -D__KERNEL__ \
-DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
-nostdinc -isystem $ISYSTEM"
--- usr/src/nv/nv-linux.h.orig 2011-07-30 12:27:09.341819608 -0400
+++ usr/src/nv/nv-linux.h 2011-07-30 12:27:28.854951411 -0400
@@ -30,7 +30,7 @@
# define KERNEL_2_4
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
# error This driver does not support 2.5 kernels!
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
# define KERNEL_2_6
#else
# error This driver does not support development kernels!
@@ -80,7 +80,7 @@
#if !defined(KERNEL_2_4)
#include <linux/sched.h> /* suser(), capable() replacement */
#include <linux/moduleparam.h> /* module_param() */
-#include <linux/smp_lock.h> /* kernel_locked */
+//#include <linux/smp_lock.h> /* kernel_locked */
#include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
#include <asm/kmap_types.h> /* page table entry lookup */
#endif