How many params can be accept by kernel module at most?
On Mon, Nov 01, 2010 at 02:17:23PM +0800, tingwei liu wrote:
>How many params can be accept by kernel module at most?
If you mean dynamically, these parameters are passed as a whole to kernel,
from the source code, you can see the max length is ~0UL>>1.
If you mean statically, IOW, the max paramenters you can provide in your module,
this is limited by ELF section size.
Hope this helps.
What's the meaning of dynamically and statically?
You response help me much. Thank you
2010/11/1 Américo Wang <[email protected]>:
> On Mon, Nov 01, 2010 at 02:17:23PM +0800, tingwei liu wrote:
>>How many params can be accept by kernel module at most?
>
> If you mean dynamically, these parameters are passed as a whole to kernel,
> from the source code, you can see the max length is ~0UL>>1.
>
> If you mean statically, IOW, the max paramenters you can provide in your module,
> this is limited by ELF section size.
>
> Hope this helps.
>
The params are transferred by command line. And the params are all in
program statically. So the stack size determine the params number. For
example: stack size is 4K,and params are unsigned int type with 4
bytes,so the max number of params is 1 thousand。
2010/11/1 tingwei liu <[email protected]>:
> What's the meaning of dynamically and statically?
> You response help me much. Thank you
>
> 2010/11/1 Américo Wang <[email protected]>:
>> On Mon, Nov 01, 2010 at 02:17:23PM +0800, tingwei liu wrote:
>>>How many params can be accept by kernel module at most?
>>
>> If you mean dynamically, these parameters are passed as a whole to kernel,
>> from the source code, you can see the max length is ~0UL>>1.
>>
>> If you mean statically, IOW, the max paramenters you can provide in your module,
>> this is limited by ELF section size.
>>
>> Hope this helps.
>>
>
On Mon, Nov 01, 2010 at 05:49:53PM +0800, tingwei liu wrote:
>The params are transferred by command line. And the params are all in
>program statically. So the stack size determine the params number. For
>example: stack size is 4K,and params are unsigned int type with 4
>bytes,so the max number of params is 1 thousand。
>
Please don't top-reply.
That is not true, the parameters are passed via 'uargs' of init_module()
dynamically, this is when you invoke modprobe/insmod.
For your own kernel module, you may use module_param() to provide
parameters, the max of this is limited to the size of ELF section size,
since they are stored in "__param" section.
My description is correct or not ?
2010/11/1 tingwei liu <[email protected]>:
> The params are transferred by command line. And the params are all in
> program statically. So the stack size determine the params number. For
> example: stack size is 4K,and params are unsigned int type with 4
> bytes,so the max number of params is 1 thousand。
>
> 2010/11/1 tingwei liu <[email protected]>:
>> What's the meaning of dynamically and statically?
>> You response help me much. Thank you
>>
>> 2010/11/1 Américo Wang <[email protected]>:
>>> On Mon, Nov 01, 2010 at 02:17:23PM +0800, tingwei liu wrote:
>>>>How many params can be accept by kernel module at most?
>>>
>>> If you mean dynamically, these parameters are passed as a whole to kernel,
>>> from the source code, you can see the max length is ~0UL>>1.
>>>
>>> If you mean statically, IOW, the max paramenters you can provide in your module,
>>> this is limited by ELF section size.
>>>
>>> Hope this helps.
>>>
>>
>
2010/11/1 Américo Wang <[email protected]>:
> On Mon, Nov 01, 2010 at 05:49:53PM +0800, tingwei liu wrote:
>>The params are transferred by command line. And the params are all in
>>program statically. So the stack size determine the params number. For
>>example: stack size is 4K,and params are unsigned int type with 4
>>bytes,so the max number of params is 1 thousand。
>>
>
> Please don't top-reply.
>
> That is not true, the parameters are passed via 'uargs' of init_module()
> dynamically, this is when you invoke modprobe/insmod.
>
> For your own kernel module, you may use module_param() to provide
> parameters, the max of this is limited to the size of ELF section size,
> since they are stored in "__param" section.
>
I really use module_param() to provide parameters. How much of the ELF
section size? How can I find the document of the ELF.
On Mon, Nov 1, 2010 at 11:42 AM, tingwei liu <[email protected]> wrote:
> I really use module_param() to provide parameters. How much of the ELF
> section size? How can I find the document of the ELF.
Searching on Google might help?