LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2006, 12:54 PM   #1
shrishailnk
Member
 
Registered: Mar 2006
Posts: 47

Rep: Reputation: 15
kernel modules....................


one small doubt....
i wrote the following code in 2.4.20
then recomplied the kernel to 2.4.20 custom..
hello all,
now i tried to compile and insert the module....

the module is getting inserted ,but whatever print msg i have given is not getting printed....( i think the static int hello(void)
itself is not getting called when i load the module)

#include <linux/init.h>
#include <linux/kerenel.h>
#include <linux/module.h>
#include "/root/proj_code/check.c" // some file...........

extern void check(void);

void (*check_ptr)(void) = NULL:

static int hello(void)
{
check_ptr = check;
printk("\n some message \n ");

return 0;
}

static void hello_out(void)
{
printk("\nsomething\n");
}

module_init(hello);
module_exit(hello_out);

MODULE_LICENSE("GPL");


why is this problem , any idea.....?
 
Old 04-25-2006, 06:17 AM   #2
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
hi,
I got it working. With removal of some errors in your pasted code. i hope you already have got those errors and solved it. I did dmesg and last few lines showed me printk messages. also you can checl
tail -f /var/log/messages to check printk messages
 
  


Reply


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
kernel: No module symbols loaded - kernel modules not enabled. Qucho Debian 9 05-26-2004 03:50 AM
Kernel Modules and modules.conf init Linux - General 0 02-20-2004 07:51 PM
new kernel (2.4.22 up from 2.4.20-6) - missing modules - use old modules? Simon Bridge Linux - Software 1 02-04-2004 06:52 AM
How to keep modules/drivers across kernel recompiles and kernel versions? Pisces107 Linux - General 5 01-21-2004 09:29 PM
Kernel modules: why are some kernel modules zipped? hampel Slackware 3 06-30-2003 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:09 AM.

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