Compiling a Device Driver Module


In many cases drivers compiled for similar kernel versions will work. Pre-compiled modules in the form of RPMS for popular distributions are frequently available. If a pre-compiled module is not available; you'll have to compile one from the driver source code, or the source code RPM (SRPM).
* Verify that the source code for your current kernel version is installed.
* If you don't have a /usr/include/linux/version.h file, do cd /usr/src/linux; make include/linux/version.h
* Copy the driver source code to a source directory
* Compile the file using the compile-command at the bottom of the driver source file. If a compile-command is not there use the following compile command:

gcc -DMODULE -D__KERNEL__ -O6 -c driver.c

* As 'root', test the module by doing "insmod driver.o".
* Install the driver module in the proper location for your distribution. This is usually /lib/modules/kernel-version/net/driver.o. The command to do this is
install -m 644 driver.o /lib/modules/`uname -r`/net/


Testing the New Module

As 'root', load the module using "insmod driver.o" and execute the appropriate 'route add -net ...' for your local network.
If the networking works correctly, add the module to your system configuration. For Slackware and most other systems, add the insmod command to /etc/rc.d/rc.inet1 or /etc/rc.d/rc.local. RedHat users should add the insmod line to /etc/rc.d/rc.modules or copy driver.o to /lib/modules/`uname -r`/net/ and add the following line to /etc/conf.modules:

alias eth0 driver

Consider the following command "/sbin/insmod driver.o full_duplex=1,0,1". This command sets the full_duplex flag for the first and third cards of this type.
To set module parameters when the module is loaded automatically, add the following line to /etc/conf.modules

alias eth0 driver

options driver full_duplex=1,0,1 debug=0

....to be contd. ;)


Page copy protected against web site content infringement by Copyscape

OpenSuSE 10.3 REVIEW

I switch operating systems like any other guy switches his underpants. If today I write/review FreeBSD, tomorrow I might write about Ubuntu. I am an OS lover, so it was very important for me to find an operating system which I can love and develop at the same time! Thanks to Novell's brilliant effort: OpenSuSE (pronounced as Open SooSaa).
My memory with Novell goes back to the time when I first installed SuSE 9(Enterprise Desktop) on my Desktop with minimal requirements. Now I work on my Lenovo 3000 N100 laptop. I have tried several flavors of linux on my notebook but none satisfied my needs so far. I began with Red Hat 9. It was sort of old so I shifted to Fedora Project. I installed Fedora core 4 but again my sound card and the network card was creating dubious issues. After fedora I switched to Mandrake. Mandrake 10.1 was enticing with a nice KDE and GNOME env, but again, it didn't recognize my Wireless card Intel Pro 802.11 a/b/g. I switched to RHEL4 (Red Hat Enterprise Linux) in a hope that this enterprise version be something different and would satisfy my needs, rather it added to my disappointment...This time my touch pad (Synaptics) was creating problems. [ As soon as I place my finger on the touch pad, it sort of traveled the whole screen randomly even when my finger was static on the touchpad]. I completely lost hopes after this.
A week ago one of my Linux enthusiast friend gave me a downloaded copy of OpenSuSE 10.3. Voila! it worked. Yes, finally I found a complete system for my machine. I installed the same copy on my desktop (PIII 1.13 GHz with 384 M RAM). Bravo!! no issues with memory management. With KDE 4 and Yast2, this OS can handle anything you want. Hardware probing is not a problem either, no issues with Wireless card, Network card or the touchpad. The website of OpenSuSE offers any user to search for the software repositories and '1-click install' feature. Extensive online and offline documentation is also available for those who are new to Linux or shifting from Windows to Linux. Apart from this, an integrated Virtualization software to try other Operating systems is also included in OpenSuSE 10.3. I would recommend OpenSuSE to OS enthusiasts right away. Seriously, I was quite troubled with linux installations on my laptop as my projects require kernel dev. Now with this OS, all's well and running ;)

Wait till next post when I write more about this legendary OS I am in love with!

Page copy protected against web site content infringement by Copyscape