On Wed, 11 Aug 1999, gokhan sozmen wrote:

> Hi folks,
> 
> I'm trying to build a scsi driver module to run with
> the RedHat 2.2.5-15smp kernel.
> 
> I include <linux/modversions.h> to make my module
> use mangled kernel symbols. I build on a machine 
> running 2.2.5-15smp. When I look at the object 
> symbols in my module using "nm" I see them listed
> as <symbol>_Rxxxx. I look at the kernel exported
> symbols in /proc/ksyms and the symbols are listed
> as <symbol>_Rsmp_xxx. Obviously insmod complains
> about a symbol version mismatch.
> 
> Now my question is : Is the RedHat 2.2.5-15 release
> missing some header files (i.e. SMP versions of
> modversions.h & modules/*.ver) for building SMP 
> kernel modules? Is there a place I can get these?

It probably has all the include files it needs but there are certain
defines that must be made during the compile in order to select the SMP
version of the included code (which is in some cases different).  I
believe that you'll need to use a compile line something like:

gcc -D__SMP__ -DMODULE -D__KERNEL__ -I/usr/src/linux/XXX \\
  -Wall -Wstrict-prototypes -O6 -c whatever.c \\
  `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`

where you may or may not need an include (change the XXX to the
appropriate path if you do) and where I'm assuming the module source is
named "whatever.c".  Note well the -D__SMP__; this is the magic that
selects the SMP variants in both code and includes (look for wrapped
ifdef's and you'll see what I mean).

A possibly simpler alternative is to just put the source where it
belongs in the kernel source tree and use the standard kernel build
ritual (make dep;make clean;make bzImage;make modules;make
modules_install) after doing an appropriate config.  Then copy bzImage
to /boot/vmlinuz-2.2.X, copy System.map to /boot, add a section to
/etc/lilo.conf to boot the new kernel with a new name (like
linux-2.2.X) and rerun lilo.  This way, when you reboot, you can select
the new kernel but if it bombs you can back off to the distribution
kernel and fix things.

This method will set all defines and dependencies (including SMP)
according to the .config.  It can be a BIT tricky, as you will have to
find or figure out RH's .config file, but the further advantage is that
you can upgrade to the latest kernel at the same time (always a good
idea -- even 2.2.5-15 is out of date; see RH's update site to get the
2.2.5-22 RPM kernel update).  I'm running 2.2.10 under RH 6 at the
moment and just waiting for 2.2.11, since I'm still experiencing various
NFS/portmap bugs.

   rgb

Robert G. Brown                        http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:[EMAIL PROTECTED]



-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to