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
Tag: kernel
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
Programmatically determine NUMA node or PCI bus, device, function number of generic PCI device
I pretty much need the same thing as Programmatically determine NUMA node or PCI bus, device, function number of Direct3D9Ex device I’m looking for a way to programmatically determine which NUMA node a particular PCI device is connected to so that I can allocate memory for host to device transfers on that node. So, my code opens a device file
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
What will happen if I change kernel configuration file in /boot? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
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.
linux kernel panic unable to handle kernel NULL pointer dereference at
I’m facing issues with some kernel panic but I don’t have any idea how to find which soft is exacly causing this issue. I’m trying to compile some soft on remote host using distcc software but my machines which are compiling are going down because of this issue. Could you point me where shoud I start looking? What could cause
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