Linux Today: Linux News On Internet Time.





More on LinuxToday


The Kernel Newbie Corner: Everything You Wanted to Know About Module Parameters

Jul 15, 2009, 18:02 (0 Talkback[s])
(Other stories by Rob Day)

WEBINAR:
On-Demand

How to Help Your Business Become an AI Early Adopter


[ Thanks to LinuxScribe for this link. ]

"So What Do We Do With "Parameters?" As the name suggests, module parameters give us the ability to pass a value of some kind to a module upon loading, and also to examine its value while the module is loaded and running, and even change it on the fly if we want. Here's the simple change we would make to the code above (let's call the new source file p2.c):
... 
 #include 
 #include   // add this
 ...
 static int answer = 42 ;
 module_param(answer, int, 0644);
 MODULE_PARM_DESC(answer, "Life, the universe, etc.");
 ...

"Now recompile your module and, without even loading it, let's discuss what just happened above:"

Complete Story

Related Stories: