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
Same device node for different devices: changing the value of one node will affect another - how to fix it?
I have one question about Linux kernel device node ,the nodes example created are in the same class with different devices but the node names are the same. If I change the value of one node, another will be changed also: How to prevent…

Michael Chen
- 1
- 1
0
votes
0 answers
Linux Kernel Module dev_get_drvdata Function Always Returns NULL
I have the following kernel module probe function (simplified to show the relevant parts):
static int qnap_ec_probe(struct platform_device* platform_dev)
{
// Allocate memory for the custom data and associate with the device
struct…

Harry Muscle
- 2,247
- 4
- 38
- 62
0
votes
1 answer
Does Kernel to/from User Space Communication Need To Be Secured
I'm writing a kernel module device driver that depends on a user space helper program. I plan to have the two communicate using a character device. I was wondering though, should this communication be secured somehow to prevent any third party…

Harry Muscle
- 2,247
- 4
- 38
- 62
0
votes
1 answer
Unkonwn Symbol error in installing kernel module
I am doing my OS assignments. The assignment requires us to write and compile a linux kernel module. I am required to use _do_fork in kernel/fork.c to fork a process. However, when I was trying to install my module into kernel space, the…

Josh Lee
- 1
0
votes
0 answers
Basic Kernel HWMon Driver Module for LPC Chip?
I'm working on writing a kernel hwmon driver module for a chip that communicates over LPC (ISA style bus). I have the following code so far
umode_t qnap_ec_is_visible(const void* data, enum hwmon_sensor_types type, u32 attr, int channel)
{
}
int…

Harry Muscle
- 2,247
- 4
- 38
- 62
0
votes
1 answer
Linux Kernel Module ignores main module file when an additional source file is added
I'm trying to build a loadable kernel module that includes another source file. I have the following in a Makefile or Kbuild file:
obj-m += mymodule.o
mymodule-y += other_src_file.o
In this scenario, other_src_file.c will be compiled. Strangely,…

reesul
- 29
- 4
0
votes
0 answers
Replace a key press in write syscall through kernel module
I am trying to replace a keyboard key press with other key. The terminal crashes as soon as I type 'A'. How do I replace the key press in write syscall.
unsigned long hacked_write_test( struct pt_regs *regs ) {
int r, i;
unsigned int fd =…

tarun14110
- 940
- 5
- 26
- 57
0
votes
1 answer
Using socket api, how to pass in an extra data structure to a fd in kernel module?
I am using a 4.x linux kernel and have a kernel module where I receive socket information when opening up a socket.
if ((fd = socket(sai.sin_family, skt_type, skt_protocol)) < 0)
// ...
In this case, I am making use of UDP and before I transmit…

Ender
- 1,652
- 2
- 25
- 50
0
votes
0 answers
What happens if I don't call free_irq() in the driver's exit function?
So, I wrote a basic char driver with IRQ_NO 1 for keyboard and registered a shared handler function for it. In this exit function I don't free the handler using free_irq(). In the dmesg logs I can see that the exit_function gets exectued…

agenius5
- 21
- 1
- 5
0
votes
1 answer
When to write a Custom Kernel Module
Problem Statement:
I have a very high bandwidth data link that is UDP based. The source of this data is not configurable, and sends on UDP a stream of datagrams. We have code that uses the standard methods for receiving data on the UDP socket that…
0
votes
1 answer
Why can't I get the same symbols when compiling kernel?
I'm compiling kernel (4.14.0-115.el7a.0.1.aarch64) of Centos 7.6.1810.
The source file is kernel-alt-4.14.0-115.el7a.0.1.src.rpm from centos repo.
What I did:
mkdir /root/kernel
cd /root/kernel
wget…

oleotiger
- 105
- 2
- 11
0
votes
0 answers
How to enable CONFIG_ARCH_USE_QUEUED_SPINLOCKS when compiling kernel for aarch64?
I'm compiling kernel of Centos 7.6.1810 for Arm. The kernel version is 4.14.0-115.el7a.0.1.aarch64.
I download the source file kernel-alt-4.14.0-115.el7a.0.1.src.rpm.
I wanna to compile a new kernel with different configuration from that of original…

oleotiger
- 105
- 2
- 11
0
votes
0 answers
what are the two numbers for an instruction location in objdump of a kernel module?
While doing a debug for a linux device driver, I met with a situation the OS is killed with some messages. Because it doesn't come to the shell prompt, I can't run dmesg and I just have to restart the machine (it's a arm64 virtual machine). I don't…

Chan Kim
- 5,177
- 12
- 57
- 112
0
votes
1 answer
Yocto - adding out of tree kernel module
I would like to add a wifi out-of-tree kernel module to my Yocto project. I found a layer on Open Embedded Layer Index with the driver that I need (https://layers.openembedded.org/layerindex/branch/master/layer/meta-rtlwifi/). I cannot build an…

userr019283
- 45
- 1
- 9
0
votes
0 answers
incomplete type error in network device driver
I am building a simple network driver, following a tutorial, however even though net_device struct definition is said to be in #include header file, I am getting a incomplete type error, the code is just basic init_module…

TheVastNetwork
- 15
- 1
- 4