2

I am trying to port my own driver to a Beagle board xm arm-cortex-A8. While porting I am trying to figuring out how the .ko file actually builds. In our Makefile we only have a command to build an.o file.

How is a .ko file built?

Using linux-2.6.38.8 kernel and trying to configure my driver for my kernel.

artless noise
  • 21,212
  • 6
  • 68
  • 105
user1584685
  • 21
  • 1
  • 2
  • 1
    @H2CO3: a more constructive comment would have been to point out that this is a possible duplicate of http://stackoverflow.com/questions/10476990/difference-between-o-and-ko-file ... but the pointer from artless noise below is a good addition to the answers there. – unixsmurf May 12 '13 at 22:11

1 Answers1

2

The kernel kbuild module document has lots of information on how to build an external module. If you have Raspberian or some other embedded ARM Linux, you will need to get the source package for your kernel. The process differs based on whether you are compiling on the same machine the module will run on, or if you are trying to build it on a PC (hopefully a Linux PC).

Please specify which way you need to build, if the kbuild module document doesn't explain things well enough.

artless noise
  • 21,212
  • 6
  • 68
  • 105
  • Someone just asked a question about [Cross compiling a module](http://stackoverflow.com/questions/16522637/how-do-i-cross-compile-a-single-module). That is the *different machine* part of this answer. – artless noise May 13 '13 at 14:02
  • hi thanks alot for the kbuild module document.. for further assistance I would like to add few more things like..... I am currently trying to put my driver in my kernel(linux-2.6.38.8) X86 Architecture using make menuconfig,make,modules-install and install and for this I have changed the Kconfig file in /usr/src/kernels/linux-2.6.38.8/drvers/char and also the Makefile present in the same directory.... On compilation the makefile is building .o file but I'm not exactly getting that how my .ko file will get generated and what need to be added for doing so ...Thank you – user1584685 May 13 '13 at 14:55
  • Please add your **additions** to *Kconfig* and the *Makefile* to your question. Also, the `.config` symbols **related** to the driver. Please try to edit to the relevant information (too much is better than too little though). – artless noise May 13 '13 at 15:12