Where is the root of shmem filesystem?
I'm studying in shmem filesystemAfter tracing the kernel and documents, I found thatShmem is tmpfs or ramfs depending on configIn /Documentation/filesystems/tmpfs.txt"there is always a kernel internal...
View ArticleHow to give root permission to a module?
I'm working on a module that when I call echo "hello"> /dev/filename I get bash: /dev/filename: permission denied. For me to get permission I have to call sudo chmod 666 /dev/filename and then echo...
View ArticleHow to find memory allocated by a kernel level process in linux?
I have written a simple kernel module to remove all the vowels from a given string. I want to find out about how much memory is allocated by the process, number of page swaps and number of context...
View ArticleWhat is ?= in Makefile
KDIR ?= $(shell uname -r)What is the meaning of ?=?I have understood the difference between :=, += and = from another thread available in Stack Overflow, but unable to find the explanation for ?=.
View ArticleHow can I prohibit other Linux Kernel modules to get access to some regular...
The problem is to prohibit access to some files (files from my "blacklist"). It implies that nobody besides me (my own kernel module) can either read or modify these files.I've already asked this...
View ArticleManage CPU allocation at thread level in Linux
Suppose I have 3 threads and I set their affinity to a single VCore. I want to be able to give thread 1 and 2 25% each of the VCore and thread 3 50%. Is that possible? I know through cgroup, it is...
View ArticleMakefile for a kernel module to keep all .o .ko .order .mod files in build/...
I have a folder structure as follows:root dir |__build/ |__Makefile |__mod_init.cMakefile:obj-m += mod_klm.omod_klm-y := mod_init.oall: make -C /lib/modules/$(shell uname -r)/build M=$(PWD)...
View ArticleHow to identify .rodata,.data,.bss and .text sections in the mapping...
When I saw the output of pmap -X for a process, It was as following:output of "pmap -X pid"I couldn't find out any way to identify the .rodata,.bss,.data,.text sections.Is there any way to find out...
View Articleserialport access in kernel space
I want to use serial port in kernel space, I have found some code which was in user space, I tried to convert the codes to work in kernel space...this is my code#include <linux/termios.h>#include...
View ArticleApplying QoS to the incoming packets using traffic control
I have been studying about traffic control for a while now for a project that requires me to apply QoS on an application level for optimising in game experience. Now I have a few doubts that I would be...
View ArticleQEMU kernel for raspberry pi 3 with networking and virtio support
I used the QEMU(qemu-system-aarch64 -M raspi3) for emulating the Raspberry pi3 with the kernel from the working image. Everything was working but there was no networking.qemu-system-aarch64 \ -kernel...
View ArticleHow do I check whether the virtual address belongs to User data space or User...
mm_struct is mapped to bss, code, data segments. Should I be checking against their start and end ranges. How do I determine whether the given virtual address falls in USER data or USER code space?Any...
View ArticleWhy does Linux favor 0x7f mappings?
By running a simple less /proc/self/maps I see that most mappings start with 55 and 7F. I also noticed these ranges to be used whenever I debug any binary.In addition this comment here suggests that...
View ArticleCan`t set gdb to stop at breakpoint in Linux kernel runned with 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 ArticleHow to identify the kernel version
How can I know which version of the kernel I'm using?uname - aUnknown GLBMPL360JK 999.999.999 x86_64 GNU / Linuxcat /proceso/cpuinfo0how could I know the kernel version thankslink of the operating...
View ArticleUbuntu asking for password again and again
Ubuntu asking for password again and againI am also having the same problem . When I enter my password while booting up, it shows screen with system loadings for a split second and takes me back to...
View ArticleInitialization from incompatible pointer type when assigning struct...
I'm writing a Linux device drive and I'm confused as to why I'm getting this warning.error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .write = file_write,This...
View ArticleUnable to boot Linux with generic kernel from usb
When I boot into the Linux system that was installed on USBI get an error "Unable to mount root fs on unknown-block(0,0)".Did anyone get the same problem and what is the resolution?It should be booted...
View ArticleWhy there is no ".ko" files generated when cross compiling linux kernel 2.6?
I'm cross-compiling Linux kernel 2.6.32.61 using the arm-none-eabi toolchain, the GCC version of which is 4.5.2.I did enter commands as:make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j8 menuconfigmake...
View ArticleUsing perf for the linux kernel
I know how to use perf command to analyze a binary file or a running process. I would like to know if it is possible to perf the kernel itself or not. I didn't find a clear answer for that. Does that...
View Article