Skip to content
Advertisement

Tag: linux-kernel

Using sysctl interface from kernel module

I am trying to access tcp_pacing_ss_ratio defined in tcp_input.c from a kernel module. The variable can be modified using the sysctl command in user space. It is however not exported and cannot be referenced directly from the module. What is the simplest way to access a sysctl entry from a kernel module? Answer From the sysctl(2) manpage: use of this

Reverse engineering a zImage

So I have a custom kernel for an embedded arm device which I had worked on some time ago. I’ve revisited the project but since have reinstalled Ubuntu on my development machine. I can’t compile a new zImage correctly as before. I have found an old SD which card which has the correctly compiled and working zImage. I suspect I’m

How to debug USB HID scancode-keycode translation in Linux

I have recently converted a 122-key terminal keyboard to USB as a configfs USB gadget (the keyboard portion is using HID codes), it works quite well in except that I cannot seem to get my Archlinux installation to recognize certain HID codes (specifically at the moment F13-F24) and translate them into event codes that I can use in X. HID

Error initialization from incompatible pointer of IOCTL function in Linux kernel 4.8.0-53-generic Linux Mint 64 bit

I’ve got an error while writing a char device module, using Ioctl command. Note: please ignore all my print_k. Please, help me fix this. My thanks to all of you. Here is my code : Answer The third argument unsigned long arg[b] in the function prototype is dubious. It should be simply unsigned long arg even if it’s supposed to

IRQCHIP_DECLARE: init function is not being run

I am trying to use the Xilinx interrupt controller driver in an embedded ARM FPGA system I am developing. (https://github.com/torvalds/linux/blob/master/drivers/irqchip/irq-xilinx-intc.c) At the end of this driver is the line: IRQCHIP_DECLARE(xilinx_intc_xps, “xlnx,xps-intc-1.00.a”, xilinx_intc_of_init); I have added an entry in my device tree for the interrupt controller. However, from what I can tell, the xilinx_intc_of_init function is never called during startup. I

Get all mount points in kernel module

I’m trying to get all the mount points in a kernel module. Below is what I’ve come up with. It segfaults because of the strcat. Is this the correct way to get the mount points? Will this work? if so how do i fix the segfault? If not, how does one go about getting the mount points in a linux

How to proceed with Linux source code customization?

I am a non CS/IT student, but having knowledge of C, Java, DS and Algorithms. Now-a-days I am focusing on operating system and had gained some of its concepts. But I want some practical knowledge of it. Merely writing algo code in java/c has no fun in doing. I have gone through many articles where they mentioned we can customize

In the kernel space, how does one get the physical addresses corresponding to a file on ext4-formatted disk

If you’re here: https://github.com/torvalds/linux/blob/master/fs/ext4/file.c#L360 You have access to these two structs inside the ext4_file_mmap function: I am changing the implementation of this function for dax mode so that the page tables get entirely filled out for the file the moment you call mmap (to see how much better performance not taking any pagefaults gives us). I have managed to get

Advertisement