Fwd: My simple kernel module wont compile

Gustavo Bittencourt gbitten at gmail.com
Thu Sep 11 11:06:30 EDT 2014


Did you install the kernel source or at least the kernel headers?


---------- Forwarded message ----------
From: testlaster <testlaster at gmail.com>
Date: Thu, Sep 11, 2014 at 11:13 AM
Subject: Re: My simple kernel module wont compile
To: kernelnewbies at kernelnewbies.org


 Hi Gustavo

I tried your suggestions.

The first line didn't work because I seem to not have a build directory
there.
And the second one did exactly the same as mine did.


On 9/11/2014 3:49 PM, Gustavo Bittencourt wrote:

 Maybe you should replace the KERNEL_DIR definition in MAKEFILE. My
suggestions:

 KERNEL_DIR:=/usr/src/linux-headers-$(shell uname -r)/build
 or
KERNEL_DIR:=/lib/modules/$(shell uname -r)/build

On Thu, Sep 11, 2014 at 8:12 AM, testlaster <testlaster at gmail.com> wrote:

>  Hey Guys
>
> All im trying to do here is learn about make files and how to link linux
> header files stored in /usr/src/linux-headers-3.13.0-35-generic to my
> program that im writing.
> 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".
> 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.
> I will also have to edit registers of the PCI to be able to make triggers
> go off by setting bits high etc.
> But this is just an introduction to it all and im already having trouble
> compiling.
>
> Now im not 100% sure if its missing header files but the errors is quite
> large.
>
>  This is my Pastebin of the C MODULE Code :
>
>  pastebin.com/lWPBR8DJ
>
>  And here it the PASTEBIN of my MAKEFILE and its errors:
>
>  pastebin.com/ffT1F26N
>
> 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?
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


_______________________________________________
Kernelnewbies mailing
listKernelnewbies at kernelnewbies.orghttp://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140911/b9ba75a2/attachment-0001.html 


More information about the Kernelnewbies mailing list