Skip to content
Advertisement

Tag: kernel

Writing into a device file prints “Invalid argument”

I am currently working on a device driver where I want to write a sentence to that driver and display it in the kernel. Reading an internal buffer and calling the driver with cat works perfectly fine. However, if I try to write to the device driver it returns the following message: I have the following code for my device

Where/how does the kernel loads statically linked modules?

Looking at init/main.c#start_kernel it’s not clear where the statically linked kernel modules are loaded, neither how the kernel gets a list of them. So, where are the statically linked kernel modules loaded? Answer For compiling a module “as a module”, the corresponding Kconfig is set to m. If set to y, all the module code is compiled just like all

How does OS kernel get notified when memory is accessed?

As far as I know, OS kernel maintains the translation from virtual address to physical address, and the userspace program uses virtual address, the CPU uses physical address. Since all machine codes are executed by CPU, how does OS kernel know a memory access instruction is taken, and translate the virtual address to physical address? CPU can execute a syscall

Creating a new directory in /dev using udev rule

This is the code snippet responsible for creating the device: My udev rule is the following: From my understanding, this rule should match against the device name given by the kernel module (synchmess) and create the /dev subdirectory “synch”. However, the synchmess device shows under /dev with the correct permissions, but i can’t seem to figure out how to create

Linux SocketCAN behaviour of recvmsg

I’m writing a CAN logger program. The way I log the data is similar to the way the candump-tool is doing it when invoking candump like candump any: https://github.com/linux-can/can-utils/blob/master/candump.c candump any makes candump bind to any device, i.e. addr.can_ifindex = 0; then it uses recvmsg to obtain a CAN frame, then it gets the on the struct msghdr msg; attached

Is it possible to get kernel version from ELF image file without disassemble or using grep or strings?

I have a vmlinuz ELF image file. I need to get the kernel version from the image file without disassembling it. Is it possible to get kerenel version from offsets of that compressed image file? The file is ELF 64-bit MSB executable, statically linked, not stripped. Answer As previously mentioned, the version number is hardcoded into the compressed image file.

Compiling Linux Kernel 5.2.9 fails at scripts/sign-file

I am trying to compile my own kernel for the sake of experience. The kernel version is 5.2.9 downloaded from kernel.org today ( Aug 19, 2019 ). my make command is “make -j 6”. I have a Ryzen 7 1700x 8 core / 16 thread amd cpu. scripts/sign-file.c:25:10:fatal error: openssl/opensslv.h: No such file or directory 25 | #include | compilation

Advertisement