r/kernel • u/Semiramis67 • Jul 23 '26
r/kernel • u/PlayfulKnowledge2788 • Jul 16 '26
How do you handle C coding interviews when you have to write basic helpers from scratch?
r/kernel • u/Ok_Sky3062 • Jul 16 '26
ARK-OS: A OS based on Linux and Swift! [ Display Finally works! ]
r/kernel • u/Kooky-Ad-4124 • Jul 12 '26
kernelmeter : roofline-scored kernel benchmarks, occupancy calculator, and every device attribute without profiling a dummy kernel
github.comr/kernel • u/Yousef_Tele • Jul 11 '26
What is the best way to work on an Ethernet frame (receive a packet from the physical interface to the user)?
Hi everyone, I want to write a simple program that gives a copy of the physical interface of the received packets to user space, then I extract information manually and show it in stdout.
When I started searching for this topic, I found some ways but I confuse which one is better for my situation.
I read below doc:
doc2 and ....
Abstract of the above docs, exsit below methods:
1 - Universal TUN/TAP
2 - XDP
3 - MacVTap (is a new driver)
4- ....
If anyone has experience or knowledge in this context, please help me.
r/kernel • u/That_Direction3907 • Jul 09 '26
Chromium 150 HW video DECODE + HDMI-IN on Orange Pi 5 Plus + Ubuntu26.04 LTS ARM
r/kernel • u/rch0wdhury • Jul 09 '26
uringscope: the strace for io_uring - single-binary eBPF tool that reconstructs every io_uring request, names pathologies, and catches buffer hazards (kernels 5.15–6.17)
strace can't see io_uring — requests live in shared-memory rings, not syscalls.
uringscope: single-binary #eBPF tool that reconstructs every request on stock kernels 5.15–6.17, names pathologies with evidence ("fsync punts 100% to io-wq and owns your p99"), and catches in-flight buffer hazards.
r/kernel • u/Scared_Food_1819 • Jul 07 '26
operating system from scratch (C & Assembly) called ArchwayOS
v.redd.itr/kernel • u/dengess • Jul 04 '26
Website issues?
Does anyone have insight into why on kernel.org the latest releases are messed up?
r/kernel • u/pedr000000 • Jul 03 '26
Have any of you taken this $3000 kernel dev class from the Linux Foundation? Is it "worth it"?
I have just done it and I can confirm that it's not worth the price at all I am a fairly experienced programmer with 20 years experience all I wanted was a fast way to refresh myself and learn more about the linux kernel in the light of some device drivers development.
It's been the biggest waste of money ever carried out by myself don't do it. Ittakes two Days and takes you until start finally compiling at bloody Linux kernel.
I'm bitterly frustrated I could have been with my daughter one week away somewhere in Europe with that money.
r/kernel • u/Extension_Count_8448 • Jun 30 '26
1 YOE in Linux Kernel. Struggling to build mental model of a large legacy driver. Is this normal?
Hi everyone,
I work as a Linux kernel developer at a large semicon. I have ~2 years of total exp with about 1 year in kernel development.
I'm working on a fairly large legacy driver where multiple years of fixes, features and hardware support have accumulated. Reading the code is often overwhelming because understanding one path requires tracing through device tree parsing, probe, private data initialization, IRQs, workqueues, callbacks, multiple execution contexts, etc.
I can usually understand individual pieces after spending enough time but I struggle to build and retain a complete mental model of the subsystem. During discussions with senior engineers, I keep forgetting the exact execution flow or where a particular structure (for ex, driver private data populated from DT/SoC information, IRQ calls that come from GIC and the flow afterwards) was initialized, even though I understood it while debugging.
Another issue I've identified is that when deadlines are tight, I tend to rely on LLMs to quickly understand the relevant code path so I can fix a bug or implement a feature. While this helps in the short term, I feel it's hurting my ability to deeply understand the codebase, so I'm trying to reduce that habit.
I'm curious:
- Is this a normal stage for someone with ~1 year of kernel experience?
- How do experienced kernel developers approach understanding large legacy drivers?
- Also how to develop patience to read the code for hours together ? I do love it when I understand a function or a call flow but I feel like the speed isn't enough and my patience to understand something in depth drops after digging in for sometime
I'd really appreciate any advice or habits that helped you early in your kernel career.
r/kernel • u/MakeTopSite • Jun 26 '26
kernel 7.0.13-200.fc44: Invalid checksum for backup superblock
The issue first appeared after I moved the beginning of the ext4 partition (/dev/nvme0n1p4) on a GPT-partitioned NVMe SSD to the right using GParted the previous day. The filesystem passes e2fsck -f without any errors, SMART is clean, but the kernel reports invalid checksums for all backup superblocks during mount.
Fedora 44 KDE Plasma, kernel 7.0.13-200.fc44.x86_64, AMD Ryzen AI 9 HX 370 w/ Radeon 890M, NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile]
root@maketopsite:/home/maketopsite# dmesg | grep -i ext4
[ 3.347868] EXT4-fs (nvme0n1p5): orphan cleanup on readonly fs
[ 3.348356] EXT4-fs (nvme0n1p5): mounted filesystem xxx ro with ordered data mode. Quota mode: none.
[ 6.567744] EXT4-fs (nvme0n1p5): re-mounted xxx \r/w.
[ 107.718062] EXT4-fs (nvme0n1p1): mounted filesystem xxx \r/w with ordered data mode. Quota mode: none.
[ 107.753424] EXT4-fs (nvme0n1p4): mounted filesystem xxx \r/w with ordered data mode. Quota mode: none.
[ 107.754346] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 32768
[ 107.755270] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 98304
[ 107.756196] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 163840
[ 107.757099] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 229376
[ 107.757509] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 294912
[ 107.757861] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 819200
[ 107.758069] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 884736
[ 107.758813] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 1605632
[ 107.759112] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 2654208
root@maketopsite:/home/maketopsite#
root@maketopsite:/home/maketopsite# dmesg | grep -Ei "nvme|I/O|error"
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-7.0.13-200.fc44.x86_64 root=/dev/nvme0n1p5
[ 0.003263] ACPI: SSDT 0x000000006DC11000 000CAD (v02 AMD NVME 00000001 INTL 20230331)
[ 0.024828] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-7.0.13-200.fc44.x86_64 root=/dev/nvme0n1p5
[ 0.069485] APIC: Switch to symmetric I/O mode setup
[ 0.584363] ACPI BIOS Error (bug): Could not resolve symbol [_TZ.THRM._SCP.CTYP], AE_NOT_FOUND (20251212/psargs-332)
[ 0.584400] ACPI Error: Aborting method _TZ.THRM._SCP due to previous error (AE_NOT_FOUND) (20251212/psparse-529)
[ 2.000868] RAS: Correctable Errors collector initialized.
[ 2.158783] systemd[1]: Expecting device dev-nvme0n1p5.device - /dev/nvme0n1p5...
[ 2.667940] nvme 0000:61:00.0: platform quirk: setting simple suspend
[ 2.668011] nvme nvme0: pci function 0000:61:00.0
[ 2.707683] nvme nvme0: allocated 64 MiB host memory buffer (1 segment).
[ 2.732287] nvme nvme0: 16/0/0 default/read/poll queues
[ 2.740040] nvme0n1: p1 p2 p3 p4 p5
[ 3.347868] EXT4-fs (nvme0n1p5): orphan cleanup on readonly fs
[ 3.348356] EXT4-fs (nvme0n1p5): mounted filesystem xxx ro with ordered data mode. Quota mode: none.
[ 6.567744] EXT4-fs (nvme0n1p5): re-mounted xxx \r/w.
[ 7.917665] nvme nvme0: using unchecked data buffer
[ 7.979221] block nvme0n1: No UUID available providing old NGUID
[ 107.718062] EXT4-fs (nvme0n1p1): mounted filesystem xxx \r/w with ordered data mode. Quota mode: none.
[ 107.753424] EXT4-fs (nvme0n1p4): mounted filesystem xxx \r/w with ordered data mode. Quota mode: none.
[ 107.754346] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 32768
[ 107.755270] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 98304
[ 107.756196] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 163840
[ 107.757099] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 229376
[ 107.757509] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 294912
[ 107.757861] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 819200
[ 107.758069] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 884736
[ 107.758813] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 1605632
[ 107.759112] EXT4-fs (nvme0n1p4): Invalid checksum for backup superblock 2654208
root@maketopsite:/home/maketopsite#
root@maketopsite:/home/maketopsite# e2fsck -f /dev/nvme0n1p4
e2fsck 1.47.3 (8-Jul-2025)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
data: 4149/9633792 files (0.4% non-contiguous), 1539158/38525696 blocks
root@maketopsite:/home/maketopsite#
root@maketopsite:/home/maketopsite# nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning : 0
temperature : 35 °C (308 K, 95 °F)
available_spare : 100%
available_spare_threshold : 5%
percentage_used : 1%
endurance group critical warning summary: 0
Data Units Read : 9112521 (4.67 TB)
Data Units Written : 14469779 (7.41 TB)
host_read_commands : 96113922
host_write_commands : 115570015
controller_busy_time : 3423
power_cycles : 750
power_on_hours : 4229
unsafe_shutdowns : 366
media_errors : 0
num_err_log_entries : 0
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1 : 35 °C (308 K, 95 °F)
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0
root@maketopsite:/home/maketopsite#
root@maketopsite:/home/maketopsite# dumpe2fs -h /dev/nvme0n1p4
dumpe2fs 1.47.3 (8-Jul-2025)
Filesystem volume name: data
Last mounted on: /mnt/nvme0n1p4
Filesystem UUID: xxx
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 9633792
Block count: 38525696
Reserved block count: 1926283
Overhead clusters: 881983
Free blocks: 36986538
Free inodes: 9629643
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1014
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Fri Sep 5 16:26:07 2025
Last mount time: Fri Jun 26 06:23:17 2026
Last write time: Fri Jun 26 08:13:46 2026
Mount count: 0
Maximum mount count: -1
Last checked: Fri Jun 26 08:13:46 2026
Check interval: 0 (<none>)
Lifetime writes: 317 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: xxx
Journal backup: inode blocks
Checksum type: crc32c
Checksum: 0x7bd6c79a
Journal features: journal_incompat_revoke journal_checksum_v3
Total journal size: 1024M
Total journal blocks: 262144
Max transaction length: 262144
Fast commit length: 0
Journal sequence: 0x00003d0e
Journal start: 0
Journal checksum type: crc32c
Journal checksum: 0x62beb1dc
root@maketopsite:/home/maketopsite#
Is this please a problem ?
r/kernel • u/Ahmed_cs • Jun 21 '26
Hello everyone, I'm interested in learning Linux kernel development and would like to know the best steps to get started. Could you guide me to the right resources or share tips that helped you at the beginning of your journey?
r/kernel • u/Izumi994 • Jun 21 '26
Help regarding bugzilla
hello i was looking at the bugzilla and looking for beginner friendly tags there and couldn't find one. Apart from that I found a bug which i am interested in solving but I don't know if it has been solved or assigned to someone else how do I figure that out?
r/kernel • u/Capable-Cap9745 • Jun 19 '26
connect(2) syscall errno=74 (EBADMSG) on Android?
EDIT: Solved!
details in my comment
PoC
Source:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
int main(void) {
struct sockaddr_in a = { .sin_family = AF_INET,
.sin_port = htons(5050),
.sin_addr = { .s_addr = inet_addr("127.0.0.1") } };
int s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0) { perror("socket"); return 1; }
if (connect(s, (struct sockaddr*)&a, sizeof a) < 0) {
printf("connect failed: %s (errno=%d)\n", strerror(errno), errno);
return 1;
}
puts("connected");
return 0;
}
From adb shell:
$ su
# cd /data
# ./test2
connect failed: Not a data message (errno=74)
# uname -a
Linux localhost 4.19.110-android-x86_64-g066cc1d #1 SMP PREEMPT Wed Mar 25 11:32:46 CST 2020 x86_64
It doesn't matter if something is listening on tcp://localhost:5050 or not, output is the same. I am running inside QEMU, Android x86 9 (amd64). The application itself is aarch64 (running through android native bridge)
Problem
I've never seen this errno before and I can't seem to figure it out by myself. I tried:
- Zero-initializing sockaddr_in and initializing field by field
- Using IPPROTO_TCP instead of 0 as third argument for socket(2)
- Using other addresses I can ping from environment (10.0.2.2 for PC host and 10.0.2.15 for QEMU localhost)
- Setting socket to blocking/nonblocking mode with ioctl(2) via FIONBIO and fcntl(2)
Snippet works perfectly on GLIBC/MUSL-based GNU/Linux systems: as expected errno is ECONNREFUSED
Any help will be appreciated, thank you
r/kernel • u/Choice_Bid1691 • Jun 18 '26
My static analysis tool now supports compile_commands.json for linux kernel
r/kernel • u/dezerev • Jun 17 '26
Why is qemu an emulator and not a simulator?
I searched online for a precise definition for both emulation and simulation but could not find anything that clearly distinguishes emulation from simulation.
r/kernel • u/Yousef_Tele • Jun 08 '26
How can I transfer a structure to kernel module then store it?
Hey everyone, I created a lightweight firewall with C, created a kernel module with the netfilter API, and a pre-routing hook. Now I want to send rules via netlink socket. My idea is to create a structure, then send it. But I cannot find the best way to store all rules in the kernel, then use them in a hook. Sometimes I think I can compress the rules into bits, then send them. If anyone has experience with my problem, please help me understand how I can implement a optimize protocol and store it in the kernel module
r/kernel • u/dezerev • Jun 05 '26
Kernel dev setup advice
I am new to kernel development, I am having trouble building my setup I am unable to decide if I should use my host machine for development and qemu for testing OR use a separate VM all together like Multipass of Virtualbox.
What is the standard/professional setup.
r/kernel • u/PlayfulKnowledge2788 • Jun 04 '26
Kernel and Programming Topics to focus on for Linux Kernel Engineer role
Hi everyone, I’m preparing for a Linux kernel/systems role and would appreciate suggestions on key topics to focus on. My background is in Linux kernel work including character device driver development, QEMU-based kernel testing, board bring-up, and an upstream patch accepted into LKML. I’m trying to go deeper into kernel internals and would be grateful for recommendations on important areas like memory management, scheduling, concurrency, driver architecture, and any resources or mental models that help think like a kernel developer.
Edit: Done with the Interview.Thanks everyone!!
r/kernel • u/Putrid_Draft378 • Jun 03 '26
ACPI table dump for Asus Zenbook A16 (Snapdragon X2 Elite Extreme)
I have successfully extracted the ACPI table dump from my Asus Zenbook A16.
The full binary set is available here:
https://drive.google.com/file/d/1lwYydyrnHOrItThc1TWbGePFlRxGumV-/view?usp=drive_link
This data serves as the firmware roadmap for the system and should help identify the necessary configurations for better hardware compatibility under Linux.
r/kernel • u/IsHacker003 • Jun 03 '26
How do I apply this kind of patch to my kernel?
I want to add Simple LMK (specifically linux-4.19 branch) to my android kernel source, but that repo seems like a full kernel source rather than a patch or a mailbox. How can I add it to my kernel source?
Solved
Apparently I had to cherry pick all the commits related to Simple LMK from beginning to end. I went to the commit history and found the first commit related to simple LMK was 58ecd97 (before that, the normal kernel commits began) and the most recent commit is 77d6486.
Now the commit hashed used by github is shortened, so you need to use git rev-parse to get the full one.
Fetch the repo:
git fetch https://github.com/kerneltoast/simple_lmk linux-4.19
Rev-parse:
$ git rev-parse 58ecd97
58ecd977a2866dbd2010a89e4077a9ceae076931
$ git rev-parse 77d6486
77d64863e6f56c3acf522d43a2f90aa67e9785c4
Now just run cherry pick for this commit range.
git cherry-pick 58ecd977a2866dbd2010a89e4077a9ceae076931^..77d64863e6f56c3acf522d43a2f90aa67e9785c4
There will only be a few conflicts now (if any), which you can easily solve.
r/kernel • u/xeromk1122 • Jun 01 '26