ok I'm trying to compile a simple kernel module, when I point to any of the below that contain includes, it complains about all kinds of stuff.
linux-headers-2.6.31-21 linux-headers-2.6.31-22
linux-headers-2.6.31-21-generic linux-headers-2.6.31-22-generic
linux-headers-2.6.31-21-generic-pae linux-headers-2.6.31-22-generic-pae
I'm attempting to follow the instructions on the following site: http://www.faqs.org/docs/kernel/x145.html
I updated the make file to look like this:
TARGET := hello_world
WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
INCLUDE := -isystem /usr/src/linux-headers-2.6.31-22-generic/include
CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC := gcc
${TARGET}.o: ${TARGET}.c
.PHONY: clean
clean:
rm -rf ${TARGET}.o
for example when I type in make I get the following error as well as many more, investigating the folders I see that the processor and cache files are in asm-generic, how in the world am I supposed to compile this if it's not pointing at the right locations of the files?
/usr/src/linux-headers-2.6.31-22-generic/include/linux/prefetch.h:14:27: error: asm/processor.h: No such file or directory
/usr/src/linux-headers-2.6.31-22-generic/include/linux/prefetch.h:15:23: error: asm/cache.h: No such file or directory
The ultimate goal (scary) is building a virtual file system, by thursday....(yea I know it's pretty unlikely) I understand some of the make file, but oddly enough I expected that I should see something like ${CC} ${INCLUDE}, things like this, but I don't see that at all,
Can someone explain and/all of the following questions?
What do I need to update my include to so it knows the right directory (and if it's something like what kernel I'm using etc, please explain how I can figure this out).
Can someone explain how the makefile knows to call gcc and compile?
Is there anything else I need to know to get this thing to compile?
-- Bonus question
- Anyone know any REALLY detailed tutorials about how to build a VFS, I have a project we were assigned that another school did, http://oslab.info/index.php/Labs/HW4, and based on the limited programming we've done before this, it is appearing to be a monumental task.