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
10
votes
1 answer
Two kernel modules, each uses netlink socket. How to use them both at the same time?
Good day. I would like to create two (almost same) modules - each module uses netlink socket and replies to the incoming message from userspace program.
During the initialization of the first module, it executes the following command…

Jake Badlands
- 1,016
- 3
- 23
- 46
10
votes
3 answers
Intercepting a system call
I have been trying to intercept the system call at the kernel level. I got the basic idea from this question . The system call I was trying to intercept was the fork(). So I found out the address of the sys_fork() from System.map and it turned out…

PaulDaviesC
- 1,161
- 3
- 16
- 31
10
votes
1 answer
Can't Unload Kernel Extension; Classes Have Instances
I'm writing an OSX kernel extension for an audio device driver (it's software, but emulates a hardware device).
During development, it'd be convenient to completely uninstall existing old versions and then build and install the new version from…

pje
- 21,801
- 10
- 54
- 70
10
votes
1 answer
Trying to find all the kernel modules needed for my machine using shell script
I'm developing kernel modules right now, and the build times are starting to get under my skin. As a side effect I'm taking way too many "coffee" breaks during builds.
So I was looking for a way to build only the stuffs I need for my platform.…

Aftnix
- 4,461
- 6
- 26
- 43
10
votes
2 answers
How does the Linux kernel determine the order of __init calls?
There are many instances of __init calls in kernel both in drivers module_init and other functions of kernel. My doubt is how exactly kernel determines the sequence of the __init call. More importantly, How it also determine the sequence of driver…

0x07FC
- 523
- 1
- 6
- 33
9
votes
1 answer
Compiling a driver as a part of a kernel, not as a module
I am trying to create a minimalistic Linux for an embedded device. That means the necessity of compiling kernel and drivers. One driver is written directly for the device's board by it's creator, so it is not a repository one. It can be compiled as…

Rusty Horse
- 2,388
- 7
- 26
- 38
9
votes
1 answer
What Linux driver subsystem/API is used for a simple screen/monitor device?
I am developing an embedded system with a touchscreen. The touchscreen operates as both input and output, with a "virtual" keyboard overlaying the graphical output.
I have a working device driver that reads input from the touch sensor and translates…

memtha
- 797
- 5
- 24
9
votes
13 answers
Linux: modpost does not build anything
I am having problems getting any kernel modules to build on my machine. Whenever I build a module, modpost always says there are zero modules:
MODPOST 0 modules
To troubleshoot the problem, I wrote a test module (hello.c):
#include …

waffleman
- 4,159
- 10
- 39
- 63
9
votes
5 answers
Base address at which the linux kernel is loaded
I have a couple of doubts about how the kernel is loaded into memory. Upon inspecting /proc/kallsyms I'm able to find the address of various symbols in the kernel.
$ cat /proc/kallsyms | head -n 10
00000000 t __vectors_start
80008240 T…
user277465
9
votes
1 answer
Pool of Memory in Kernel driver for Multiple processes
Suppose we want to maintain a pool of memory in a device driver or module. How can that pool be created and be available to multiple processes lets say 4 processes, accessing this driver/module.
Assume 1 MB of memory in the pool.
When I was reading…

RootPhoenix
- 1,626
- 1
- 22
- 40
9
votes
1 answer
Linux Kernel - Get last written memory block
In the linux kernel, are there any data structures that automatically always hold the last written block number for a partition? I can't find any built-in kernel source that could be used to get this information. Any help is appreciated.

NTek
- 131
- 1
- 5
9
votes
3 answers
error: implicit declaration of function 'create_proc_read_entry' [-Werror=implicit-function-declaration]
I'm trying to compile a kernel module on kernel 3.13 and I get this error:
error: implicit declaration of function 'create_proc_read_entry' [-Werror=implicit-function-declaration]
I google it and did not found any response. Here is the part of the…

scof007
- 415
- 2
- 9
- 15
9
votes
2 answers
MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined error
I am trying to build kernel for AOSP 4.4.2 for a device. When I compile the kernel I get
build/core/base_rules.mk:134: *** vendor/google/libs:
MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined by external/jpeg. Stop.
I understand that the…

ChanChow
- 1,346
- 7
- 28
- 57
9
votes
3 answers
kernel config file location in android
I need to compile custom kernel with dvb-t drivers as kernel modules on _rkm mk602_ android device with rk3066 processor.
I have downloaded the kernel source for this processor, however I am having trouble configuring kernel for this device from…

Dreamo
- 139
- 1
- 2
- 9
9
votes
5 answers
System call interception in linux-kernel module (kernel 3.5)
I need to replace a standard system call (e.g. SYS_mkdir) with my own implementation.
As I read in some sources, including this question on Stackoverflow, the sys_call_table is not exported symbol since kernel version 2.6.
I tried the following…

Alex
- 9,891
- 11
- 53
- 87