How to insmod modules and mknod device nodes in NXP YOCTO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to insmod modules and mknod device nodes in NXP YOCTO

Jump to solution
459 Views
sibingl
Contributor I

iMX93-11x11-evk board I'm using, recently I checked the rtc(pcf2131) module(gpio28 & gpio29 pinmux as I2C3 SCL & SDA), found no device_create interface to create device node. So I think that there exists someplace to execute the commands: insmod/modprobe & mknod, but I've not found now yet, and no corresponding docs/weblinks found from internet.

I excuted cmd: grep -irn "mknod" & grep "insmod" in the sources dir, no results returned

So pls support me some clues or referenced docs/weblinks to help me out.

0 Kudos
Reply
1 Solution
281 Views
jennie258fitz
Contributor II

Let’s explore how to handle kernel modules (drivers) and device nodes on your i.MX93-11x11-evk board. I’ll provide guidance on using insmod, modprobe, and creating device nodes.

Kernel Modules (Drivers):
Kernel modules extend the functionality of the Linux kernel. They allow you to add support for new hardware, filesystems, or system calls.
The insmod and modprobe commands are used to insert and manage kernel modules.
Using insmod:
The insmod command inserts a module into the running kernel.
Example:
sudo insmod /path/to/module.ko

Replace /path/to/module.ko with the actual path to your module file (.ko).
Using modprobe:
modprobe is more powerful than insmod. It automatically resolves module dependencies.
Example:
sudo modprobe module_name

Replace module_name with the name of your module (without the .ko extension).
Creating Device Nodes (mknod):
Device nodes are special files in the /dev directory that represent devices.
To create a device node, use the mknod command.
Example:
sudo mknod /dev/mydevice c 123 0

This creates a character device node named /dev/mydevice with major number 123 and minor number 0.
Documentation and References:
Unfortunately, I couldn’t find specific documentation or weblinks related to the i.MX93-11x11-evk board.
However, you can refer to general Linux documentation on kernel modules and device nodes:
Linux Kernel Module Programming Guide
Linux Device Drivers
Best Regards,
aarp-membership

View solution in original post

0 Kudos
Reply
1 Reply
282 Views
jennie258fitz
Contributor II

Let’s explore how to handle kernel modules (drivers) and device nodes on your i.MX93-11x11-evk board. I’ll provide guidance on using insmod, modprobe, and creating device nodes.

Kernel Modules (Drivers):
Kernel modules extend the functionality of the Linux kernel. They allow you to add support for new hardware, filesystems, or system calls.
The insmod and modprobe commands are used to insert and manage kernel modules.
Using insmod:
The insmod command inserts a module into the running kernel.
Example:
sudo insmod /path/to/module.ko

Replace /path/to/module.ko with the actual path to your module file (.ko).
Using modprobe:
modprobe is more powerful than insmod. It automatically resolves module dependencies.
Example:
sudo modprobe module_name

Replace module_name with the name of your module (without the .ko extension).
Creating Device Nodes (mknod):
Device nodes are special files in the /dev directory that represent devices.
To create a device node, use the mknod command.
Example:
sudo mknod /dev/mydevice c 123 0

This creates a character device node named /dev/mydevice with major number 123 and minor number 0.
Documentation and References:
Unfortunately, I couldn’t find specific documentation or weblinks related to the i.MX93-11x11-evk board.
However, you can refer to general Linux documentation on kernel modules and device nodes:
Linux Kernel Module Programming Guide
Linux Device Drivers
Best Regards,
aarp-membership

0 Kudos
Reply