linux kernel: understand how jiffies diff is calculated
I came across the following code in the kernel:/* * Have the 32 bit jiffies value wrap 5 minutes after boot * so jiffies wrap bugs show up earlier. */ #define INITIAL_JIFFIES ((unsigned long)(unsigned...
View ArticlePrefetching in vm_fault(), Linux drivers
I'm implementing a simple device driver. The program that uses this driver takes in arguments from the user whether to use demand paging or prefetching(fetches next page only). But when the user...
View ArticleWhich real-time priority is the highest priority in Linux
In the Linux real-time process priority range 1 to 99, it's unclear to me which is the highest priority, 1 or 99. Section 7.2.2 of "Understanding the Linux Kernel" (O'Reilly) says 1 is the highest...
View Articlelibpgiod recipe requires a kernel header: linux/gpio.h
I'm trying to pull this libpiod library using Yocto/OpenEmbedded and build it under my recipes-support:https://patchwork.openembedded.org/patch/139782/while i bitake the recipe, it complaints about a...
View ArticleHow to use ipv6 flow label
I was going through ipv6, and came across flow label.my question is.How to use IPv6 Flow Label?Is there any config which we need to enable/configure to enable flow label? Is there a way to configure a...
View ArticleKGDB serial port reinitialised after boot
I have been fighting with this issue for a while and slowly giving up on it. I am working with Yocto on my Beaglebone Black board. I want to be able to use KGDB to debug kernel modules and kernel...
View ArticleGet accurate ELF dependencies
I know two ways to find dependencies,ldd app.out which returns this for a simple app:linux-vdso.so.1 (0x00007ffff93f5000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6...
View ArticleAuthorize sudo commands with magic sysrq
Instead of having to type in my password for sudo commands, I prefer some sort of a magic sysrq combination to authorize it. Is that possible?For my purposes, I don't actually gain much by entering a...
View ArticleEmbedded Programming for Raspberry Pi with Fast boot
I'm a computer engineer student and I'am having problems with my new project:A small screen that show car information and such. A reeeeeally simple version of a carputer.It's been 1 month with my...
View ArticleLinux C forbid coredumps only for my program
Is it possible to forbid creation of coredumps only for my program? I know that it's possible to change behaviour for entire system using ulimit, but I'd like to block it only for my program. What...
View ArticleHow does a serial driver get attached with a tty port
I am looking at Linux sample UART driver code herehttps://github.com/martinezjavier/ldd3/blob/master/tty/tiny_serial.cBelow is snipped from the code where UART driver is sending data to the tty...
View ArticleI want to display first header of the log file and also grep the contents of...
I used this commandhead -n1 $str| grep -nr $word $str > output.txtThis command is not picking the first line of the file only greping the content.Kindly suggest immediately
View Articlelinux: is there a kernel parameter to limit overall mem usage? [closed]
Experts,I run Kubuntu 20.04, stock kernel on a Lenovo X201i. I have 4G of ram and get frequent visits by the oom-killer. A co-worker gave me two 8G SO-DIMMs. Problem is, the X201i detects 16GB but can...
View ArticleHow to set the pio mode of the hard disk?
I am dealing with a hard disk speed problem, the system uses pio mode to access hard disk.Now, i read a 4MB file need 4s, this is abmormal.The IDE controller support pio mode 4, and i try to set its...
View ArticleKernel Sources for Android 4.0 - Ice Cream Sandwich
I have downloaded Android 4.0 sources as per the instructions given inthe following link : http://source.android.com/source/initializing.htmlI have downloaded the sources successfully without any...
View ArticlePCIE 64 Byte single burst Transaction
I want to do a 64-byte transaction on PCIe. I am using Intel i7 9th gen CPUI was able to do 64-byte write transaction to PCIe device memory by making it wc region and wrote data like...
View ArticleSystem call hooking example arguments are incorrect
I wrote an example of system call hooking from our Linux Kernel module.Updated open system call in system call table to use my entry point instead of the default.#include <linux/module.h>#include...
View ArticleHow to write simple bootable OS for x64
I want to create own os which can be boot from grub. Also I want to know and which steps of boot are existing.How to write simple bootable .iso fileWhat should I know?
View ArticleThe difference between `entry_SYSCALL64_slow_path` and...
We know that system call will call the function entry_SYSCALL_64 in entry_64.S. When I read the source code, I find there are two different types of call after the prepartion of registers, one is...
View ArticleTime discrepancy between 'dmesg' and 'date' in Linux
I have some kernel module which prints to log likeprintk(KERN_INFO "Something\n");When module was loaded I found that the time in dmesg outruns the current time in date:-bash-4.4$ dmesg -T | grep...
View Article