2

I have added mychardev driver to a custom kernel 5.6.2 , when I go through the menu config my driver is visible in the drivers' folder. I then have created kconfig , makefile driver files.

I have compiled and loaded the kernel, but my character driver is not loaded, I checked it with lsmod.

How do I create a device file automatically i.e when I load a kernel module device file I need it to be present in the /dev directory

reymon359
  • 1,240
  • 2
  • 11
  • 34
  • Does [that](https://stackoverflow.com/questions/8697300/how-to-create-a-device-in-dev-automatically-upon-loading-of-the-kernel-module-f) help ? – ignacio May 17 '20 at 20:45
  • @ignacio, no it won't. To OP: Strictly speaking it's not possible by design. From user space there is no way to avoid it, but hide (udev or other user space module helper will do it for you by utilizing `query_module()` system call). From kernel you may call `request_module()` which calls user space helper anyway. – 0andriy May 18 '20 at 18:12
  • @ignacio, no it won't (okay, *udev* rule is the right direction, but it's not what title of this Q asks for). – 0andriy May 18 '20 at 18:19
  • @RoopakTech So, I recommend to clarify your question in the title and body of the Q that everybody understands what you want. – 0andriy May 18 '20 at 18:20

0 Answers0