<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Task_struct on Sanketh's Blog</title><link>https://sankethbk.github.io/blog/tags/task_struct/</link><description>Recent content in Task_struct on Sanketh's Blog</description><generator>Hugo -- 0.165.0</generator><language>en-us</language><lastBuildDate>Thu, 16 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://sankethbk.github.io/blog/tags/task_struct/index.xml" rel="self" type="application/rss+xml"/><item><title>Kernel Lab 1: Observing Process Structs</title><link>https://sankethbk.github.io/blog/posts/operating-systems/linux/2026-07-16-kernel-lab-observing-process-structs/</link><pubDate>Thu, 16 Jul 2026 00:00:00 +0000</pubDate><guid>https://sankethbk.github.io/blog/posts/operating-systems/linux/2026-07-16-kernel-lab-observing-process-structs/</guid><description>&lt;h1 id="kernel-lab-1-observing-process-and-vfs-structs"&gt;Kernel Lab 1: Observing Process and VFS Structs&lt;/h1&gt;
&lt;p&gt;&lt;img alt="Kernel Data structures Map" loading="lazy" src="https://sankethbk.github.io/blog/images/kernel-data-structures-summary.png"&gt;&lt;/p&gt;
&lt;h2 id="primer-on-kernel-data-structures"&gt;Primer on Kernel Data Structures&lt;/h2&gt;
&lt;h3 id="1-process--memory-management-mm"&gt;1. Process &amp;amp; Memory Management (MM)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Struct&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Noteworthy Fields&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;task_struct&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The kernel&amp;rsquo;s representation of a thread/process.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mm&lt;/code&gt; (memory space), &lt;code&gt;files&lt;/code&gt; (open files), &lt;code&gt;fs&lt;/code&gt; (cwd/root), &lt;code&gt;pid&lt;/code&gt;, &lt;code&gt;comm&lt;/code&gt; (name).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mm_struct&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The descriptor for an entire memory address space.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mm_mt&lt;/code&gt; (the Maple Tree of VMAs), &lt;code&gt;pgd&lt;/code&gt; (page global directory for hardware MMU).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vm_area_struct&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A contiguous range of virtual memory with shared permissions (a VMA).&lt;/td&gt;
&lt;td&gt;&lt;code&gt;vm_start&lt;/code&gt;, &lt;code&gt;vm_end&lt;/code&gt;, &lt;code&gt;vm_file&lt;/code&gt; (if it&amp;rsquo;s a memory-mapped file), &lt;code&gt;vm_flags&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="2-virtual-file-system-vfs"&gt;2. Virtual File System (VFS)&lt;/h3&gt;
&lt;p&gt;The VFS bridges the gap between user-space file operations (like &lt;code&gt;open()&lt;/code&gt; and &lt;code&gt;read()&lt;/code&gt;) and the underlying hardware.&lt;/p&gt;</description></item></channel></rss>