How to compile a .o file into a Linux kernel module (.ko) file?

  • I am writing code. For example, test.c I plan to compile it into a test.o file and provide a header file.
  • Then I deliver this .o file to another programmer, he writes a Linux kernel module, for example driver.ko .

My question is: can it include my .o file in its .ko? How to write a make file? Is there any special requirement when compiling my .o file? Many thanks.

+4
source share
1 answer

This link shows how to create a kernel module with source code spanning multiple files. http://linux.die.net/lkmpg/x351.html

+3
source

Source: https://habr.com/ru/post/1399915/


All Articles