Skip to Content.
Sympa Menu

baslinux - Re: [BL] ethernet problem

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Sindi Keesan <keesan AT iamjlamb.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] ethernet problem
  • Date: Sun, 13 Jun 2004 23:30:21 -0400 (EDT)

> > ># You may specify a kernel with the following variables.
> > ># KERN_INCLUDE The include directory for the target kernel.
> > ># MODULEDIR The directory where netdriver modules should be
> > >installed.
> >
> > KERN_INCLUDE=/usr/src/linux-2.2.16/include
> > MODULEDIR=/lib/modules/2.2.16/misc
> >
> > Cheers,
> > Steven
>
> Thanks, Steven. Do I need to install ALL of the kernel source or just the
> kernel headers for 2.2.16 (which I think are in that /include directory)?
>
> Sindi
>

At the scyld site there are also instructions on how to compile modules
using the provided source code. Here is an extract from that page, and I
do need to install the entire kernel source code, apparently. Ugh. There
is no mention below of needing to use the Makefile that is in the network
directory along with the driver source code.


This site is for PCI fast ethernet cards (the slower ones seem to be
already available for SW71).

[12]Network Drivers
[13]Network Driver Updates
[14]Gigabit Ethernet - Hamachi
[15]Gigabit Ethernet - Yellowfin
[16]Tulip NIC Architecture
[17]3Com Vortex Ethercards
[18]Intel PCI EEPro 100 Series
[19]SMSC "Epic" Series
[20]RealTek RTL8139
[21]Other Linux PCI Drivers
[22]PCI NE2000 Cards
[23]3Com 3c515
[24]3Com EtherLink III Series
[25]RTL8002/RTL8012 Driver
[26]Tulip Driver Development
[27]Tulip Media
[28]Ethercard Diagnostics
[29]EtherLink III Series Setup
[30]Wake on LAN under Linux
[31]Atlantic Setup
[32]MII Transceiver Status
[33]Gigabit and 100Mbps
[34]Solving PCI IRQ Problems
[35]Driver Licensing
[36]Auto-Negotiation Intro
[37]Drivers as Kernel Modules
[38]Linux USB Drivers
[39]Linux USB Ethernet
[40]Linux USB Tuner Support


Compiling a Device Driver Module


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). In the
instructions below driver.c refers to the name of the driver source
file for your device e.g. 3c59x.c, and driver.o refers to the compiled
driver module binary.
* Verify that the source code for your current kernel version is
installed.

[If it is not on the Slackware 7.1 CD I quit here! If I have it maybe I
can compile my own kernel for fun, with sound support and with ppp and
slhc built in.]

* 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. I usually use
/usr/src/modules/driver.c.
* 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

[This differs in a few ways from the instructions I ran across somewhere
else - no -W (warning), -06 instead of -02, and nothing here about
-isystem. I think a Makefile does something similar and you just type
make instead of specifying it all on one line after gcc. At yet another
site it says not to compile this as root.]

* As 'root', test the module by doing "insmod driver.o".
[I wonder if whoever compiled the module before skipped this step]

* 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/

[For BL2 do I need a /net/ directory or can I just copy my .o file to
2.2.16/misc/? What is this `uname -r` and install -m business?]

Possible problems and solutions

If you get an "linux/version.h no such file or directory" message when
compiling the driver, you either have not installed the kernel source
code, or you haven't run
cd /usr/src/linux; make include/linux/version.h

yet. Most modern distributions install the essential header files of
the kernel source code, including a pre-built "version.h", so this
isn't always necessary.

If you get a "modversions.h not found" message when compiling the
driver, delete '-DMODVERSIONS' from the command used to compile the
driver module.

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

[I think this loads the module when you boot and is optional.]
.....
References

1. http://www.scyld.com/index.html





Archive powered by MHonArc 2.6.24.

Top of Page