module parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
 
I want to pass a string paramter that contains spaces to my test module like this:
     insmod ./testmod.ko str1="this is a test message"
 
I'm running kernel 2.6.10 and I do this in my test module:
 
     #include <linux/moduleparam.h>
     ...
     .......
     char str1[256]="to be passed in";
     module_param(str1, charp, 0);
     ....
     ..........
     printk("Going to send: %s",str1);
 
 
 
And yet, this prints: "Going to send: this"  whereas I want it to say: "Going to send: this is a test message".  dmesg also gives a complaing that "is" is an unknown parameter.
 
Even if I use
     module_param_string(str1,str1,sizeof(str1),0);
it still gives me the same thing.
 
 
In 2.4, this did what I wanted it to do:
     #include <linux/module.h>
     .............
     char *str1;
     MODULE_PARM(str1, "s");
     ...........
     printk("Going to send: %s",str1);
 
 
So....HELP!!!  How do I make it work in 2.6?
Regards,
Aman

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux