<p><br>
On Jun 9, 2014 10:15 PM, "Warren Turkal" <<a href="mailto:wt@penguintechs.org">wt@penguintechs.org</a>> wrote:<br>
><br>
> Hey,<br>
><br>
> I was writing a basic hello world module. I am using Ubuntu, so I<br>
> installed linux-headers package that corresponded to my kernel. It's<br>
> strange because all of the examples that I saw (including from modules<br>
> in the kernel itself) show things like the following for the init function:<br>
><br>
> static int netcat_init(void)<br>
> {<br>
> ...<br>
> return 0;<br>
> }<br>
><br>
> module_init(netcat_init);<br>
><br>
> However, I was not able to get it to work with "static". My<br>
> hello_world_init function looks like the following:</p>
<p>can you post the error you got?</p>
<p>><br>
> int __init hello_world_init(void)<br>
> {<br>
> ...<br>
> return 0;<br>
> }<br>
><br>
> module_init(hello_world_init);<br>
><br>
> The command that is used to make the kernel module is the one suggested<br>
> in Documentation/kbuild/modules.txt. It looks like this:<br>
> make -C /lib/modules/`uname -r`/build M=$PWD<br>
><br>
> Does anyone know why the "static" version would not work?<br>
><br>
> Thanks,<br>
> wt<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>