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
9
votes
1 answer
Best practice: Where to resample PCM and which tool?
I have developed a kernel module (Android) which provides me:
PCM
16-bit
48000 Hz
2 channel
and I want to stream it to an Apple's Airport Express (AEX) in java.
The AEX needs 44.1 kHz PCM so I have to resample the PCM-stream.
I have following…

Martin L.
- 3,006
- 6
- 36
- 60
8
votes
1 answer
Implementing correct inter-module synchronization in Linux kernel
I'm implementing a custom serial bus driver for a certain ARM-based Linux board (a custom UART driver, actually). This driver shall enable communication with a certain MCU on the other end of the bus via a custom protocol. The driver will not (and…

Roman Dmitrienko
- 3,375
- 3
- 37
- 48
8
votes
1 answer
Warning building a kernel module that uses exported symbols
I have two kernel modules (say modA and modB). modA exports a symbol with EXPORT_SYMBOL(symA) and modB uses it. I have the header modA.h for modA:
...
extern void symA(int param);
...
and in modB.c:
#include "modA.h"
...
static int __init…

MirkoBanchi
- 2,173
- 5
- 35
- 52
8
votes
3 answers
Kernel module: how to get console ouput?
I am writing a kernel module, and I want to be able to print something on the console output when loading it using insmod module.ko.
I tried using
printk(KERN_EMERG "test kernel emergency\n");
but nothing appears on my console. It does however…

Jens Nyman
- 1,186
- 2
- 14
- 16
8
votes
2 answers
Is there a way for a kernel module to find section addresses of another loaded module?
On an x86 system, I have a Linux kernel module ("watcher module") that gets notified by the kernel each time a particular kernel module ("target") is loaded. Almost any kernel module can be a target. I use this in an instrumentation system I am…

Eugene
- 5,977
- 2
- 29
- 46
8
votes
1 answer
What is OE+ in Linux?
What is the meaning of (OE+) in the following?
$ sudo cat /proc/modules | grep hello //hello_world is a kernel module created by me.
hello_world 20480 1 - Loading 0xffffffffc0221000 (OE+)
Here is my situation.
I have patched the Linux kernel…

Sahil Singh
- 3,352
- 39
- 62
8
votes
1 answer
How does "get_user_pages" work (For linux driver)
Working on a Linux PCI driver, now I'm trying to write codes for DMA using scatter/gather.
For now, I've learned that to access to DMA datas directly from User space, we need to pin user space pages to kernel space.
And to do this, we have…

Cong Li
- 369
- 2
- 5
- 13
8
votes
1 answer
Yocto: Adding kernel module recipe to image, but it doesn't load on boot
For testing purposes, I am using the example recipe provided by yocto to demonstrate how to build kernel modules.
SUMMARY = "Example of how to build an external Linux kernel module"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM =…

Paul Knopf
- 9,568
- 23
- 77
- 142
8
votes
2 answers
Linux Kernel Module/IOCTL: inappropriate ioctl for device
I am in the process of writing a Linux Kernel Module (LKM) serving as a pseudo-driver - I am unable to figure out how to make IOCTL calls between the LKM (wait.c) and the user-level program (user.c).
The magic number for the device driver is 0xBF -…

Tyler
- 283
- 1
- 3
- 12
8
votes
2 answers
How do I use a Linux System call from a Linux Kernel Module
I am having some difficulty calling a system call from inside a Linux Kernel Module. The system calls have been tested and work properly from a standard c user space program but I can't seem to get the kernel module to compile and run them.
In my…

dimlee
- 452
- 1
- 10
- 22
8
votes
1 answer
Why must I use gnu99 instead of c99 to compile a kernel module?
I am used to using -std=c99 to enable c99 features when compiling application code.
Recently I have been following some basic kernel module examples, and added ccflags-y := -std=c99 to the makefile. However this resulted in 17K lines of errors when…

jsj
- 9,019
- 17
- 58
- 103
8
votes
2 answers
Compiling out-of-tree kernel module against any kernel source tree on the filesystem
I am trying to compile a module against any source tree on the file system but I am having trouble with the Makefile. This was the original Makefile I had against the kernel specified:
obj-m += new-mod.o
all:
make -C /lib/modules/$(shell…

Chris Fritz
- 281
- 2
- 4
- 14
8
votes
2 answers
How to filter and intercept Linux packets by using net_dev_add() API?
I'm writing ethernet network driver for linux. I want to receive packets, edit and resend them.
I know how to edit the packet in packet_interceptor function, but how can I drop incoming packets in this function??
#include…

Milad Khajavi
- 2,769
- 9
- 41
- 66
8
votes
2 answers
Make a system call to get list of processes
I'm new on modules programming and I need to make a system call to retrieve the system processes and show how much CPU they are consuming.
How can I make this call?

douglasd3
- 761
- 2
- 10
- 27
8
votes
3 answers
Getting message "module license 'unspecified' taints kernel " despite setting MODULE_LICENSE
I'm currently trying to run a kernel module. This module seems to work fine on various Linux machines, however, when I attempt to run it on a specific machine (namely, CentOS with a kernel version of 2.6), the module fails to start, claiming that I…

Ori Osherov
- 484
- 1
- 6
- 15