Understanding Linux System Architecture: A Comprehensive Guide
This article explains the four core components of a Linux system—kernel, shell, file system, and applications—detailing kernel subsystems such as memory and process management, VFS, device drivers, networking, shell variants, file types, directory hierarchy, disk partitions, mounting procedures, and link mechanisms.
Overview
Linux systems are typically divided into four major parts: the kernel, the shell, the file system, and applications. Together they enable users to run programs, manage files, and interact with the operating system.
Linux Kernel
The kernel is the core of the operating system, handling process, memory, device driver, file system, and network management. Its main components include memory management, process management, device drivers, file system support, and network management.
Memory Management
Linux uses virtual memory to abstract physical memory into 4 KB pages. The SLAB allocator provides an abstraction over these pages, allowing dynamic allocation of structures and tracking of page usage. When physical memory is exhausted, pages are swapped to disk via the swap mechanism. Source code resides in ./linux/mm.
Process Management
Processes are independent execution entities. Linux achieves multitasking by time‑slicing CPU access, with a priority‑based scheduler selecting the next runnable 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 the SCI layer.
File System
Linux organizes storage devices into a hierarchical tree of file systems, mounted at specific directories. The most common native file system is Ext2, but Linux also supports FAT, VFAT, Ext3, and many others. The Virtual File System (VFS) abstracts hardware details, offering a uniform API for operations like open, close, read, and write. VFS sits above the file system implementations and below the buffer cache and device drivers.
Device Drivers
Device drivers run in high‑privilege mode and expose abstract interfaces to the kernel. Errors in drivers can crash the system. Drivers are specific to hardware (e.g., SCSI vs. IDE) and are located in ./linux/drivers.
Network Interface (NET)
Linux supports the BSD socket API and the full TCP/IP protocol suite. The network stack consists of socket handling, protocol layers, and device drivers for various network hardware.
Linux Shell
The shell is the user interface that interprets commands and forwards them to the kernel. Common shells include Bourne Shell, Bash (the default on most distributions), Korn Shell, and C Shell.
File Types
Regular files (text, binaries)
Directory files
Link files (hard and symbolic)
Device files (block and character devices)
FIFO (named pipe) files
Socket files
Commands such as ls -l, file, and stat display file type information.
Directory Structure
Linux uses a single unified directory tree rooted at /. Key directories include /bin, /dev, /etc, /home, /lib, /sbin, /tmp, /root, /mnt, /proc, /var, and /usr (with subdirectories like /usr/bin, /usr/lib, /usr/include, etc.).
Disk Partitions
Linux distinguishes primary, extended, and logical partitions. Devices are identified as /dev/hdXn (IDE) or /dev/sdXn (SCSI/SATA). Example fdisk -l output:
[root@localhost ~]# 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 971 4131 9767488+ 83 linux
...Mounting File Systems
Each partition must be mounted to a directory to become accessible. The mount command syntax is mount [-options] [device] [mount_point]. Common options include -t to specify the file system type and -o for additional flags (e.g., ro, rw, user, codepage=XXX, iocharset=XXX).
Example mounting a Windows FAT32 partition: # mount -t vfat /dev/hda5 /mnt/winc Automatic mounting at boot is configured in /etc/fstab. Sample entries:
/dev/hda2 / ext3 defaults 1 1
/dev/hda1 /boot ext3 defaults 1 2
/dev/hda5 /mnt/winc vfat defaults,codepage=936,iocharset=cp936 0 0Links
Hard links share the same inode and cannot cross file system boundaries. Symbolic (soft) links store a pathname and can span file systems. Commands: ln for hard links, ln -s for symbolic links.
Key Commands
Disk/space: fdisk, df, du File navigation: cd, pwd, mkdir, rmdir, ls, cp, mv, rm File viewing: cat, more, less, head, tail Permissions: chmod, chown, chgrp, umask Search: which, whereis, locate,
findKernel Parameter Optimization
Kernel parameters are exposed via the /proc filesystem, allowing runtime tuning of system performance.
Linux Tech Enthusiast
Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.
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.
