Passing an array as a command line argument to a Linux kernel module

I would like to pass an array of data to the Linux kernel module.

In the core:

int a[5]; int count; module_param_array(a, int, &count, 0); 

But I do not know how to pass values ​​from the command line. If this is just a variable, I will use:

 insmod k1.ko a=10 
+5
source share
1 answer

You can pass arrays through

  insmod k1.ko a=10,20,30,40 

see Linux Kernel Module Programming for more information and examples.

+7
source

All Articles