How to use a Makefile?
I am a beginner in Linux. Never did any kernel programming in Linux/Windows before. I am now on a project and I am supposed to understand a Linux Device Driver Code. It contains 6 .c files and 1 Makefile. The make file goes as this:
obj-m := X.o
X-objs := a.o b.o c.o d.o e.o f.o
I have a.c b.c c.c d.c d.c e.c f.c in the director along with the Makefile mentioned.
I am using Fedora Red Hat Linux 32 bit.
Please suggest me how to compile the Makefile.
You don't compile a Makefile. It isn't code, it's just a set of instructions for the make command. Try typing make and see what happens.
I compiled my driver successfuly. I have also installed zlib package since my driver depends on it.
While I try to insert my module (insmod X.ko), I get an error saying "Error inserting "X.ko" : -1 Unknown symbol in module" . What am I supposed to do? I tried several ways showin in google. None of them improved my results.
Can you guys pull me out?
I think you use the module name without the .ko suffix. And it's better to use modprobe rather than insmod as it works more intelligently, pre-inserting any other modules on which yours depends.