How can I FULLY reset the Android OTG stack?
I've hit a bug in the Android USB host stack where, under certain conditions, when a client device is disconnected, the USB host stack apparently dies/locks up. I seem to hit it somewhere around 1 out...
View Articlehow to invoke perl script in mk file
I try to execute a perl script in a AndroidUboot.mk file using following line$(PERL) myscript.pl arg1 arg2 but it gives me an error: syntax error near tokon... no matter what i put in script file, it...
View Articlesendmsg is hanging for ~16 second randomly
Some times we observed that sendmsg() is hanging for long time. I am using no blocking socket. While debugging that we observe same time couple of kernel thread/processor are in D state. 867 867 FF 50...
View Articlehow to create /proc file inside kernel module?
I want to save some information in a kernel module. I have seen similar question to mine here in stackoverflow, however mine is slightly different. Assuming I am using this code to write in a /proc...
View ArticleHow to use kernel_write function for Linux driver in appropriate way?
For my Linux Module I want to use the function kernel_write. I want to write the file, which has the path : /sys/class/leds , from the kernel space. I will write to it a value, integer, 0 or 1. I am...
View ArticleI try to ftrace open system call but trace record is all about SyS_read
I tried to trace open system call using this code.#include <stdio.h> #include <fcntl.h> int main() { char *path = "/home/[my account]/text.txt"; int fd; fd = open(path, O_RDWR); return 0; }...
View ArticleWhy does vim report error when i write data into page with ramfs
I use my_do_sync_read and my_do_sync_write function to replace do_sync_read and do_sync_write in ramfs source code to encrypt data wrote into page. It is successful for writing a file from nano or...
View ArticleZedboard: Kernal panic with undefined instruction and reboots
I am using zedboard with zynq-7000. Furthermore, I am using petalinux 2018.3 My intentions are as follows.1. Fsbl starts, a. load Helloworld.elf @ 0x30000000 b. load u-boot.elf @ 0x21000000 2....
View ArticleHow to set and get extended attributes using ?
I am investigating different methods of maintaining state between sessions [of my application running]. One [non-portable] method that was suggested to me [from the #ubuntu IRC chat] was to take...
View ArticleHow to apply patch to kernel modules in NixOS?
I'm running NixOS 19.09 and would like to apply a patch to the i915 kernel module. Since I'm pretty new to NixOS I'm pretty lost and haven't found any good hints in the documentation nor wiki.The patch...
View ArticleKernel modules __init macro in C
I want to create a loadable kernel module for Linux. This is the code#include <linux/module.h> #include <linux/init.h> static int __init mymodule_init(void) { printk ("My module...
View ArticleHow to globally disable read page caching in Linux kernel (nommu)?
I know this has been asked/answered a lot of times by I never found an effective solution.I am running Linux on a NOMMU environment. I found out that caching is deleterious in terms of memory...
View Articleecho: write error: Invalid argument while setting io_poll for NVMe SSD
I am using the following command as a root user to enable Linux kernel polling for a NVMe SSD device. # echo 1 > /sys/block/nvme2n1/queue/io_pollI get the following error: bash: echo: write error:...
View ArticleLinux Kernel: update config from command line for specific modules
To build the linux kernel from source, I would normally do something like:make mrproper make menuconfig make In the menuconfig step, I enable some modules I want to have built into the kernel that...
View ArticleWhy did not we have ccflags-m, but ccflags-y?
I'm analyzing Linux Kernel Makefiles bundle. We can define an additional compiler flag to build external module with ccflags-y += -std=gnu11 -Wno-declaration-after-statement -Werror. I looked at...
View ArticleLinux packet processing bypass kernel protocol stack
I want to process packets in my own logic.To be more specific, For the packets sent to my computer, I want to remove its ethernet header and send it to another NIC.For outgoing packets, I want to add a...
View ArticleWhat does the kernel compile rule exact mean?
What does the kernel compile rule -C xxx M=xxx exactly mean?I have seen the compile rule as follows many times:$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules $(MAKE) -C $(KDIR) M=$(PWD) src=$(PWD) modules...
View ArticleLinux Kernel Module : Problem with kernel_write function
I have a problem using kernel_write function while I am developing LKM for Linux 4.14.73 version.This is the part of my module where I am facing the issue : void change_led_state(char *led_path, int...
View ArticleLimiting syscall access for a Linux application
Assume a Linux binary foobar which has two different modes of operation:Mode A: A well-behaved mode in which syscalls a, b and c are used.Mode B: A things-gone-wrong mode in which syscalls a, b, c and...
View ArticleMinimalistic Linux Kernel not compiling
I want to compile an own minimalistic Linux Kernel with make tinyconfig and after doing all steps (like here:)I get this error message:arch/x86/kernel/apic/apic.c:2282:6: error: redefinition of...
View Article