Kernel Lab 1: Observing Process and VFS Structs
Kernel Lab 1: Observing Process and VFS Structs Primer on Kernel Data Structures 1. Process & Memory Management (MM) Struct Description Noteworthy Fields task_struct The kernel’s representation of a thread/process. mm (memory space), files (open files), fs (cwd/root), pid, comm (name). mm_struct The descriptor for an entire memory address space. mm_mt (the Maple Tree of VMAs), pgd (page global directory for hardware MMU). vm_area_struct A contiguous range of virtual memory with shared permissions (a VMA). vm_start, vm_end, vm_file (if it’s a memory-mapped file), vm_flags. 2. Virtual File System (VFS) The VFS bridges the gap between user-space file operations (like open() and read()) and the underlying hardware. ...