Why GDB cannot find the source lines of the Linux kernel when debugging...
I've been trying to get the kernel to execute within QEMU using GDB to remote debug it but I'm not able to step through or set breakpoints. Here's the GDB session:linux (master *) $ gdb vmlinux GNU gdb...
View ArticleHow to set file to immutable for all user (Root user also) and no one can...
I am trying make a immutable file that is anyone can read only and can't do any modification into it. i.e - No one canwrite into it or delete it or move it. For this is referred chattrthis LINUX...
View ArticleKernel Module: No printk messages showing. Is init function being called?
I have a simple module, written as follows:#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> MODULE_LICENSE("GPL"); static int __init hellomod_init(void) {...
View ArticleIs there any difference between mmap vs mmap64?
On a 64-bit machine, is there any difference between mmap vs mmap64?There are other such as fstat64 vs fstat.answer: On a 64-bit Ubuntu 18 LTS, Verified that mmap and mmap64 func addr are the same....
View ArticleHow to implement Async I/O efficiently in the kernel
This question is about low-level async I/O system calls like send + epoll/aio_read and others. I am asking about both network I/O and disk I/O.The naive way of implementing those async calls would be...
View ArticleLearning embedded linux bsp via online sources [closed]
Which are the best resources availble to learn linux bsp online. I have unsuccessfully tried to find something for a long time now. Also how can I be proficient in linux bsp by learning on my own.
View ArticleLinux SCHED_OTHER, SCHED_FIFO and SCHED_RR - differences
Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR?Thanks
View ArticleHow to use my custom syscall from the terminal?
My system call takes an integer and returns long. I can use it in a C code like syscall(549,1). But I would like to use it from the terminal not from a C code. Can you please help me?
View ArticleMemory Limit and CPU Limit in Docker Container
UPDATE:found a lot of questions and discussions on stackoverflow about this topic. And although they are marked as accepted answered and started by thousands of users, they do not seem to be the right...
View ArticleUnderstand about dma engine and dma controler?
As I know in the system ( ex: SOC,...), maybe exist both dma controler (DMAC) and dma engine I wonder Do have relative between DMAC and DMA engine or each has its own effect?
View ArticleFail to change CS register value from kernel mode. invalid opcode: 0000
From module code with this snippet I'm trying to change the value of CS register:asm("pushq %rax"); asm("mov $0x10,%rax"); asm("mov %rax,%cs"); asm("popq %rax"); Actually the CS register contains...
View ArticleLock/unlock mutex under timer interrupt
Is it safe to lock a mutex in a timer handler (kernel space)? I have two kernel modules which read /write to the same I2C device: - first module: launch a timer when loaded. Read I2C register under...
View ArticleLinux x86-64 syscall hooking, path names garbled
I've been experimenting with Linux syscall hooking on a x86_64 Linux system, following the standard procedure of patching the sys_call_table method table as found in /proc/kallsyms.However in my...
View ArticleHow to use spi-gpio on Linux 4.19?
I want to use spi-gpio on Linux4.19 and my cpu is am4379. here is my spi-gpio device-tree follow document.fpga { compatible = "spi-gpio"; #address-cells = <0x1>; #size-cells = <0>;...
View ArticleProviding permissions for a root user in a kernel module
Linux Kernel 5.0.0-37I'm writing a function to manage permissions to be provided as a function pointer to the struct inode_operations. Here is a simplified stub implementation:#include...
View ArticleChanging virtual page premissions
I am trying to override the kill command In my module by replacing the pointer stored in sys_call_table, to a pointer to function i implemented. I used the kallsyms_lookup_name() syscall to get the...
View ArticleIn ss -s, what is the kernel counter actually counting?
While troubleshooting a problem on an OEL 7 server (3.10.0-1062.9.1.el7.x86_64), I ran the commandsudo ss -s Which gave me the output of:Total: 601 (kernel 1071) TCP: 8 (estab 2, closed 0, orphaned 0,...
View ArticleIssues implementing EPT
I'm having an issue implementing EPT in a hypervisor I'm developing. I'm receiving error no. 48 (EPT violation. An attempt to access memory with a guest-physical address was disallowed by the...
View ArticleIs mov %esi, %esi a no-op or not on x86-64?
I am a bit confused by the comment in one of the header files for the Linux kernel, arch/x86/include/asm/nops.h. It states that<...> the following instructions are NOT nops in 64-bit mode, for...
View ArticleUnderstanding loff_t *offp for file_operations
I'm designing a device driver that simply reads and writes to a character buffer. My question is however regarding the two functions in the file_operations structure read and write. I don't truly...
View Article