Skip to Content.
Sympa Menu

baslinux - Compiling kernel module (was 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: Compiling kernel module (was Re: [BL] ethernet problem)
  • Date: Thu, 17 Jun 2004 13:02:15 -0400 (EDT)

On Mon, 14 Jun 2004 3aoo-cvfd AT dea.spamcon.org wrote:

> Sindi Keesan wrote:
> >
> > I have attached the Makefile. I welcome any helpful
> > suggestions as to just what to do with it.
> >
> ># 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
>

Instead of using the Makefile to specify the above locations, I followed
instructions on compiling kernel modules from www.scyld.com/pub/network,
which said to use the command line found at the end of the module source
code. This particular one read:

gcc -DMODULE -Wall -Wstrict-prototypes -O6 -c winbond-840.c

I ran it from the location where I had put winbond-840.c
(usr/src/modules) but could probably also have specified the location of
that file instead. It could not find the header files until I also added

-I/usr/src/linux/include (or instead of linux use linux-2.1.16)

Then it still could not find pci-scan.h or kern_compat.h so I did a web
search on those and found a nice report by someone who compiled their own
module (they were the one who said to use -I if it cannot find things)
that said to download them from scyld, along with pci-scan.c, which you
need to use in compiling pci-scan.o, which you insmod first, at least for
their tulip-related module. I have not downloaded these yet, first tried
to compile without them. This person also said to install the 'linux
kernel header source code' not the entire linux kernel source code. My
installation of the entire kernel source code seems to have given me a
second copy of the kernel headers and then conked out before installing
the rest of the 75M tar file so that all I have is two copies of the
kernel headers. I deleted the 75M tar file (kernel source code) and got
three lines of error messages while deleting it which I did not record.

When I tried to compile (with these two files missing) I got a large
number of error messages such as:

In file included from
/usr/src/linux/include/linux/types.h:4....
from winbond-840.c:145
.........../posix_types.h:5:
unbalanced `#endif'.....unterminated content......
I got these error messages for most or maybe all of the .h files.

At the end it said it could not find pci-scan.h or kern_compat.h, as
expected.

What might I be doing wrong? I did not write winbond-840.c. I can attach
it if anyone wants to see it. How do I get things to balance and
terminate? (The other option is of course to get different ethernet
cards, but if I had, I would not have learned to use bzip2, install source
code or run e2fsck from BL3 to fix BL2).

Sindi Keesan





Archive powered by MHonArc 2.6.24.

Top of Page