All of lore.kernel.org
 help / color / mirror / Atom feed
* cannot insmod sculld in ldd3
@ 2017-03-12  3:17 Ali Aminian
  0 siblings, 0 replies; 11+ messages in thread
From: Ali Aminian @ 2017-03-12  3:17 UTC (permalink / raw)
  To: kernelnewbies

Hello Tobin C. Harding
I used the source you provided and still receive the same error.
also the output of "uname -a" is this. if that matters:
Linux ali-Z97-D3H 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15
UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-12 18:12 Ali Aminian
  2017-03-12 19:03 ` Greg KH
@ 2017-03-13 13:44 ` Aruna Hewapathirane
  1 sibling, 0 replies; 11+ messages in thread
From: Aruna Hewapathirane @ 2017-03-13 13:44 UTC (permalink / raw)
  To: kernelnewbies

<snip>
>> Now I wonder what is the proper way to export "Module.symvers"
>> information to the outside so that modules that use it do not have to
>> copy that file into their directory.

If you use a top-level Makefile like the one below it will create the
necessary Module.symvers file.
I am not sure if this is the correct or recommended way,  I had kernel
modules in separate directories a long
while back when I was learning+testing and this worked for me.

obj-m := lddbus/ sculld/

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD       := $(shell pwd)

all:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

clean:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) clean

Hope this helps - Aruna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170313/3b944748/attachment.html 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-13  4:19   ` Freeman Zhang
@ 2017-03-13  8:32     ` Greg KH
  0 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2017-03-13  8:32 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Mar 13, 2017 at 12:19:58PM +0800, Freeman Zhang wrote:
> Hi Greg,
> 
> 
> On 3/13/17 3:03 AM, Greg KH wrote:
> 
> > 
> > 'depmod' handles all of this when you install a kernel and its modules.
> > 
> 
> Thanks for that information, now I take 'depmod' seriously and stop
> making up inelegant methods. I studied the 'kmod', both its behaviors
> and codes, and got plenty of ideas about module symbol stuff.
> 
> However, I am still wondering why copy Module.symvers file works too, at
> building time?

Because that is what depmod creates, you probably didn't change much, if
anything, from the kernel version you copied it from.  But don't do
that, it is probably wrong.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-12 19:03 ` Greg KH
@ 2017-03-13  4:19   ` Freeman Zhang
  2017-03-13  8:32     ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Freeman Zhang @ 2017-03-13  4:19 UTC (permalink / raw)
  To: kernelnewbies

Hi Greg,


On 3/13/17 3:03 AM, Greg KH wrote:

> 
> 'depmod' handles all of this when you install a kernel and its modules.
> 

Thanks for that information, now I take 'depmod' seriously and stop
making up inelegant methods. I studied the 'kmod', both its behaviors
and codes, and got plenty of ideas about module symbol stuff.

However, I am still wondering why copy Module.symvers file works too, at
building time?

>	step 1.   build lddbus, generate `*.ko` and `Module.symvers`
>	step 2.   copy `Module.symvers` located in lddbus directory
>	          to sculld directory
>	step 3.   build sculld


All the best!
Freeman


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: OpenPGP digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170313/e8a4cf98/attachment-0001.bin 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-12 18:12 Ali Aminian
@ 2017-03-12 19:03 ` Greg KH
  2017-03-13  4:19   ` Freeman Zhang
  2017-03-13 13:44 ` Aruna Hewapathirane
  1 sibling, 1 reply; 11+ messages in thread
From: Greg KH @ 2017-03-12 19:03 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Mar 12, 2017 at 09:42:36PM +0330, Ali Aminian wrote:
> Hello, Freeman Zhang. copying 'Module.symvers' to sculld folder solved
> the problem. Thank you, man.
> 
> Now I wonder what is the proper way to export "Module.symvers"
> information to the outside so that modules that use it do not have to
> copy that file into their directory. for example, what do pci and usb
> buses do in this case?

'depmod' handles all of this when you install a kernel and its modules.

hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
@ 2017-03-12 18:12 Ali Aminian
  2017-03-12 19:03 ` Greg KH
  2017-03-13 13:44 ` Aruna Hewapathirane
  0 siblings, 2 replies; 11+ messages in thread
From: Ali Aminian @ 2017-03-12 18:12 UTC (permalink / raw)
  To: kernelnewbies

Hello, Freeman Zhang. copying 'Module.symvers' to sculld folder solved
the problem. Thank you, man.

Now I wonder what is the proper way to export "Module.symvers"
information to the outside so that modules that use it do not have to
copy that file into their directory. for example, what do pci and usb
buses do in this case?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-10 16:49 Ali Aminian
  2017-03-10 18:06 ` valdis.kletnieks at vt.edu
  2017-03-11 22:58 ` Tobin C. Harding
@ 2017-03-12  8:55 ` Freeman Zhang
  2 siblings, 0 replies; 11+ messages in thread
From: Freeman Zhang @ 2017-03-12  8:55 UTC (permalink / raw)
  To: kernelnewbies

Hi

On 3/11/17 12:49 AM, Ali Aminian wrote:


> i checked dmsg and it says:
> [12073.858764] sculld: no symbol version for unregister_ldd_driver
> [12073.858767] sculld: Unknown symbol unregister_ldd_driver (err -22)
> [12073.858780] sculld: no symbol version for register_ldd_device
> [12073.858781] sculld: Unknown symbol register_ldd_device (err -22)
> [12073.858789] sculld: no symbol version for unregister_ldd_device
> [12073.858790] sculld: Unknown symbol unregister_ldd_device (err -22)
> [12073.858794] sculld: no symbol version for register_ldd_driver
> [12073.858795] sculld: Unknown symbol register_ldd_driver (err -22)
> 
> these functions are defined in lddbus and i have insmod lddbus.


Based on your description, you built two modules: lddbus and sculld.
sculld used the symbols exported in lddbus -- am I right? In this case,
you might want sculld to know these symbols via copying Module.symvers
file generated by the compilation of lddbus to sculld code directory
before building sculld. To make it clear:

	step 1.   build lddbus, generate `*.ko` and `Module.symvers`
	step 2.   copy `Module.symvers` located in lddbus directory
	          to sculld directory
	step 3.   build sculld

Just a mixture of guess and experiences... hope it can help!


All the best!
Freeman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: OpenPGP digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170312/98541462/attachment.bin 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-10 16:49 Ali Aminian
  2017-03-10 18:06 ` valdis.kletnieks at vt.edu
@ 2017-03-11 22:58 ` Tobin C. Harding
  2017-03-12  8:55 ` Freeman Zhang
  2 siblings, 0 replies; 11+ messages in thread
From: Tobin C. Harding @ 2017-03-11 22:58 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Mar 10, 2017 at 08:19:29PM +0330, Ali Aminian wrote:
> Hello
> when i try to insmod sculld insmod prints this error message:
> insmod: ERROR: could not insert module ./sculld.ko: Invalid parameters

What source code are you using. The is a port here

https://github.com/duxing2007/ldd3-examples-3.x

porting ldd3 source to modern kernels.

thanks,
Tobin.

> 
> i checked dmsg and it says:
> [12073.858764] sculld: no symbol version for unregister_ldd_driver
> [12073.858767] sculld: Unknown symbol unregister_ldd_driver (err -22)
> [12073.858780] sculld: no symbol version for register_ldd_device
> [12073.858781] sculld: Unknown symbol register_ldd_device (err -22)
> [12073.858789] sculld: no symbol version for unregister_ldd_device
> [12073.858790] sculld: Unknown symbol unregister_ldd_device (err -22)
> [12073.858794] sculld: no symbol version for register_ldd_driver
> [12073.858795] sculld: Unknown symbol register_ldd_driver (err -22)
> 
> these functions are defined in lddbus and i have insmod lddbus.
> 
> can anyone tell me what is wrong.
> thank you.
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-- 
Tobin Harding
http://tobin.cc

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
@ 2017-03-11 21:49 Ali Aminian
  0 siblings, 0 replies; 11+ messages in thread
From: Ali Aminian @ 2017-03-11 21:49 UTC (permalink / raw)
  To: kernelnewbies

Hello
I mean lddbus and sculld from the book "Linux Device Drivers, Third Edition".

Here I attached the codes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sculld_lddbus.tar.gz
Type: application/x-gzip
Size: 8768 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170312/40e12a6f/attachment.gz 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
  2017-03-10 16:49 Ali Aminian
@ 2017-03-10 18:06 ` valdis.kletnieks at vt.edu
  2017-03-11 22:58 ` Tobin C. Harding
  2017-03-12  8:55 ` Freeman Zhang
  2 siblings, 0 replies; 11+ messages in thread
From: valdis.kletnieks at vt.edu @ 2017-03-10 18:06 UTC (permalink / raw)
  To: kernelnewbies

On Fri, 10 Mar 2017 20:19:29 +0330, Ali Aminian said:

> these functions are defined in lddbus and i have insmod lddbus.
>
> can anyone tell me what is wrong.

Unless I'm getting senile, neither sculld or lddbus are in the current
mainline source tree, so you'll need to provide a pointer to your code
before you'll get help.

But the most likely thing is that your sculld module isn't
properly licensed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 484 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170310/7159fbb5/attachment.bin 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* cannot insmod sculld in ldd3
@ 2017-03-10 16:49 Ali Aminian
  2017-03-10 18:06 ` valdis.kletnieks at vt.edu
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ali Aminian @ 2017-03-10 16:49 UTC (permalink / raw)
  To: kernelnewbies

Hello
when i try to insmod sculld insmod prints this error message:
insmod: ERROR: could not insert module ./sculld.ko: Invalid parameters

i checked dmsg and it says:
[12073.858764] sculld: no symbol version for unregister_ldd_driver
[12073.858767] sculld: Unknown symbol unregister_ldd_driver (err -22)
[12073.858780] sculld: no symbol version for register_ldd_device
[12073.858781] sculld: Unknown symbol register_ldd_device (err -22)
[12073.858789] sculld: no symbol version for unregister_ldd_device
[12073.858790] sculld: Unknown symbol unregister_ldd_device (err -22)
[12073.858794] sculld: no symbol version for register_ldd_driver
[12073.858795] sculld: Unknown symbol register_ldd_driver (err -22)

these functions are defined in lddbus and i have insmod lddbus.

can anyone tell me what is wrong.
thank you.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-03-13 13:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-12  3:17 cannot insmod sculld in ldd3 Ali Aminian
  -- strict thread matches above, loose matches on Subject: below --
2017-03-12 18:12 Ali Aminian
2017-03-12 19:03 ` Greg KH
2017-03-13  4:19   ` Freeman Zhang
2017-03-13  8:32     ` Greg KH
2017-03-13 13:44 ` Aruna Hewapathirane
2017-03-11 21:49 Ali Aminian
2017-03-10 16:49 Ali Aminian
2017-03-10 18:06 ` valdis.kletnieks at vt.edu
2017-03-11 22:58 ` Tobin C. Harding
2017-03-12  8:55 ` Freeman Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.