8

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 

1 Answer 1

15

You can pass arrays via

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

see Linux Kernel Module Programming for more information and examples.

Sign up to request clarification or add additional context in comments.

2 Comments

@Jayy: would you mind accepting this as solution to your question ?
have a look at FAQ on how you accept a solution on stackoverflow.com.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.