I have a touch screen with events at /dev/input/event12 and /dev/input/event13. /dev/input/event12 is the main touch input, and in essence, I’d like to send instructions to the event directly to control behavior (ie, click location etc). Tools like xdotool do not want to work because this device is being set as a second pointer (see: https://dwm.suckless.org/multi-pointer/) and the recommendation of
Tag: kernel-module
Cannot get memory allocated from `flex_array_alloc` when requesting a relatively big size in linux kernel
I’m doing some linux kernel development. And I’m going to allocate some memory space with something like: ptr = flex_array_alloc(size=136B, num=1<<16, GFP_KERNEL) And ptr turns out to be NULL every time I try. What’s more, when I change the size to 20B or num to 256,there’s nothing wrong and the memory can be obtained. So I want to know if
Prevent removal of busy kernel module
I have a simple kernel module that creates a character devices and does nothing with it. I wrote this user-space program that tests the character device. The program exits after 10 seconds. But if in the meantime I remove the module with rmmod or modprobe, then after 10 seconds the program segfaults or hangs, and there is a kernel oops.
Fast method to get current time with nsec-resolution?
I try to get a time-information with a resolution of a few hundred nanoseconds (to do some bit-banging stuff on an Raspberry Pi). I tried with clock_gettime() which provides the required resolution in timespec.tv_nsec, but it is too slow. Even when I run my process on one separate core of the CPU exclusively and even when I set this process
Predefine a macro in kernel module
I would like to define a macro for my kernel module by using the -D flag, but I can’t figure out how to do it in a custom loadable kernel module. Just to be clear, to set the macro TEST to 1 I usually do something like: cc -D TEST=1 file.c -o file And inside the file.c I have Now,
lm75 kernel module available in userspace
I’m using the lm75 kernel module to interact with a sensor on a custom board. Every things works fine, I have my device mounted in /sys/bus/i2c/devices/5-0048. But I would like to let the user set the max temp hysteresis so in other words let the user write into the temp_max_hyst file. The permission for this file is read only except
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 create light weight kernel thread?
When I create a kernel thread (kthread_run), it becomes a new process.(I could see it using top command) . How can I create a light weight kernel thread(like the one we have in user space)? If I am not wrong, kthread_create will eventually call fork() which will call clone() with appropriate configuration to create a new process/lw process. Is it
linux kernel module: kernel method undefined (kthread_create_on_cpu)
The method is defined in kthread.c file and prototyped in kthread.h. But it is not exported. In my driver I want to start a kthread on a given CPU, so I do: I can compile but I get linkage error on resolving module symbols on MODPOST: How should I proceed? How to import this symbol or what to do instead?