Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everyone,
I am writing a very simple kernel module that is available on the net.
But while compiling it I am getting the error for include files.
Can anyone please tell me what is the procedure for include files for kernel modules.
It would be really helpful if I get an example or a link I can get to learn about include files and kernel module programming starting from basics.
Well what is the exact error? What is your code? What does the module do? What are the lines that are erroring? What command are you using to compile? How much do you already understand about kernel development?
I know C programming by the way.
The Module I got only have printk in the init_module() and that in cleanup_module().
as i said i got it from the net.
It has a include file named uaccess.h
It is not getting this file.
I dont know where exactly the kernel module needs its include files.
Is there any specific location.
I am compiling it using gcc.
and then using a Makefile for making a .ko .
Which I suppose then will be inserted as a module using "insmod"
and removed using "rmmod"
If there is any other way to do it please tell me.
I am reading Linux Kernel Module Programming .pdf O'reilly 2nd edition.
I've never used Red Hat, but you should be able to search for and install them via your package manager. Look for "linux kernel headers", they're the include files needed for building modules.
I am using Red Hat Enterprise 4.
I am new to this. Pardon me but,
what is Kernel headers?
Almost any C program relies on information stored in header files (xxx.h). If the program is going to interface with the Linux kernel, then it needs the header files that were used to compile the particular version of the kernel in use. (These are the "kernel headers")
If you install the full source code for the kernel, you will get the headers automatically. Or--you can typically install only the headers.
I have the kernel headers on my system, but their is no "uaccess.h"----BUT: This Google search suggests strongly that "uaccess" has nothing to do with the kernel: http://www.google.com/search?q=uacce...ient=firefox-a
Please tell us if what you are doing is related to anything in that google search.
I have the kernel headers on my system, but their is no "uaccess.h"----BUT: This Google search suggests strongly that "uaccess" has nothing to do with the kernel:
You have now exceeded my knowledge and understanding.....
"uaccess.h" does not exist on my system---I don't know if that is related to the fact that I have the kernel headers, but not the sources.
I think there is more than one module on the net, like three or four, so perhaps you could link us? Paste it in?
This bears repeating. Can you please give a link to where you're getting this module so that there is at least some context to what you are trying to accomplish.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.