Questions tagged [kernel-module]

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.

2228 questions
0
votes
1 answer

How should I set extra include path for linux kernel module build?

This is the Makefile that I'm using for cross-buildig a kernel module. export CROSS_COMPILE:=aarch64-none-linux-gnu- export ARCH:=arm64 obj-m += chr_drv_ex1.o export…
Chan Kim
  • 5,177
  • 12
  • 57
  • 112
0
votes
0 answers

serve when is receive_buf called

Hello I wanted to know when is the receive_buf vom a serve called. Because for me it looks like it get called on a time out. But I did not find anything in the documentation. I also looked at the source code but I found nothing. serdev.h
samann
  • 73
  • 5
0
votes
2 answers

why cant get the message response from kernel module when using netlink socket to communicate with python user

I'm using netlink socket to communicate user python code with linux kernel, i can send message properly from user to kernel but i cant get the response back from kernel. it shows: "Error while sending bak to user.." in my peice of kernel code I…
Meri
  • 1
0
votes
1 answer

How to provide -C option in the Makefile for cross-compiling kernel module?

I'm trying to build a simple kernel module for arm64 machine from my x86_64 machine. The target and host are both using ubuntu 20.04 as OS. First I tried building a simple kernel module for the host (x86_64) using this Makefile. By the way, uname -r…
Chan Kim
  • 5,177
  • 12
  • 57
  • 112
0
votes
1 answer

no build/script directory in lib/modules for a WSl2 kernel

I built and configured a kernel in WSL2 (wsl-5.4.91, gcc 9.4.0, Ubuntu 18.04 WSL) While installing MLNX_OFED I get the error that there are no files in the lib/modules//build/scripts. I there an easy way to copy the scripts in there? I read this but…
0
votes
0 answers

Kernel module programming - how to print the pid and the name of the process that stop by the user (like to press on "ctr+C" or "ctr+Z")?

I tried to create a function ,in my module, that every time , when the system call sys_exit is called. So it will print the pid of the process that the user tried to stop (by press ctr+C, ctr+Z or something else). asmlinkage long our_sys_exit(struct…
0
votes
1 answer

Capturing power-off interrupt for i.MX6UL (linux kernel)

Context I'm using an i.MX6 (IMXULL) application processor, and want to know in software when the power-off button has been pressed: Luckily, the IMX6ULL reference manual explains that this should be possible: Section 10.5: ONOFF Button The chip…
Micrified
  • 3,338
  • 4
  • 33
  • 59
0
votes
1 answer

Allocating physically contiguous pages in Kernel Module

I am trying to allocate physically contiguous pages in DRAM using the alloc_pages_exact function. When I try to allocate 10MB of pages, the returned address is always 0. But when I try to allocate 1MB of pages, the allocation is almost immediate.…
0
votes
1 answer

When does mod->init be assigned

When Linux Kernel load new module with insmod, it will invoke finit_module do_init_module do_one_initcall then the init function defined in module will be invoked. static noinline int do_init_module(struct module *mod) { int ret = 0; …
Felix Du
  • 105
  • 6
0
votes
1 answer

Linux kernel shows "WARNING: at arch/x86/mm/pageattr.c:962 change_page_attr_set_clr" without explanation

I'm writing a x86_64 kernel module targeting Linux v3-v4 which uses set_memory_rw() on an address of a kernel symbol. While the call works I'm getting a warning without any explanation: [ 596.183643] ------------[ cut here ]------------ [ …
kiler129
  • 1,063
  • 2
  • 11
  • 21
0
votes
0 answers

Using mmzone.h functions to build a kernel module

I am trying to make a kernel module that gives me some basic information about the memory, like nodes, zones, pages, etc. I am not able to build the module, there are some errors. I am using Ubuntu 20.04. Kernel 5.8.0-55-generic. The code is as…
0
votes
0 answers

Toggle GPIO in Netdevice

Hy i wanted to toggle a GPIO pin always when i send a package. But I have a weird behafure sometimes my pin gets toggled and sometimes not. I checked my Kernel logs and there is no Information that the pin could not be toggled. My Ops look like…
samann
  • 73
  • 5
0
votes
0 answers

Error build when linux kernel driver is configured as builtin

I have developed 2 kernel drivers and I can build them using yocto as dynamic kernel modules without any probem but when I need to build them as static I had some issue related to dependency, because my driver1 is used by driver2. Here is the…
developer
  • 4,744
  • 7
  • 40
  • 55
0
votes
1 answer

Compiling kernel module without kernel headers

I am developing a kernel module and need to compile it for an older version of Gentoo that I don't have the headers for. The Linux kernel version is 4.14.34 and I have the source for that, with the output from uname -r being 4.14.34-gentoo-x64.…
RPiAwesomeness
  • 5,009
  • 10
  • 34
  • 52
0
votes
0 answers

Modify the physical address of a v4l2_buffer in kernel module

Is it possible to modify a v4l2_buffer allocated through MMAP in userspace such that the physical address of the requested buffer points towards a desired physical memory? The goal is that we have a sensor writing data in a circular buffer within a…
1 2 3
99
100