I expected to find a function along the lines of kobject_check_refcount, that returned the current refcount without altering it, in kobject.c, but as far as I can see there isn’t one. Is there such a function existing in the kernel source somewhere? I can see it being useful for debugging purposes at points. Edit: found kref_read which sounds like it
Tag: linux-kernel
init function not present in kallsyms
I wrote a simple hello world kernel module After loading the module, i am checking what all symbols are added into /proc/kallsysms. I don’t observe test_hello_init. Why don’t we have it Answer Using Linux kernel 5.8 source as a reference, the module’s symbol table for “kallsyms” is set up by the call to add_kallsyms() (in “kernel/module.c”) at module load time
Why do my calls to gpiod_set_value return an “invalid GPIO” error?
I am attempting to write a driver for an OV2680 camera sensor. I want to turn on some GPIO pins as one of the steps in its ->probe() function. Those GpioIo() pins are declared in the DSDT tables like so (for a device upon which the OV2680 is dependent; see full DSDT table: Note absence of a _DSD segment, meaning
Install OV7251 driver in RPI-3B+ to use with ROS
I wanted to install the OV7251 camera driver to work with a module I’ve recently purchased, the Arducam OV7251 MIPI, as I need to perform SLAM-like system called Virtual Inertial Navigation (VIN) and global shutter cameras are preferred for this. As far as my system goes, I’m using ROS Kinetic on an RPI-3B+ running Ubuntu 16.04 . I am using
insmod fails with “Unknown symbol in module”
I am working on Linuxmint Cinnamon 19 Ubuntu 18.04, kernel version 4.15.0-20-generic The following I see during compilation: Then I try to install the module with sudo insmod elevator.ko Seeing in the logs: dmesg | tail Makefile elevator.c issue_request.c start_elevator.c stop_elevator.c Functions are static and there is only one makefile in same directory. So my question is: Why can’t the
How to avoid quotes (“…”) in shortcut-ed printk Macros inside Linux Kernel Modules
I have created a set of shortcut Macros for Linux Kernel printk to prefix with the module name and to have a set of aliases for severity. Using those Macros like this: Now the issue is that the final output in the Kernel Ring Buffer get quoted in the following way: Do you have any idea of how to avoid
How are parameters passed to Linux system call ? Via register or stack?
I trying to understand the internals of the Linux kernel by reading Robert Love’s Linux Kernel Development. On page 74 he says the easiest way to pass arguments to a syscall is via : Somehow, user-space must relay the parameters to the kernel during the trap.The easiest way to do this is via the same means that the syscall number
Linux: Why does the FIFO scheduler not work as expected on the 1 core CPU machine?
I am learning about Linux scheduler. Firstly, I want to test the FIFO scheduler. Here is the code I use to test: I run this program with the priority 1 on 2 terminals: ./main 1. Because my CPU has only 1 core, I expect only the first terminal can run because of the FIFO attribute. However, in the real-test situation:
why is htop command displaying a black screen [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
Why does the Linux Kernel copy implementation use the AC flag?
The implementation of copy_user_enhanced_fast_string in the Linux Kernel copy routine uses stac/clac in the epilog and prolog. perf annotate shows the following code: AC is “Alignment check (or access control) flag”. What is the reason stac/clac are used in the routine? What would be the consequences if we simply remove them? Answer Normally all page access checks are disabled in