Linux Device Driver code to load another module

Linux Kernel code can load module whenever needed.

int request_module(const char *module_name);

Header File: <linux/kmod.h>

Source Code: kernel/kmod.c

request_module is synchronous, it will sleep until the attemp to load the module has been completed.

When the kernel code calls request_mode(), a new kernel thread is created, which runs modprobe program in the user context.

Code:



Output:





Comments

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig