How Do I Compile a Linux Module?
Contents

How do you compile a module?

How to compile and run your own kernel modules

  1. Modify the makefile by replacing every occurrence of helloWorld and kernelRead by the names of the modules you wish to create.
  2. compile the modules by running make in the directory where the modules reside. …
  3. Now become superuser by typing. …
  4. Insert module into the running kernel by typing.

28 февр. 2008 г.

How do I create a Linux module?

The command to build an external module is:

  1. $ make -C <path_to_kernel_src> M=$PWD.
  2. $ make -C /lib/modules/`uname -r`/build M=$PWD.
  3. $ make -C /lib/modules/`uname -r`/build M=$PWD modules_install.
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest