0

I'm using Ubuntu 10.10 and the installed kernel for driver programming. In rubini's book it is mentioned to create a .o file from a .c file, but I'm not getting it. it uses obj-m := eg_drv1.o, but when I try and build the .c file I get this:

error: make: *** No targets. Stop.

I'm completely confused. First question I have is how do I convert a .c file to .o file and then to .ko file to use the module?

0

1 Answer 1

2

Here is a nice article about 'Compile Linux kernel modules' http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html

Just go through it. It contains an example just give it a try.

Hope this helps

UPDATE: I have just tried and found that copy and paste is not working. I have to manually enter the contents of Makefile to work it out. Anyway it works fine. Just try and let us know the result.

2
  • 1
    The issue with copy/paste and Makefiles is that makefile rules lines must start with \t (tabs), when you use copy/paste from the web those tabs are pasted as spaces breaking the syntax. Dec 1, 2010 at 15:36
  • @João Pinto: Yes you are absolutely right.
    – aneeshep
    Dec 2, 2010 at 4:48

You must log in to answer this question.