Re: Passing Parameters to Module

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

 



Thank you very much.  Now I can get it to work.  That is a big help. 
Sorry for such a simple question.


> --- Josh Berry <josh.berry@linknet-solutions.com>
> wrote:
>> Load the module and pass it the parameter of 100 and
>> 10, the module
>> divides 100 by ten, and then inputs the value to a
>> syslog facility
>> (printk(KERN_ALERT "%d", value);
>>
>> This is probably an incredibly simple exercise, but
>> I am very new to
>> playing with kernel development.
>
>   This is typically how it is done. It uses the
> MODULE_PARM macro. The second argument to MODULE_PARM
> denotes the type of the variable. "i" refers to an
> integer.
>
>   int int_var = 0;
>
>   MODULE_PARM (int_var, "i");
>   int init_module() {
>     if (int_var) {
>       printk(<5>"%d\n", i/10);
>      }
>   }
>
>   Load the module as "insmod int_var=100"
>
>   For more details refer to
> http://www.xml.com/ldd/chapter/book/ch02.html
>
>
> =====
> Regards,
> Kiran Kumar Immidi
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>


Thanks,
Josh Berry, CTO
LinkNet-Solutions
469-831-8543
josh.berry@linknet-solutions.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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