[PLUG] kernel module

abhi abhi.elementx at gmail.com
Mon Jun 29 14:01:50 IST 2009

Hi. I have begun writing kernel modules and facing an issue regarding
passing args to the module:
Here's my code:

static char *agent_name = "UNKNOWN";
static int agent_code = 47;

MODULE_PARM (agent_name, "s");
MODULE_PARM (agent_code, "i");

static int __init my_init_function(){
    printk(KERN_ALERT "\ninserted module : passing_args...");
    printk(KERN_ALERT "\nAGENT Name : %s", agent_name);
    printk(KERN_ALERT "\nAGENT CODE : %i", agent_code);
    return 0;

static void __exit my_exit_function(){
    printk(KERN_ALERT "removed module : passing_args");


*I get this error when i do the make:*

make -C /lib/modules/
SUBDIRS=/home/Demon/Linux_Modules/thrd_passing_args_module modules
make[1]: Entering directory `/usr/src/kernels/'
  CC [M]  /home/Demon/Linux_Modules/thrd_passing_args_module/passing_args.o
*/home/Demon/Linux_Modules/thrd_passing_args_module/passing_args.c:8: error:
expected ‘)’ before string constant
/home/Demon/Linux_Modules/thrd_passing_args_module/passing_args.c:9: error:
expected ‘)’ before string constant*
warning: function declaration isn’t a prototype
warning: function declaration isn’t a prototype
/home/Demon/Linux_Modules/thrd_passing_args_module/passing_args.c:23: fatal
error: opening dependency file
Permission denied
compilation terminated.
make[2]: ***
[/home/Demon/Linux_Modules/thrd_passing_args_module/passing_args.o] Error 1
make[1]: *** [_module_/home/Demon/Linux_Modules/thrd_passing_args_module]
Error 2
make[1]: Leaving directory `/usr/src/kernels/'
make: *** [default] Error 2

Where am i going wrong?
Thank you.
"The best security against revolution is in constant correction of abuses
and the introduction of needed improvements. It is the neglect of timely
repair that makes rebuilding necessary."
-Richard Whately

More information about the Plug-mail mailing list