Understanding Linux: Kernel, Memory, Processes, and File Systems Explained
This comprehensive guide explores the core components of a Linux system—including the kernel, memory management, process scheduling, file system architecture, device drivers, networking, and shell—while also covering disk partitions, mounting, and practical command examples for system administration.
Linux Kernel
The kernel is the core of the operating system, managing processes, memory, device drivers, files, and networking, and directly influencing system performance and stability. It consists of memory management, process management, device drivers, file system, and network management components.
System call interface (SCI) provides mechanisms for user‑space to kernel function calls; implementations can be found in ./linux/kernel and architecture‑specific code in ./linux/arch.
Memory Management
Linux uses virtual memory to allow limited physical memory to satisfy large application demands, dividing memory into 4 KB pages. It includes mechanisms like the SLAB allocator for managing page‑based structures and supports swapping pages to disk when memory is exhausted. Source code resides in ./linux/mm.
Process Management
Processes are execution entities of applications. Linux achieves multitasking by time‑slicing CPU access, using a priority‑based scheduler to select the next process. Inter‑process communication mechanisms include signals, pipes, shared memory, semaphores, and sockets. System calls such as fork, exec, kill, and exit are provided via SCI.
File System
Linux organizes file systems into a hierarchical tree using a Virtual File System (VFS) layer that abstracts hardware details. VFS provides a common API for operations like open, close, read, and write. Under VFS are specific file system implementations (e.g., Ext2, Ext3, FAT, VFAT) whose source code is in ./linux/fs. The buffer cache sits below the file system layer, optimizing device access.
Device Drivers
Device drivers run in high‑privilege mode and directly control hardware. Errors in drivers can crash the OS. Drivers provide abstract interfaces to the kernel, with specific implementations for hardware types (e.g., SCSI vs. IDE).
Network Interface (NET)
Linux supports BSD sockets and the full TCP/IP suite. The network stack consists of socket APIs, protocol layers, and device driver modules that communicate with hardware.
Linux Shell
The shell is the user interface that interprets commands and passes them to the kernel. Common shells include Bourne Shell, Bash (Bourne Again Shell), Korn Shell, and C Shell.
Linux File System Types
Supported file systems include Ext2, Ext3, FAT, FAT32, VFAT, ISO9660, XFS, JFS, ReiserFS, and many others. Each file system has its own characteristics and may require formatting before use.
File Types
Regular files (text, binaries, scripts)
Directory files
Link files (hard and symbolic)
Device files (block and character devices under /dev)
FIFO (named pipes)
Socket files
Commands like ls -l, file, and stat display file type information.
Linux Directory Structure
Linux uses a single root directory ( /) with a hierarchical tree of subdirectories such as /bin, /dev, /etc, /home, /lib, /sbin, /tmp, /root, /mnt, /proc, /var, and /usr. Each serves specific purposes (executables, device nodes, configuration, user homes, libraries, system binaries, temporary files, mount points, virtual process info, variable data, and user applications respectively).
Disk Partitions
Linux distinguishes primary, extended, and logical partitions. Devices are identified as /dev/hdX (IDE) or /dev/sdX (SCSI/SATA) with partition numbers (e.g., /dev/sda1). Partition information can be listed with fdisk -l.
# fdisk -l
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 970 7791493+ 7 HPFS/NTFS
/dev/hda2 971 9729 70356667+ 5 Extended
/dev/hda5 971 2915 15623181 b W95 FAT32
/dev/hda6 2916 4131 9767488+ 83 linux
/dev/hda7 4132 5590 11719386 83 linux
/dev/hda8 5591 6806 9767488+ 83 linux
/dev/hda9 6807 9657 22900626 83 linux
/dev/hda10 9658 9729 578308+ 82 linux swap / SolarisMounting File Systems
Each partition is a file system that must be mounted onto a directory (mount point) to be accessible. The mount command syntax is mount [-options] [device] [mount_point]. Common options include -t to specify the file system type and -o for mount flags such as ro, rw, user, etc.
Example: # mount -t vfat /dev/hda5 /mnt/winc mounts a Windows FAT32 partition.
Automatic Mounting
The /etc/fstab file lists file systems to be mounted at boot. Entries include device, mount point, file system type, and options. Example entries for Windows C and D drives with codepage and charset parameters are shown.
/dev/hda2 / ext3 defaults 1 1
/dev/hda1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,codepage=936,iocharset=gb2312 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hdb1 /mnt/winc vfat defaults,codepage=936,iocharset=cp936 0 0
/dev/hda5 /mnt/wind vfat defaults,codepage=936,iocharset=cp936 0 0Hard and Symbolic Links
Hard links share the same inode and cannot cross file system boundaries; deleting one does not affect the other. Symbolic (soft) links are special files containing the path to the target and can span file systems; they become dangling if the target is removed.
Key Kernel Structures
VFS uses several core structures: file (open file descriptor), dentry (directory entry cache), inode (metadata), and super_block (file system-wide information). These structures link user processes to underlying storage.
Linux Applications
Typical applications include text editors, programming languages, X Window system, office suites, internet tools, and databases.
Linux Kernel Parameter Optimization
Kernel parameters exposed via the /proc filesystem allow runtime tuning of system performance.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
