4

I can build a loadable module and it is working with the application successfully. Now I'm trying to include this driver in kernel driver folder as a built-in driver. But when i tried this, there is no device file created in /dev folder. What are the necessary steps to do this built-in module ? Is there any modification needed in the existing module ?

Thanks in advance

Bruce
  • 7,094
  • 1
  • 25
  • 42
Premjith
  • 1,128
  • 1
  • 11
  • 21

2 Answers2

5

I believe your question is similar to the question Compiling a driver as a part of a kernel, not as a module

The answer to that question mentioned modifying the kernel Makefiles to include your module object or directory.

In summary the steps are:

  1. Copy your driver source code directory under <linux kernel src>/drivers.
  2. Edit the Makefile to add the line:

    obj-y += your_driver_dir

  3. Edit the Makefile in your driver directory to add the line:

    obj-y := your_driver.o

Community
  • 1
  • 1
0

If you would like to include your module into your kernel modules (not building), you need to copy yourmodule_file.ko under /lib/modules/$(uname -r)/ and give the command depmod -a, after this you can load your module with modprobe.

devnull
  • 118,548
  • 33
  • 236
  • 227
c4f4t0r
  • 1,563
  • 15
  • 24