Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-24-2004, 10:56 PM   #1
Registered: Sep 2003
Location: sydney
Distribution: Redhat 8.0
Posts: 36

Rep: Reputation: 15
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)
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 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.
Old 07-24-2004, 11:08 PM   #2
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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.

Last edited by win32sux; 07-24-2004 at 11:11 PM.
Old 07-25-2004, 12:46 AM   #3
Registered: Sep 2003
Location: sydney
Distribution: Redhat 8.0
Posts: 36

Original Poster
Rep: Reputation: 15
thnx mate,that did help.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
tainted kernel!? scankyfrank SUSE / openSUSE 3 05-22-2005 11:02 AM
Tainted variable problem (PERL) rajatgarg Programming 1 07-29-2004 02:54 PM
nvidia causing tainted kernel aidankitch Linux - Hardware 1 04-26-2004 04:47 PM
summation of tainted module? toastermaker General 5 12-16-2003 09:36 PM
Tainted Kernel bengo Slackware 3 03-23-2003 04:50 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration