Mailing List Archive

module loading problem
> root@linux ~/xtt/ make clean
> rm -f *.o *~ core
> root@linux ~/xtt/ make
> gcc -D__KERNEL__ _DMODULE -O -Wall -I/usr/include -c driver.c -o driver.o
> gcc -D__KERNEL__ _DMODULE -O -Wall -I/usr/include -c xttmd.c -o xttmd.o
> make xtt.o
> make[1]: Entering directory `/root/xtt'
> ld -r driver.o xttmd.o -o xtt.o
> make[1]: Leaving directory `/root/xtt'
> root@linux ~/xtt/ insmod xtt.o
> xtt.o: unresolved symbol printk
> root@linux ~/xtt/ insmod -V
> insmod version 2.1.121
> cat /proc/ksyms | grep print
> c0113580 printk_Rsmp_dd132261
> c01b85b8 sprintf_Rsmp_3c2c5af5
> c01b81a4 vsprintf_Rsmp_13d9cea7
Hi, I am trying to write (for the first time) a device handling module for a new xerox printer (212/214 series) and i've come across this problem once i upgraded to the 2.2.0-pre series. I've read everything I could find about the new modutils for 2.1.x but it still does not work. Loadable module support is turned on in the kernel, modutils are new, every utility from the Doc/CHANGES is of appropriate versions, and printk is in /proc/ksyms, but I can't link any of the modules to the kernel. I've tried everything short of ld'ing my 20 line program to the .o files in /usr/src/linux/kernel. The weird part is that my program worked fine in 2.0.36 RH52. And there really isn't anything complex in my program as I am just trying to detect the device and quit. I even tried cutting out the whole program except for the one-line printk() call, but with same effect.
I know that it must be something really simple, so excuse the possible triviality of this message, but as I would like to start poking around in the kernel and I guess this is the place to talk about my problems if I am stumped. Please "Cc: mxk@russiamail.com" if you respond.
TIA,
Mike.
----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: module loading problem [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Please keep your line lenth to no more than 80 characters (74 is better as
it allows for a couple of levels of quoting ;)
On Wed, 6 Jan 1999 mxk@russiamail.com wrote:
[...]
> > gcc -D__KERNEL__ _DMODULE -O -Wall -I/usr/include -c xttmd.c -o xttmd.o
^ that is a '-', isn't it?
[...]
> > root@linux ~/xtt/ insmod xtt.o
> > xtt.o: unresolved symbol printk
It's right, the printk in the kernel is called "printk_Rsmp_dd132261" as
it is a versioned symbol.
You need to add -DMODVERSIONS to the CFLAGS. You should be able to force
it to be loaded with the -f flag, but that dosn't seem to be working for
me.
[...]
> > c0113580 printk_Rsmp_dd132261
<sym-> <-version-->
> > c01b85b8 sprintf_Rsmp_3c2c5af5
> > c01b81a4 vsprintf_Rsmp_13d9cea7
>
The version incodes information on the function (return type, argument
types & number ....). It's supposed to stop modules being loaded into a
kernel where the functions it uses have had there types changed.
> Hi, I am trying to write (for the first time) a device handling module
> for a new xerox printer (212/214 series) and i've come across this
> problem once i upgraded to the 2.2.0-pre series.
It's not a printer. It's a digital copier, with PC communication
option. To me a printer has either a parallel, serial or network
interface; and is already supported ;).
Bryn
- --
PGP pubkeys from http://www.gytha.demon.co.uk/pubkey.asc.
Men often believe -- or pretend -- that the "Law" is something sacred, or at
least a science -- an unfounded assumption very convenient to governments.
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Comment: Silly comment here ...
Charset: noconv
iQA/AwUBNpVrYt94IUtvfSqaEQIRdwCguYhXId84NeZA0Mt2YRt6c8px08sAoOM+
H3FUeyp4wngzTqAhRW0tWQ1c
=urOW
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/