Hi Rich,
My understanding is that the macro module_param( variable_name, type, permission ) handles this when the kernel module is loaded.
this is for a very simple kernel module
//.......
static int Param1= 0;
static int Param2 = 1;
module_param( Param1, int, 0 );
module_param( Param2, int, 0 );
//.........
static int __init test_init(void)
{
printk(KERN_INFO "Param1 = %d \n", Param1);
printk(KERN_INFO "Param2 = %d \n", Param2);
printk(KERN_INFO "Kernel Module Loaded Successfully...\n");
return 0;
}
static void __exit test_exit(void)
{
printk(KERN_INFO "Kernel Module Removed Successfully...\n");
}
module_init(test_init);
module_exit(test_exit);
So after I make and install the module I can call modprobe with the values I pass in with the parameters.
sudo modprobe someDriver Param1=123 Param2=456
So that when I look at dmesg I should see the following
Param1=123
Param2=456
Kernel Module Loaded Successfully...
So when you say that I'm not reading the values I'm a bit confused.
Any light you could shed on me would be greatly appreciated.
Thanks
gharig