A kernel module is a run-time loadable object file that is loaded into operating system kernel to add functionality to a running kernel. Examples include device drivers and other kernel items.
Questions tagged [kernel-module]
2228 questions
0
votes
1 answer
Android adb command to get device driver in device?
In android device, I am searching command or way to check all kernel modules/drivers in current device.
so, can we get all kernel module list from command line ?
Command to list all kernel module/driver for static + run time modules.
like lsmod

R_K
- 803
- 1
- 7
- 18
0
votes
1 answer
Unable to compile kernel module: no .ko file output
I've built an android kernel (source code), now I'm trying to cross-compile a kernel module for it, v4l2loopback to be precise. I've used this toolchain to build the kernel (kernel version is 4.9).
Here on github you can see that someone actually…

winwin
- 958
- 7
- 25
0
votes
1 answer
Unknown symbol devm_input_allocate_polled_device
Trying to load kernel module on Raspberry Pi 4.
root@raspberrypi:/home/pi# uname -r
5.4.79-v7l+
root@raspberrypi:/home/pi# insmod i2c_rpi4_accel.ko
insmod: ERROR: could not insert module i2c_rpi4_accel.ko: Unknown symbol in module
Trace:
[ …

Alex F
- 42,307
- 41
- 144
- 212
0
votes
1 answer
How to trigger fops poll function from the kernel driver
I am working on a kernel driver which logs some spi data in a virtual file using debugfs.
My main goal is to be able to "listen" for incomming data from userspace using for example $ tail -f /sys/kernel/debug/spi-logs which is using select to wait…

Mihai
- 972
- 2
- 13
- 35
0
votes
0 answers
sysfs_store sscanf u8 from buffer not working correctly
// userspace
uint8_t value = 5;
write (fd, (const char *)&value, 1);
// kernel driver
static ssize_t sysfs_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
u8 val;
sscanf(buf, "%hhu" , &val);
//…

ruke
- 55
- 5
0
votes
0 answers
How to Send a Value to Another Driver's Sysfs Attribute
This is all in Linux 4.14.73. I'd upgrade if I could but I cant.
I'm trying to trigger an LED flash in a standard LED class instance from another kernel space driver. I know all about the "bad form" of not accessing files from Kernel Space so I…

jemiah
- 63
- 8
0
votes
1 answer
kernel module - how to make that my module upload automatically at boot time?
I'm using a centos 8. I made a module where every time the module goes up it prints "Hello World" and every time the module goes down it prints "Goodbye".
How do I make the module load automatically during boot?
#include
#include…

Jonatan Haish
- 9
- 3
0
votes
1 answer
Perf cannot use symbol from kernel module
I want to trace a kernel module I've written using Intel PT but I can not get perf to recognize symbols from my kernel modules. For the sake of simplicity, I tried tracing a module that periodically prints a string to the log, using perf record -e…

Can Cebeci
- 1
- 2
0
votes
1 answer
Build kernel module in CentOS 7 with changed API
I write NIC module driver and implement it base functions like ndo_open, ndo_stop, ndo_start_xmit...
Sometimes Linux Kernel API is changed in the recent versions. So macro like LINUX_VERSION_CODE helps adopt code of the module to recent Linux Kernel…

Yurij Goncharuk
- 159
- 1
- 11
0
votes
1 answer
What is causing this error: SSE register return with SSE disabled?
I'm new to kernel development, and I need to write a Linux kernel module that performs several matrix multiplications (I'm working on an x64_64 platform). I'm trying to use fixed-point values for these operations, however during compilation, the…

kelos
- 15
- 5
0
votes
1 answer
How can I prepare a Linux source tree so an external module can be compiled against it?
I am keeping a WIFI driver alive by patching compilation errors for new Kernel versions. I can build it against a source tree, so I do not have to boot the kernel for which I want to fix it.
Unfortunately for this I have to fully compile the entire…

Max Görner
- 674
- 7
- 16
0
votes
0 answers
Procfs file vs Device file in Embedded Linux driver development
i am planning to develop a device driver for a custom board.
as my research went on , I encounter two main ways to develop a driver . the device file which uses structures and another one was using pro which i can work with registers directly ,…

S2G
- 121
- 7
0
votes
0 answers
Linux kernel module programming - hooking to sys_wait4 system call
I try to do hooking to system call sys_wait4 and every time I try to do rmmod to module the kernel crashes.
This is my code.
void **sys_call_table;//pointer for the system call's table
typedef asmlinkage long (*sys)( struct pt_regs * );
sys…

Jonatan Haish
- 9
- 3
0
votes
1 answer
Make via Makefile fails but from command line is successful
I'm trying to build an out-of-tree module against a downloaded kernel tree.
My Makefile looks like this:
obj-m += userModule.o
ARCH := arm
CC := arm-linux-gnueabihf-
KERN_DIR := /home/user/Downloads/beaglebone-linux-5.10/
CD :=…

Yaniv G
- 307
- 4
- 11
0
votes
1 answer
Is there any way to detect packet direction in the PRE_ROUTING hook point
I'm trying to create a firewall in C as a linux kernel module. as part of the firewall, I've implemented a hook function which performs packets inspection inside the PRE_ROUTING hook point.
In the hook function I need to deduce the packet direction…

Amit Gabay
- 106
- 2
- 10