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
5
votes
2 answers
How do I use performance counters inside of the kernel?
I want to access performance counters inside the kernel. I found many ways to use performance counters in user space, but can you tell me some way to use those in kernel space.
Please don't specify tool name, I want to write my own code, preferably…

A-B
- 487
- 2
- 23
5
votes
2 answers
Module not found: modprobe
I have written a simple hello world kernel module, compiled it and install in /lib/modules/kernel_version/extra/ path.
With insmod its getting loaded properly, but with modprobe i am getting an error
modprobe: FATAL: Module hello_world.ko not…

Usr1
- 369
- 1
- 6
- 15
5
votes
2 answers
BeagleBone Black interrupts through kernel driver
I'm trying to work with interruptions but I get the following error, due to ioread32.
As I have seen in the chapter "25.3.3 Interrupt Features" of "AM335x SitaraTM Processors - Technical Reference Manual"
In order to generate an interrupt request to…

Manuel Egío
- 173
- 1
- 9
5
votes
1 answer
Driver code in kernel module doesn't execute?
Why this kernel module doesn't do anything when i load it?
#include
#include
#include
#define DEVICE_NAME "hello-1.00.a"
#define DRIVER_NAME "hello"
MODULE_LICENSE("Dual BSD/GPL");
static…

Luca
- 1,270
- 1
- 18
- 34
5
votes
2 answers
Netlink Multicast Kernel Group
The task I am trying to achieve is actually quite simple (multicast the string "TEST" to a userland daemon), but the kernel module doesn't compile. It stops with the error:
passing argument 4 of ‘genlmsg_multicast_allns’ makes integer from pointer…

user4122787
- 51
- 1
- 4
5
votes
1 answer
Listening for new Processes in Linux Kernel Module
Is it possible to get notified (via callback or similar) when a new process is executed, when one is closed, and when state changes (ie. stopped, paged, etc)? In user-land, it would be easy to set up a directory listener on /proc.

MarkP
- 4,168
- 10
- 43
- 84
5
votes
1 answer
perf cannot find external module symbols
When running perf it finds the kernel symbols and symbols of my program but it does not find external module symbols. I have written a kernel module which I load using insmod how can I tell perf to find its symbols as well?
I am running a 2.6.37.6…

hlitz
- 635
- 6
- 24
5
votes
2 answers
How to compile module with new kernel in Linux
After switching to Ubuntu 13.10 I need to compile a device driver for that newer kernel. Calling make results in 2 errors:
error: implicit declaration of function ‘kzalloc’
error: implicit declaration of function ‘kfree’
The same make command runs…

alex
- 2,464
- 23
- 32
5
votes
2 answers
How to make one Linux kernel module depend on another external module with depmod?
I'm writing a kernel module which depends on one existing kernel module. I'm building my module out of the tree (as an external module).
How can I declare the dependency, so that it is recognized by depmod?

luis tavares
- 51
- 1
- 2
5
votes
0 answers
Are there ways in Android to create a virtual Bluetooth headset besides hacking kernel drivers?
Actually, this begins with following question:
Can I create a virtual Bluetooth headset to manipulate call stream?
I'm sure this can be done by replacing kernel module for Bluetooth with something made-up. So Virtual bluetooth device on Android?…

kagali-san
- 2,964
- 7
- 48
- 87
5
votes
3 answers
Access data from proc file within kernel module
I need to access some proc files in a module on Android kernel.
Basically i need the info shown in cat command, like cat /proc/uptime. However i need to do it programmatically.
I tried work with proc_fs functions, but it was just a little fuzzy for…

douglasd3
- 761
- 2
- 10
- 27
5
votes
2 answers
set thread affinity in a linux kernel module
as most C programmers know libc gives a non portable functions for thread cpu affinity tuning (pthread_attr_setaffinity_np()). However, what I do not really know is how can this be done when implementing a kernel module. Any answer that mentions or…

user1533288
- 291
- 3
- 6
5
votes
1 answer
insmod failing to insert a really simple module
I'm trying to compile and insert a module into my kernel, but I keep getting this error:
insmod: error inserting 'hello.ko': -1 Invalid module format
I followed the steps described in this tutorial over…

Bilthon
- 2,461
- 8
- 36
- 44
5
votes
1 answer
Get file name/path from a file descriptor from a Linux kernel module?
In a linux kernel module is there a way to get a file name/path from an unsigned int fd?
I'm aware of this answer: How can I get a filename from a file descriptor inside a kernel module? but if I understand the code right, I need a struct…

alexandernst
- 14,352
- 22
- 97
- 197
5
votes
0 answers
timekeeping initialization gives any indication?
I am using getnstimeofday in console_unlock function, which gets called very early during initialization. So early that even timekeeping will not be initialized so as to use getnstimeofday.
Is there any way to identify the precise moment to start…

prasanna
- 51
- 5