<div dir="ltr">Did you install the kernel source or at least the kernel headers?<div><br></div><div> <div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">testlaster</b> <span dir="ltr"><<a href="mailto:testlaster@gmail.com">testlaster@gmail.com</a>></span><br>Date: Thu, Sep 11, 2014 at 11:13 AM<br>Subject: Re: My simple kernel module wont compile<br>To: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br><br><br>
<div bgcolor="#FFFFFF" text="#000000">
Hi Gustavo<br>
<br>
I tried your suggestions.<br>
<br>
The first line didn't work because I seem to not have a build
directory there.<br>
And the second one did exactly the same as mine did.<div><div class="h5"><br>
<br>
<div>On 9/11/2014 3:49 PM, Gustavo
Bittencourt wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div><span>Maybe
you should replace the </span><span>KERNEL_DIR
definition in MAKEFILE. My suggestions:</span></div>
<span>
<div><span><br>
</span></div>
KERNEL_DIR</span><span style="color:rgb(0,0,0);font-family:verdana,arial,sans-serif;font-size:11.199999809265137px;background-color:rgb(249,249,249)">:=/usr/src/linux-headers-$(shell
uname -r)/build<br>
</span>
<div><span>or</span></div>
<div><span>KERNEL_DIR</span><span style="color:rgb(0,0,0);font-family:verdana,arial,sans-serif;font-size:11.199999809265137px;background-color:rgb(249,249,249)">:=/lib/modules/$(shell
uname -r)/build</span><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Sep 11, 2014 at 8:12 AM,
testlaster <span dir="ltr"><<a href="mailto:testlaster@gmail.com" target="_blank">testlaster@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hey Guys<br>
<br>
All im trying to do here is learn about make files and how
to link linux header files stored in /usr/src/<span></span><span>linux</span><span>-</span><span>headers</span><span>-</span><span>3</span><span>.</span><span>13</span><span>.</span><span>0</span><span>-</span><span>35</span><span>-</span><span>generic</span>
to my program that im writing.<br>
So far ive been getting the simplest of Kernel Modules to
compile and load in Linux but nothing useful . The moment
I delve deeper I seem to get missing header file errors
when using "make".<br>
All I want to do is write from Kernel space into user
space and visa verse. I will be dumping allocated PCI
memory blocks into files.<br>
I will also have to edit registers of the PCI to be able
to make triggers go off by setting bits high etc.<br>
But this is just an introduction to it all and im already
having trouble compiling.<br>
<br>
Now im not 100% sure if its missing header files but the
errors is quite large.<br>
<br>
This is my Pastebin of the C MODULE Code :<br>
<br>
<a href="http://pastebin.com/lWPBR8DJ" target="_blank">pastebin.com/lWPBR8DJ</a>
<br>
<br>
And here it the PASTEBIN of my MAKEFILE and its errors:<br>
<br>
<a href="http://pastebin.com/ffT1F26N" target="_blank">pastebin.com/ffT1F26N</a><br>
<br>
ALSO...Does anybody know of a good tutorial on how to
write a PCI driver in Kernel space using kernel
modules...also how to send data from and to the module
from UserSpace?<br>
</div>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
Kernelnewbies mailing list
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a>
</pre>
</blockquote>
<br>
</div></div></div>
<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" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></div><br></div></div></div>