How to make a built-in device driver in linux

后端 未结 2 706
再見小時候
再見小時候 2021-01-29 09:02

I know how to make loadable kernel modules in Linux. But i want that loadable kernel module to be a part of the kernel , and after booting that driver should automatically load,

相关标签:
2条回答
  • 2021-01-29 09:59

    You have to configure modprobe to load automatically driver after kernel boot. Here an example of configuration.

    If you want to a built-in module, you must re-compile the kernel, and set Y in the configuration file on all modules that you want inside the kernel

    0 讨论(0)
  • 2021-01-29 10:05

    There are two ways to do for your query 1) building your module as statically compiled along with kernel(your source code should reside in kernel tree ),so while building build it static which come as a part of kernel, so when kernel boots your module will be loaded. 2)Same as above but while building build as dynamic loadable module so that wheneever required you can load it.

    to illustrate above concept you can try below link for simple helloworld example.

    http://www.agusbj.staff.ugm.ac.id/abjfile/Chap8.pdf

    0 讨论(0)
提交回复
热议问题