Re:Re: Kernel Module Programming: Calling/exporting Functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

When I try to add the function in dev.c and compile, I get the message
saying  undefined reference to `driver_control'. Am I missing something
here?. Looks like liking is not happening properly. Should I add any header
files in dev.c?

Thanks/Sanjay


On Mon, 2005-02-28 at 16:32 -0800, Sanjay wrote:
> Hi,
> 
> I have a module(test.c) which has function called driver_control().  I
need
> to call that from the different kernel programs(dev.c). How can I call
these
> module functions from the kernel programs?. I'm using 2.6 linux kernel.
Any
> help will be appreciated.
> 
> 
> Ex: test.c
> static int __init _init_module(void)
> {
>         printk( "<1>\nInstalling \'%s\' module\n", modname );
> }
> 
> static void  __exit _exit_module(void){
>         printk( "<1>Removing \'%s\' module\n", modname );
> }
> void driver_control(void){
>         printk("<1> Calling driver control control function \n");
> }
> EXPORT_SYMBOL_NOVERS(driver_control);
This should do it! just call this from whatever kernel program u want
to....it should wrk i guess....unless i'm missing something very
obvious! have you tried calling "driver_control" from dev.c ?? U've
exported the symbol correctly (not sure of the _NOVERS thing)....so any
kernel  module should be able to call it........
> 
> 
> 
> Thanks,
> Sanjay Hegde


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux