Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing an array as command line argument for linux kernel module

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

In the kernel:

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

But I've no idea how to pass values from the command line. If it is a just variable I will use:

insmod k1.ko a=10 
like image 795
Jeyaram Avatar asked Jun 12 '12 10:06

Jeyaram


1 Answers

You can pass arrays via

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

see Linux Kernel Module Programming for more information and examples.

like image 109
dwalter Avatar answered Oct 18 '22 21:10

dwalter