<div dir="ltr">Seems like My link didn;'t paste in on the last message - <a href="http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf">http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf</a></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 12, 2016 at 12:44 PM Matt M <<a href="mailto:cmorrow132@gmail.com">cmorrow132@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I actually found this, which was exactly what I needed.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 11, 2016 at 4:50 PM Matt M <<a href="mailto:cmorrow132@gmail.com" target="_blank">cmorrow132@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 11, 2016 at 7:40 PM Greg KH <<a href="mailto:greg@kroah.com" target="_blank">greg@kroah.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Aug 11, 2016 at 07:25:45PM +0000, Matt M wrote:<br>
> I am just getting started with kernel module development, and I can't get<br>
> anything to compile.<br>
><br>
> I get the following errors:<br>
><br>
> In file included from main.c:1:0:<br>
> /usr/src/linux/include/linux/init.h:142:13: error: expected ‘=’, ‘,’, ‘;’,<br>
> ‘asm’ or ‘__attribute__’ before ‘load_default_modules’<br>
> void __init load_default_modules(void);<br>
> ^~~~~~~~~~~~~~~~~~~~<br>
> /usr/src/linux/include/linux/init.h:143:12: error: expected ‘=’, ‘,’, ‘;’,<br>
> ‘asm’ or ‘__attribute__’ before ‘init_rootfs’<br>
> int __init init_rootfs(void);<br>
> ^~~~~~~~~~~<br>
> /usr/src/linux/include/linux/init.h:285:13: error: expected ‘=’, ‘,’, ‘;’,<br>
> ‘asm’ or ‘__attribute__’ before ‘parse_early_param’<br>
> void __init parse_early_param(void);<br>
> ^~~~~~~~~~~~~~~~~<br>
> /usr/src/linux/include/linux/init.h:286:13: error: expected ‘=’, ‘,’, ‘;’,<br>
> ‘asm’ or ‘__attribute__’ before ‘parse_early_options’<br>
> void __init parse_early_options(char *cmdline);<br>
><br>
><br>
> The errors go on and on, but the majority look like that.<br>
><br>
> My code:<br>
><br>
> #include <linux/init.h><br>
> #include <linux/module.h><br>
><br>
> int main() {<br>
> return 0;<br>
> }<br>
><br>
><br>
> The compile command:<br>
> gcc -I /usr/src/linux/include/ main.c<br>
<br>
That's not how you compile a Linux kernel module, sorry.<br>
<br>
Please read the very good documentation for how to set up a Makefile for<br>
building a kernel module. It's in the kernel's Documentation/<br>
directory.<br>
<br>
best of luck,<br>
<br>
greg k-h<br>
</blockquote></div></blockquote></div></blockquote></div>