My code (attached) seems to work on a seawolf. [root@seawolf src]# tail /var/log/messages Sep 12 11:40:41 seawolf kernel: Hello. Sep 12 11:40:41 seawolf kernel: The process is "insmod" (pid 2727) Sep 12 11:40:49 seawolf kernel: Bye. [root@seawolf src]# Matt On Sun, 2001-09-09 at 16:01, Shobhit Mathur wrote: > Hello, > > This might be a frequently asked Question. But, I am afraid, I > have to repeat > the question..... > I wrote a fundamental "hello world" module on my newly > installed 7.1 > Linux PC . The code compiles successfully with a "gcc -c > <file-name>". > Upon attempting an "insmod <file.o>", I get the following error > : > "unresolved symbol printk" > > Upon perusing through other mailing-lists, I found that this > problem has been > around for quite a while. Currently, I have a kernel with the > flag > CONFIG_MODVERSIONS being disabled. But, it does not make any > difference. I get the same error before and after the > recompilation with the > changed flag. insmod continues to fail ! > > So, can anyone, please let me know what are the issues involved > or direct me > to the appropriate contacts in order to resolve this > "innocuous" problem. > > - I guess, the smallest problems hurt the most > > - Please do let me know....... > > - Thank you very much [ [EMAIL PROTECTED] ] > > > > _______________________________________________ > Seawolf-list mailing list > [EMAIL PROTECTED] > https://listman.redhat.com/mailman/listinfo/seawolf-list
#define __NO_VERSION__ #ifndef __KERNEL__ # define __KERNEL__ #endif #ifndef MODULE # define MODULE #endif #include <linux/module.h> #include <linux/sched.h> int init_module(void) { printk("<1>Hello.\n"); printk("<1>The process is \"%s\" (pid %i)\n", current->comm, current->pid); return 0; } void cleanup_module(void) { printk("<1>Bye.\n"); }