mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Newbie: added function not visible
@ 2005-06-29 16:59 Genadz Batsyan
  2005-06-29 17:10 ` randy_dunlap
  2005-06-29 17:15 ` Robert Love
  0 siblings, 2 replies; 3+ messages in thread
From: Genadz Batsyan @ 2005-06-29 16:59 UTC (permalink / raw)
  To: linux-kernel

I'm desperate, please help, if I'm missing something obvious.

I am trying to add a function to the file drivers/char/keyboard.c
and then be able to call this function from my kernel module

adding the function to keyboard.c, recompiling and booting with kernel
results  /proc/kallsyms telling me that my function exists with the tag 'T',
which I think is ok

In my module I simply declare the function's prototype and use it.

When trying to compile the module, modpost tells that the function's symbol
is not found. (insmodding results in error too)

I don't get it, WHY tha heck can it find all the other stuff and 
what makes this new function different? I have read that 2.6 kernel exports
any non-static symbols.

Regards!

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

* Re: Newbie: added function not visible
  2005-06-29 16:59 Newbie: added function not visible Genadz Batsyan
@ 2005-06-29 17:10 ` randy_dunlap
  2005-06-29 17:15 ` Robert Love
  1 sibling, 0 replies; 3+ messages in thread
From: randy_dunlap @ 2005-06-29 17:10 UTC (permalink / raw)
  To: Genadz Batsyan; +Cc: linux-kernel

On Wed, 29 Jun 2005 18:59:04 +0200 Genadz Batsyan wrote:

| I'm desperate, please help, if I'm missing something obvious.
| 
| I am trying to add a function to the file drivers/char/keyboard.c
| and then be able to call this function from my kernel module
| 
| adding the function to keyboard.c, recompiling and booting with kernel
| results  /proc/kallsyms telling me that my function exists with the tag 'T',
| which I think is ok

also add:
EXPORT_SYMBOL(new_symbol); /* whatever the new entry point is */

That makes it visible to modules.

| In my module I simply declare the function's prototype and use it.
| 
| When trying to compile the module, modpost tells that the function's symbol
| is not found. (insmodding results in error too)
| 
| I don't get it, WHY tha heck can it find all the other stuff and 
| what makes this new function different? I have read that 2.6 kernel exports
| any non-static symbols.


---
~Randy

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

* Re: Newbie: added function not visible
  2005-06-29 16:59 Newbie: added function not visible Genadz Batsyan
  2005-06-29 17:10 ` randy_dunlap
@ 2005-06-29 17:15 ` Robert Love
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Love @ 2005-06-29 17:15 UTC (permalink / raw)
  To: Genadz Batsyan; +Cc: linux-kernel

On Wed, 2005-06-29 at 18:59 +0200, Genadz Batsyan wrote:

> adding the function to keyboard.c, recompiling and booting with kernel
> results  /proc/kallsyms telling me that my function exists with the tag 'T',
> which I think is ok

You need to EXPORT_SYMBOL your new function.

For example,

	/* My pet dog is an idiot */
	void beat_dog(struct dog *d)
	{
		/* ... */
	}
	EXPORT_SYMBOL(beat_dog);

Good luck,

	Robert Love



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

end of thread, other threads:[~2005-06-29 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-29 16:59 Newbie: added function not visible Genadz Batsyan
2005-06-29 17:10 ` randy_dunlap
2005-06-29 17:15 ` Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®