I’ve built an android kernel (source code), now I’m trying to cross-compile a kernel module for it, v4l2loopback to be precise. I’ve used this toolchain to build the kernel (kernel version is 4.9). Here on github you can see that someone actually succeeded in compiling the module, and I’ve been trying to replicate their success myself. But in the last
Tag: kernel-module
SeedLabs Firewall Lab: Implement a Simple Kernel Module, failure to build a kernel module
I’m following the steps from here at 3.1 Task 1.A: Implement a Simple Kernel Module: https://seedsecuritylabs.org/Labs_20.04/Files/Firewall/Firewall.pdf Everything was fine until I ran the make command. the hello.ko file wasn’t generated and I don’t know what’s wrong. Answer You must add the license in hello.c. e.g.
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. Also, can someone please tell me how to find the exact row size of DRAM? I had to
Changing process priorities
Building off of this, I would like to change process priorities based on RAM usage. I’m perfectly aware that this isn’t always the best way to change priorities, but this is just for a project. I’m trying to use renice and execvp to set process priorities. The problem is that I want to launch renice with additional parameters to change
Determining filesystem for block device if module not loaded
I’ve been wondering this for a while now. When using Linux and plugging in an e.g. USB stick or external storage device via USB, how does the kernel determine which filesystem is on that device, if the correct module is not currently loaded in memory? Assume that the external storage device is ext4 formatted. At the time of plugging in
Interrupt Handler Stops Working After Kernel Module Reload (Xilinx FPGA / PCIe)
I am currently working on a PCI driver for the Xilinx Kintex 7 board using the Xilinx PCI IP core (AXI Memory Mapped to PCIe). One problem is, that the interrupt handler stops working when I reload the kernel module. In more detail: Fresh boot of my machine Load the kernel module and monitor the kernel messages with dmesg /proc/interrupts
insmod fails with “Unknown symbol in module”
I am working on Linuxmint Cinnamon 19 Ubuntu 18.04, kernel version 4.15.0-20-generic The following I see during compilation: Then I try to install the module with sudo insmod elevator.ko Seeing in the logs: dmesg | tail Makefile elevator.c issue_request.c start_elevator.c stop_elevator.c Functions are static and there is only one makefile in same directory. So my question is: Why can’t the
How do I specify which of two kernel modules to compile with a Makefile?
I have a Makefile that compiles two Linux kernel modules (mod1.c and mod2.c). This works fine to build both kernel modules when I run make, but I would like to be able to specify which module to build. For example, make mod1 to compile mod1.c and make mod2 to compile mod2.c. The thing that I am unsure of is how
Is it possible to get kernel version from ELF image file without disassemble or using grep or strings?
I have a vmlinuz ELF image file. I need to get the kernel version from the image file without disassembling it. Is it possible to get kerenel version from offsets of that compressed image file? The file is ELF 64-bit MSB executable, statically linked, not stripped. Answer As previously mentioned, the version number is hardcoded into the compressed image file.
How to compile / link / build a small sized Loadable Kernel Module ( LKM )?
I successfully built this trivial LKM with gcc but the resulting binary is of size 70kB. What CFLAGS and make arguments would you suggest to make it smaller? Answer The standard Linux kernel is compiled in an optimal way already unless it’s a debug version or some very specific options are turned on. So the simplest Makefile for an external