<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kernel on Samuel Matildes - Knowledge Base</title><link>https://docs.matildes.dev/tags/kernel/</link><description>Recent content in Kernel on Samuel Matildes - Knowledge Base</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 26 May 2026 14:15:13 +0100</lastBuildDate><atom:link href="https://docs.matildes.dev/tags/kernel/index.xml" rel="self" type="application/rss+xml"/><item><title>Why Kernel Crash Dumps Are Critical for Root Cause Analysis</title><link>https://docs.matildes.dev/linux/kernel/why-kernel-crash-dumps-matter/</link><pubDate>Tue, 14 Oct 2025 00:00:00 +0000</pubDate><guid>https://docs.matildes.dev/linux/kernel/why-kernel-crash-dumps-matter/</guid><description>&lt;p&gt;&lt;i class="fas fa-microscope" aria-hidden="true"&gt;&lt;/i&gt; Postmortem Kernel Forensics with vmcore&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary&lt;a class="td-heading-self-link" href="#summary" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When the Linux kernel panics, there is no userspace stack, no application logs, and often no intact filesystems. The only canonical, lossless record of the kernel’s terminal state is the crash dump (vmcore). Without vmcore, you are constrained to heuristics and guesswork; with vmcore, you can deterministically reconstruct CPU state, task scheduling, memory allocators, locks, timers, and subsystems at the exact point of failure. This is the difference between timeline narratives and hard proof.&lt;/p&gt;</description></item><item><title>Enabling Automatic Kernel Crash Collection with kdump</title><link>https://docs.matildes.dev/linux/kernel/enabling-kdump-crash-collection/</link><pubDate>Mon, 13 Oct 2025 00:00:00 +0000</pubDate><guid>https://docs.matildes.dev/linux/kernel/enabling-kdump-crash-collection/</guid><description>&lt;p&gt;&lt;i class="fas fa-microchip" aria-hidden="true"&gt;&lt;/i&gt; Automatic Enablement of Kernel Crash Dump Collection with kdump-enabler&lt;/p&gt;
&lt;p&gt;This article explains how to automatically enable and configure kernel crash dump (kdump) collection on Linux systems using the &lt;code&gt;kdump-enabler&lt;/code&gt; script. This approach works across multiple distributions and simplifies the process of preparing your system to collect crash dumps for troubleshooting and analysis.&lt;/p&gt;
&lt;h2 id="overview"&gt;Overview&lt;a class="td-heading-self-link" href="#overview" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;kdump-enabler&lt;/code&gt; is a Bash script that automates the setup of kdump:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installs required packages&lt;/li&gt;
&lt;li&gt;Configures the crashkernel parameter in GRUB&lt;/li&gt;
&lt;li&gt;Enables and starts the kdump service&lt;/li&gt;
&lt;li&gt;Sets up SysRq for manual crash triggering&lt;/li&gt;
&lt;li&gt;Creates backups of configuration files before changes&lt;/li&gt;
&lt;li&gt;Supports Ubuntu, Debian, RHEL, CentOS, Fedora, openSUSE, Arch Linux, and more&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;a class="td-heading-self-link" href="#prerequisites" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Root privileges (run with &lt;code&gt;sudo&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;systemd-based Linux distribution&lt;/li&gt;
&lt;li&gt;GRUB bootloader&lt;/li&gt;
&lt;li&gt;Sufficient disk space in &lt;code&gt;/var/crash&lt;/code&gt; for crash dumps&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="installation"&gt;Installation&lt;a class="td-heading-self-link" href="#installation" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Clone the repository and run the script:&lt;/p&gt;</description></item><item><title>Kernel Mode vs User Mode: Privilege Levels and System Call Execution</title><link>https://docs.matildes.dev/linux/kernel/kernel-mode-vs-user-mode/</link><pubDate>Tue, 14 Jan 2025 00:00:00 +0000</pubDate><guid>https://docs.matildes.dev/linux/kernel/kernel-mode-vs-user-mode/</guid><description>&lt;p&gt;&lt;i class="fas fa-shield-alt" aria-hidden="true"&gt;&lt;/i&gt; CPU Privilege Levels and Execution Contexts&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary&lt;a class="td-heading-self-link" href="#summary" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Modern processors implement hardware-enforced privilege levels to isolate untrusted user code from critical kernel services. Linux uses two primary modes: &lt;strong&gt;kernel mode&lt;/strong&gt; (ring 0, CPL 0, EL1) and &lt;strong&gt;user mode&lt;/strong&gt; (ring 3, CPL 3, EL0). Kernel mode grants unrestricted access to CPU features, physical memory, I/O ports, and privileged instructions. User mode restricts access to a virtualized, isolated address space and requires kernel mediation for hardware resources. The transition between modes occurs via system calls, interrupts, and exceptions, all managed by the kernel&amp;rsquo;s interrupt and system call handlers. Understanding this separation is fundamental to security, performance optimization, and kernel debugging.&lt;/p&gt;</description></item><item><title>Understanding CPU Statistics in Linux (/proc/stat)</title><link>https://docs.matildes.dev/linux/kernel/cpu-statistics/</link><pubDate>Tue, 14 Jan 2025 00:00:00 +0000</pubDate><guid>https://docs.matildes.dev/linux/kernel/cpu-statistics/</guid><description>&lt;p&gt;&lt;i class="fas fa-microchip" aria-hidden="true"&gt;&lt;/i&gt; Kernel-Level CPU Time Accounting&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary&lt;a class="td-heading-self-link" href="#summary" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Linux kernel maintains precise, per-CPU time accounting across ten distinct execution contexts. These statistics, exposed via &lt;code&gt;/proc/stat&lt;/code&gt;, represent cumulative jiffy counters (typically 1/100th or 1/1000th of a second) since system boot. Understanding these counters is essential for performance analysis, capacity planning, and diagnosing CPU contention, I/O bottlenecks, interrupt storms, and virtualization overhead.&lt;/p&gt;
&lt;h2 id="the-procstat-interface"&gt;The /proc/stat Interface&lt;a class="td-heading-self-link" href="#the-procstat-interface" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;/proc/stat&lt;/code&gt; is a virtual file provided by the kernel&amp;rsquo;s proc filesystem. It contains system-wide statistics aggregated across all CPUs and individual per-CPU lines. The format is non-blocking and updated atomically by the kernel scheduler&amp;rsquo;s tick handler.&lt;/p&gt;</description></item></channel></rss>