How to insmod modules and mknod device nodes in NXP YOCTO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to insmod modules and mknod device nodes in NXP YOCTO

跳至解决方案
815 次查看
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 项奖励
回复
1 解答
637 次查看
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 项奖励
回复
1 回复
638 次查看
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 项奖励
回复