Can't get gdb to stop at breakpoint in Linux kernel running under Qemu
Have compiled linux 5.5.5 kernel, with make menuconfig added option CONFIG_GDB_SCRIPTS and turned off option CONFIG_DEBUG_INFO_REDUCED .Runned qemuqemu-system-x86_64 \ -kernel arch/x86/boot/bzImage \...
View ArticleFinding ACPI Device to Initiate Platform Device for Kernel DMA API
I am trying to perform a DMA operation on my Dell Inspiron 5500 laptop. I would like to transfer, say a Linux page worth (4K on my machine), of data from one physical memory location to another. My...
View ArticleWhat does rcu_read_lock() actually do (Linux Kernel)
I'm trying to understand rcu_read_lock() synchronization mechanism. From what I understand, rcu_read_lock() is used, where there are several read threads and one write thread, that read/writes the same...
View ArticleWhy do we need both read and write barriers?
Why do we need to define two types of barriers with the same implementation?For example, this code from io_uring in Linux:#if defined(__x86_64) || defined(__i386__)#define read_barrier() __asm__...
View ArticleInstalling Games in Linux through wine error
I am trying to install Total War Rome 2 in Linux for a very long time. I downloaded the file from www.oceanofgames.com and I tried running the exe file through wine and PlaywithLinux but even after so...
View ArticleBuildroot and Crosstool-NG configuration error
Building a root filesystem on Buildroot with a crosstool-NG toolchain and I am getting this error in buildroot:>>> toolchain-external-custom ConfiguringIncorrect selection of kernel headers:...
View ArticleLinux kernel module - accessing memory mapping
I'm running into some odd issue on kernel module load that I'm suspecting having to do with linking and loading. How to I programmatically figure out the address of each section after they are loaded...
View ArticleHow does the Linux kernel temporarily disable x86 SMAP in copy_from_user?
I want to know how the Linux kernel disables x86 SMAP when executing the copy_from_user() function. I tried to find something in source code, but I failed.Supervisor Mode Access Prevention (SMAP) is a...
View ArticleHow to debug Linux Kernel on a remote machine?
How to debug a custom Linux Kernel on a remote machine?I have a remote machine with a custom-built Linux Kernel originally from 5.6.8. The system under the kernel is running into problems which I want...
View ArticleCannot include unistd.h in Linux kernel module
I need to traverse all current processes with DFS(Depth First Search) in linux with C. I need to get parent process name and parent process id of the process named gedit. I'm trying to use getppid...
View ArticleIs CPU affinity enforced across system calls?
So if I set a process's CPU affinity using:sched_setaffinity()and then perform some other system call using that process, is that system call ALSO guaranteed to execute on the same CPU enforced by...
View ArticleRemove previously generated .dtb files on the BeagleBone ai
I'm trying to remove previously generated .dtb files on the BeagleBone-ai the name of my old file is "am5729-beagleboneai-custom.dtb"I did1) sudo rm /boot/dtbs/am5729-beagleboneai-custom.dtb2) copied...
View ArticleWhat is the difference between the kernel space and the user space?
What is the difference between the kernel space and the user space? Do kernel space, kernel threads, kernel processes and kernel stack mean the same thing? Also, why do we need this differentiation?
View ArticleHow to execute linux command in android programmatically?
As in android(through android sdk/tools folder) from command line we can execute linux shell command to access mnt folder/data folder likewise. (e.g cd data ls) now that command i want to execute from...
View ArticleCustom built kernel produces non-bootable initramfs on Centos 7
I've been building my own kernel (4.19.37) and have no issues during build (make) or install (make install_modules+make install). Everything seems to go fine until I execute grub2-mkconfig -o...
View ArticleWhy does my kernel module Makefile build a .ko with kernel 4.14 but not 5.6?
I have a Makefile made by following this example:cross compile kernel moduleI built a 4.14 Linux kernel from an older Xilinx source, and then built a out-of-kernel module with that script, pointing it...
View ArticleTrace page table access of a Linux process
I am writing to inquire the feasibility of tracing the page table access (in terms of "index" of each page table access) of a common Linux user application. Basically, what I am doing is to re-produce...
View ArticleProgrammatically obtaining the vendor ID, product ID of a USB device on Linux...
I am currently trying to list all usb devices that are connected to a Linux system, the code will be running in the kernel, as an LSM. The lsm code is known good.I have looked at this question but it...
View ArticleQemu - irq 22 : 'nobody cared (try booting with the “irqpoll” option)'
I have PCIdevice in Qemu.Inside VM (ubuntu image, kernel 4.15), I have written a PCI Driver over that device. I used request_irq to attach the IRQ handler, over irq line 11.I can see my interrupt name...
View ArticleHow is filename lookup done in ext4?
Env: Linux Kernel 5.3; FS: ext4When requesting stat(const char *pathname, struct stat *statbuf) how is the const char *pathname is checked for existence?It is necessary since in case there is no such...
View Article