EmbLogic's Blog

how can i insert a space using module_param through commandline??

Here is my source code —-

#include
#include
#include
#include
#include
#include

#ifndef DEBUG
#define DEBUG
#endif

MODULE_LICENSE(“GPL”);
MODULE_AUTHOR(“VAIBHAV”);
MODULE_DESCRIPTION(“Simple Modules init and exit”);

static short int data=4;
static int i=2;
static long int j=1;
static char *si=” vaibhav “;

static int pvtdata __initdata=1234;

static int __init vaibhav(void)
{
#ifdef DEBUG
printk(KERN_INFO “Begin !%s \n”,__func__);
#endif
#ifdef DEBUG
printk(KERN_ALERT “hello kernel !\n”);
#endif
#ifdef DEBUG
printk(KERN_ALERT “data=%d \t i=%d \t j=%ld\t si=%s\t pvtdata=%d\n”,data,i,j,si,pvtdata);
#endif
#ifdef DEBUG
printk(KERN_ALERT “The process is %s and its pid is %d \n”,current->comm,current->pid );
#endif
#ifdef DEBUG
printk(KERN_INFO “%s End\n”,__func__);
#endif
return 0;
}
module_init(vaibhav);
module_param(data,short,S_IRUGO);
module_param(i,int,S_IRUGO );
module_param(j,long,S_IRUGO);
module_param(si,charp,S_IRUGO);
module_param(pvtdata,int,S_IRUGO);

static void __exit vaibhav1(void)
{
#ifdef DEBUG
printk(KERN_INFO “Begin !%s \n”,__func__);
#endif
#ifdef DEBUG
printk(KERN_ALERT “Execution compleate \n”);
#endif
#ifdef DEBUG
printk(KERN_INFO “%s End \n”,__func__);
#endif
}

module_exit(vaibhav1);

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>