LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   tainted modules (https://www.linuxquestions.org/questions/programming-9/tainted-modules-209308/)

saajii 07-24-2004 09:56 PM

tainted modules
 
hi guys;

i am learning to write driver modules.i just wrote my hello world program, the code is as below.

#define MODULE
#include <linux/module.h>

int init_module(void)
{
printk("<1>Hello,world\n");
return 0;
}

void cleanup_module(void)
{
printk("<1>Goodbye cruel world\n");
}


i compiled it using the following command

gcc -c -D__KERNEL__ -DMODULE -I /usr/src/linux-2.4.18-14/include HelloWorld.c

however when i load it,i get module tainted warning like below:-

insmod ./HelloWorld.o
Warning: loading ./HelloWorld.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
Module HelloWorld loaded, with warnings

does anyone know how to get rid of this warning?in other words how do i include a license.
i am using redhat 8.0 with kernel 2.4.18-14.
appreciate your comments.

win32sux 07-24-2004 10:08 PM

Quote:

In kernel 2.4 and later, a mechanism was devised to identify code licensed under the GPL (and friends) so people can be warned that the code is non open-source. This is accomplished by the MODULE_LICENSE() macro... By setting the license to GPL, you can keep the warning from being printed. This license mechanism is defined and documented in linux/module.h.
http://docs.mandragor.org/files/Oper...e_en/x317.html


saajii 07-24-2004 11:46 PM

thnx mate,that did help.:)


All times are GMT -5. The time now is 04:15 AM.