FunctionFS stalls endpoint when alternate setting is activated with...
I'm trying to create a Gadget using FunctionFS and the FS driver. My gadget is composed of two functions with the following configurations:Function 1: Interface 0: Endpoint BULK OUT 0x01 Endpoint BULK...
View ArticleChild-runs-first semantics in old linux kernels
I was reading Linux Kernel development and trying to understand process address space semantics in case of fork(). While I'm reading in context of Kernel v2.6, and in newer versions, any of child or...
View ArticleHow does operating system preempt a process and regain control?
When a process is running on a CPU, the operating system is not running in the background as a single core CPU can execute only 1 instruction at a time. Then how does the operating system preempt a...
View Article`ioctl` to read and write GPIO: invalid argument
I'm imitating the gpio-hammer example in Linux source code. I'm using Raspberry Pi 3B+ and want an LED to blink.Here's what I do:#include <linux/gpio.h> #include <sys/ioctl.h> #include...
View ArticleWhat's the correct way to process all the payload of a sk_buff packet in Linux
I'm currently trying to debug an ATM encapsulation layer that runs on-top of Ethernet. Basically the ATM cells are stored in order after the ethernet header. However I suspect the drivers naive...
View ArticleUse chdir to change current working directory
I'm creating a program wich is like an "shell interpreter" but in C, in the main program called "Bash" if i write in command line "change NAME" it creates a fork and executes an execlp to call a...
View ArticleSetting PHC for Linux Device Driver
I recently upraged my linux from 3.10 to 4.4.8After doing this I have run into an issue with my NIC drivers.I have have two NIC drivers (eth1, eth2) and their respective PHC's ptp0, ptp1After...
View ArticleError while removing a module from the kernel using $rmmod
I have written a small device driver program to perform led blinking while inserting the module. The module is working perfectly while inserting, but while removing, I am getting the following...
View ArticleGoogle Cloud compute engine randomly becomes unaccessable
I have a problem with a custom (1 vCPU, 2 GB memory) compute instance running Apache and 3 python scripts which essentially waits for messages and runs some SQL queries and creates reports. Once in a...
View ArticleNetfilter hook doesn't see all packets
I wrote a kernel module that uses netfilter hook to dump multicast DNS packets.static uint32_t myhook(uint32_t hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out,...
View ArticleHow to install driver of Tp-link Tl-wn8200nd on Kali Linux 2019.3 [on hold]
I just bought a TL-WN8200ND Tp-link adapter, but I can't make that adapter operated on Kali Linux 2019.3, I must specify that this version has kernel 5.2 and the drivers you have tested are only...
View ArticleWhy does gdb does not show debug symbols of kernel with debug info?
I am trying to learn more about kernel and driver development, so for that purpose I thought to use KVM and gdb to establish debug session with custom installed kernel (v5.1.0). The kernel has debug...
View ArticleReading keyboard input in kernel thread polling
I wrote a simple kernel module to read a single character from the keyboard and it worked.#include <linux/kernel.h> #include <linux/module.h> #include <linux/ioport.h> #include...
View ArticleCan we read/write to Reserved areas in /proc/iomem
I have lot of areas in /proc/mem with "Reserved". Can we performed read/write on these areas.$ sudo cat /proc/iomem 00000000-00000fff : Reserved 00001000-0009e7ff : System RAM 0009e800-0009ffff :...
View ArticleDebugging kernel with /proc/kcore
I was learning debugging kernel using /proc/kcoreI built the latest stable 4.19 Linux version and installed it on my virtual machine.Then I cd into the folder where my linux source code was compiled...
View ArticleWhy printk doesn't print message in kernel log(dmesg)
I wrote small kernel module code as mentioned below, I am testing it in ubuntu 14.04#include <linux/module.h> #include <linux/version.h> #include <linux/kernel.h> #include...
View ArticleParsing kbd keyboard maps for evdev values?
I'm writing a Rust application for Linux which must process raw evdev events and at times convert the input to unicode strings (and also in the reverse direction).Obviously the string that would be...
View ArticleWhy `pstore` is not working with Samsung S10 5G?
I have Samsung S10 5G with root via instructions given by Magisk. I am trying to modify system.img to patch my SELinux policies in the AP file of ROM. When I flashed the AP file with other files using...
View ArticleDisk I/O operation CPU affinity
Can anyone help me find on which core a disk I/O operation will execute?The file write application is running on core 11 .Kernel threads affinity is configured to 0-1, IRQ affinity is set to 0-1, core...
View ArticleUnable to run linux 3.10(mips) on qemu 2.5
I want to run linux 3.10 with mips64r2 on qemu. But it fails, the boot log as follows,I compile the kernel with the gcc 4.9.3 which is modified by loongson.The kernel config file is the malta_defconfig...
View Article