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
0 answers
How to compile ANY Linux kernel module
If I try to compile ath.ko module like this
root@debian:~/linux-5.13.19# make M=$(pwd)/drivers/net/wireless/ath modules
it works.
But if I try to compile iwlwifi.ko module the same way, it fails
root@debian:~/linux-5.13.19# make…

Chris
- 1,213
- 1
- 21
- 38
0
votes
1 answer
Whats wrong with the DB query code in Console Kernel in Laravel PHP?
I'm trying to figure out why the DB query is not being executed at all. I did everything according to the documentation, but it doesn't work. I run this code in a controller and everything works great. Below is the code that I wrote in the kernel…
0
votes
0 answers
Detecting maximum memory bandwidth at kernel level
I'm looking for a way to detect the maximum memory bandwidth at the kernel level in Linux. There are some ways to measure the memory bandwidth that each task is using, however, I couldn't find a way that estimates the total memory bandwidth of the…

Mohammad Siavashi
- 1,192
- 2
- 17
- 48
0
votes
0 answers
wpanusb kernel module: unable to find memory leak in probe function (USB)
I'm using wpanusb kernel module with kernel 4.14.112 on a Raspberry Pi to send IEEE802.15.4 frames over USB to a nrf52840 MCU running wpanusb from samples of Zephyr OS. The kernel module I use comes from this repo :…

Carton_
- 23
- 3
0
votes
1 answer
Kernel module on cross-compile kernel: /bin/sh: 1: scripts/basic/fixdep: Exec format error
I'm doing some experiment on rpi4, and trying to reproduce this kernel module from github https://github.com/sysprog21/dont-trace on my rpi4. I encounter this problem:
make -C /lib/modules/`uname -r`/build M=/home/ubuntu/dont-trace modules
make[1]:…

yenWu
- 46
- 5
0
votes
1 answer
RTNETLINK answers: Argument list too long
I backported mcp251xfd CAN driver for v4.9
I can see now can0 in ifconfig but when I do:
$ sudo ip link set can0 type can bitrate 125000
$ sudo ip link set up can0
I get the following:
RTNETLINK answers: Argument list too long
It comes from the…

acho
- 11
- 4
0
votes
0 answers
->probe() is not called after `i2c_new_client_device()`
My scenario is the following: From an out-of-tree kernel module A, I want to create a new I²C device B when some event happens in A.
From what I understand from the kernel I²C documentation, I would then expect that ->probe() function of the driver…

Ulrich Sørensen
- 1
- 1
0
votes
1 answer
Loading shared object to specific processes in Linux
I want to load a shared object to certain processes, there are certain conditions that are required:
Loading to only specific processes and not all of them;
It has to be done before the process code starts executing;
The processes are not…

ALsec
- 11
- 2
0
votes
1 answer
mcp251xfd test driver crashes
Edit: It works now,
https://github.com/minima34/mcp251xfd_test
I wrote my first linux module using SPI to just test mcp2158fd chip writing and reading the OSC register but it bugs my system on run and I can't unload it with modprobe -rf or rmmod…

acho
- 11
- 4
0
votes
1 answer
How can I clear or erase all allocations from kmem_cache in a kernel module
I'm developing a module in kernel that uses kmem_cache. While developing and testing, it's possible that something goes wrong or I want to quit the module while there are still some allocations from the cache that weren't freed.
Calling…

hfingler
- 1,931
- 4
- 29
- 36
0
votes
0 answers
Is it possible that any Userspace application can call our driver routines without opening the /dev interface node
Suppose I have implemented file_operations such as read, write, open, release, flush etc. and I wrote userspace application which calls these routines. In character driver, Userspace application communicate through /dev interface node.
for example -…

shashank arora
- 1,176
- 11
- 14
0
votes
0 answers
Why execute iowrite32() after ioread32() from an register in ccp driver included in kernel?
It's in drivers/crypto/ccp/ccp-dev-v5.c.
ccp is coprocessor used for crypto. ccp5_irq_bh() is an interrupt handler function.
Now that status is read from that register, why write it again below? That doesn't make sense.
Code is:
static void…

HnlyWk
- 23
- 5
0
votes
0 answers
How to compile linux-kernel-module using clang
I want to build my Linux kernel module (character driver) using clang with the following Makefile
My-Makefile:
System
Ubuntu: 22.04 LTS
kernel: 5.15.0-41-generic
clang version: 14
I tried using the command:
make CC=clang-14…

Rider X
- 1
- 1
0
votes
1 answer
kernel customisation using menuconfig with Yocto
Hope you all are doing well
I'm working with the Yocto project having dunfell branch
As a hardware perspective, I'm using STM32MP1dk1 board with meta-st-stm32mp layers
My ultimate goal is to generate the custom image via enabling some drivers using…
0
votes
2 answers
Linux driver for an emulated SPI device without DT/ACPI info
The vast majority of real SPI devices are platform-specific, and provide some means for automated discovery/enumeration (usually via Device Tree or ACPI). I need to write a kernel module for a dummy SPI device which doesn't have any…

random69579
- 41
- 3