/r/kernel
A moderated community dedicated to technical discussion about the Linux kernel.
Welcome to /r/kernel, a moderated community dedicated to all things about the Linux kernel. Technical articles only, please!
You may be interested in the following links:
And some books:
Related Communities
/r/kernel
I want to add LSP support in Neovim for the kernel tree (for autocomplete, jump to definition etc..). I googled around a bit and found out about scripts/clang-tools/gen\_compile\_commands.py
which generates a compile_commands.json which can be used by say the clangd LSP in Neovim.
My question is does the kernel have to be compiled with clang for this to work? Is there an alternative if I compile with GCC?
I'm currently working on some kernel challenge and I notice that in init script there is always a poweroff command at the end. Can someone help me explain this? What is the point of having poweroff in the init script? will it just shutdown the machine ?
ok, so i understand that everything in linux is represented as a file, i understand that design philosophy came from unix, which linux is based off of.
my question is, what are the specific benefits this design philosophy gives us? why should everything be a file or represented as a file on linux? what are the upsides?
thank you
Basically i was trying to create my own operating system. where i got to the point that for creating your operating system -> you need a bootloader --> bootloader works on the particular hardware (architecture) --> every computer have different architectures. So for the newbies in the os development what could be the best architecture to start on. if so how to start. (buying hardwares could be costly,so recommend me something that will cost nothing)
I apologize if this post comes across as spammy. Hopefully it's still appropriate to post here as I think we can provide some value for the kernel devs.
I spent last couple of months with my friend building an „infinite canvas” kind of app for exploring source code. We take a repo, cut the code into individual definitions and give you a graph you can interactively explore on the web. The app can be found at https://territory.dev. Our goal is to make this service available for free for free software repos. We indexed linux and LLVM sources and will be covering more public repos soon.
I would love to hear if this is useful for you.
I was browsing through some linux kernel code and noticed some variables declared as "ro_after_init".
This basically stands for __attribute__((section(.data..ro_after_init)).
This make the data read-only after init. But how exactly does this data become read only? When I am in kernel mode with full privileges, I am able to access all physical memory right?
Please lemme know what I am missing here. Thanks
Hello everyone I am new to windows kernel programming, I am writing a minifilter drive to file system monitoring now I need to find the Root Process id for the process id which get using psGetCurrentProcessId if anyone know how solve this comment on this thanks
The standard is easily found at https://www.jedec.org/standards-documents/docs/jesd300-5b01 , but I can't find any evidence this is supported yet in Linux.
Before I give up on this and eventually try to make my own patch (doubtful), I want to make sure I am not missing anything.
Hello folks i am new to windows kernel programming and I have written a basic program how I have a some doubt in drivers is there is a any process id for driver I have read in many documents and msdn in that they are the drivers doesn't have any process id but some of them saying that the drivers doesn't not have direct process it associated with come other like that if any body knows about this please clarify this
#kernel #driver #windows #beginer #os
According to an article in kernel.org, (https://www.kernel.org/doc/html/next/core-api/memory-allocation.html)
If you need to allocate many identical objects you can use the slab cache allocator. The cache should be set up with kmem_cache_create() or kmem_cache_create_usercopy().
What advantage does this give when multiple “identical” entities need memory?
And what is being “cached” here and how?
I have installed Raspberry Pi OS on my RPi4b and wanted to debug it using KGDB's serial connection onto another machine running gdb.
I have compiled the kernel on the other machine for inserting the symbol file and successfully connect to the PI's KGDB.
But it was too late when I realised the PI's kernel does not have debug symbols compiled in (obviously since it is a release build).
Now I have built a new kernel for the PI with CONFIG_DEBUG_INFO turned on. I want to replace this new kernel with the old one.
How do I go about it? Is it even possible?
I'm a beginner in kernel development, trying to compile the Nothing Phone 1 kernel, but keep hitting errors. Please don't direct me towards general Linux kernel compiling guides—they've never worked for me. Can anyone offer a device-specific guide or tips to get this done correctly?
I found these two directories in arch/arm64/kvm/ and was unable to find much resources online about them as a whole. Only mailing lists which explained a specific part of these two.
Please drop some resources and information:)
Hi all,
I quite new to linux kernel development so sorry if I has stupid question.
As of now I am working with CAT24C256WI-GT3, the requirement is there was a configuration file which previously used to "flash" the configures to CAT24C256WI-GT3 via Aarvark, now I want to build an script/executable program to flash it from terminal.
something like:
updateeprom read
and:
updateeprom write [path_to_binary_file]
I am looking into at24.c lib and trying to use it.
Any suggestion is very appreciated.
Thank you!
I installed 6.8 on my Beelink Mini S12 Pro PC today, so far it's running smoothly. Anyone else try the new kernel?
For example,
If atomic variable "v" has to be set to "i".
arch/arm64/kvm/vmid.c: atomic64_set(&v, i) is called.
This is where it takes us,
atomic64_set() --> raw_atomic64_set() --> arch_atomic64_set() --> arch_atomic_set() --> __WRITE_ONCE((v->counter), (i))
This expands to: *(volatile typeof(x) *)&(x) = (val); (include/asm-generic/rwonce.h)
Q1) So, what was the point of all this? How is an atomic variable different from any other variable?
Q2) Why typecast it as a volatile pointer and then dereference it?
Please help.
Hello, I updated the kernel to version 6.5.0-25.25 in the past week. The computer stays on Suspend mode often. Today, I rebooted the computer. The computer has two monitors, and I noticed that one would not load as usual. Upon booting, the graphics card was not detected and a single monitor continued to function. I restarted the computer multiple times before attempting to load into the older kernel (the older kernel is version 6.5.0-21.21). The second monitor responded during booting from the older kernel, and the system is running normally now that the older kernel version is loaded. I'll try to include relevant information below. Please inform me if additional information is needed (and the commands to obtain it would be helpful, as well).
Thanks in advance
uname -a
Linux ubuntu-desktop 6.5.0-21-generic #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 9 13:32:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
sudo lshw -c video
*-display
description: VGA compatible controller
product: GM204 [GeForce GTX 970]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:07:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:75 memory:fd000000-fdffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:c000(size=128) memory:c0000-dffff
*-graphics
product: EFI VGA
physical id: 1
logical name: /dev/fb0
capabilities: fb
configuration: depth=32 resolution=1024,768
I just built my OS and tested it on real hardware. This was done in the Cosmos C# Kernel. The only problem is that when it starts it shows for 1 second the error: PS/2 Controller Device Detection Failed: FirstByte 171
Help!!!
I am asking this because in the current kernel, the ARM64 KVM cannot be compiled out-of-tree as a module.
So if you make some changes, lets say you add some printk() statements, you will have to reboot the entire host machine in order to see changes. I see this as very cumbersome especially for an development environment.
So, that being said, how are people actually going about developing this subsystem of the kernel without external module support?
Thanks
I've been looking at the mainline Linux kernel driver/staging directory and have found a driver (rtl8912c) that I am interested in contributing to, mainly because I have a device with the rtl8912cu chipset.
I tried searching for a datasheet / reference manual / thing that describes the registers of the device, but could not find one. I have 2 questions :
And many other system softwares for that matter.
The open confidential computing conference is coming up online on March 13th: https://www.oc3.dev/
Some interesting talks from the kernel community:
Hey guys,
I am trying to write a device driver that detects writes (or accesses) to memory, that has been allocated (with kalloc) in the module's init function and mmaped to userspace when a process mmaps the given device.
I have read about UIO driver but from what I got, there is usually hardware and a IRQ involved in the course of the usage. Unfortunately I dont have hardware.
I have looked a bit into the mmu_notifier interface, but right now I am not experienced enough to know how this could work and what is needed to set this up properly.
Is the mmu_notifier the way to go or how is this achievable?
hey guys,
has the XFS bug (kernel 6.3) been fixed?
https://bugzilla.redhat.com/show_bug.cgi?id=2208553
I am trying to understand the KVM and QEMU internals.
I am debugging QEMU using gdb but QEMU calls ioctl() to talk to KVM using /dev/kvm.
But how do I debug when control reaches the kernel itself?
Since it is KVM, I cannot compile and run a linux kernel on QEMU and debug it I believe.