Linux from Scratch #2: Is Linux an Operating System or Just a Kernel?
When I first started learning Linux, I constantly heard two different statements: "Linux is an operating system." "Linux is just a kernel." At first, I thought one of them had to be wrong. After learning how Linux actually works, I realized both statements make sense depending on the context. Let's understand why. What Is an Operating System? An operating system (OS) is the software that acts as…
When I first began learning about Linux, I encountered two contrasting statements: Linux is an operating system, and Linux is just a kernel. Initially, I doubted which claim was accurate. However, after delving deeper into Linux's inner workings, I realized that both statements hold true depending on the context.
To comprehend the distinction, it is essential to understand what an operating system (OS) is and what a kernel represents. An operating system serves as the intermediary between users, applications, and the computer's hardware. Without an OS, applications would be unable to communicate effectively with the CPU, memory, keyboard, display, storage devices, or network hardware.
The OS provides crucial services, including process management, memory management, file management, device management, security and permissions, and networking, enabling applications to run without concerning themselves about the underlying hardware.
The kernel, on the other hand, is the core component of an operating system. It acts as the manager that constantly operates in the background. Every program seeking hardware access must interact with the kernel. The kernel's responsibilities include scheduling CPU time, allocating memory, managing devices using drivers, handling filesystems, managing processes, enforcing permissions, and providing system calls.
Applications cannot directly control hardware; instead, they request services from the kernel. Applications such as command-line tools (e.g., ls, cp, mv, etc.), file editors, and web browsers rely on the kernel for these functions.
Linux, specifically, refers to the Linux kernel developed by Linus Torvalds in 1991. It is the core component that enables hardware access for programs. However, the kernel alone cannot provide a complete user experience. For example, it cannot allow users to type commands, display directories using ls, copy files using cp, edit files, or browse the web.
Instead, these commands originate from the GNU Project, which offers many of the utilities commonly used daily. The shell (such as Bash or Zsh) is also a distinct program that facilitates interaction with the kernel. When you input the command "ls," the shell initiates the ls program, which subsequently makes system calls to the Linux kernel.
The kernel retrieves directory information from the filesystem and returns it to the program, which subsequently displays it on your screen.
A Linux distribution assembles everything essential to create a functional operating system. A typical distribution comprises the Linux kernel, GNU utilities (such as the shell), package manager, system libraries, and optional desktop environment. Examples of popular Linux distributions include Ubuntu, Debian, Fedora, Arch Linux, and Linux Mint. Each distribution employs the Linux kernel but packages it with different software and tools.
Some individuals assert the term GNU/Linux to emphasize that the majority of user-space tools originate from the GNU Project, while Linux constitutes merely the kernel. Consequently, proponents of this term prefer referring to the entire operating system as GNU/Linux rather than Linux alone. Conversely, many users prefer the simpler term "Linux" due to its commonality. Both expressions are widely utilized today, contingent on the context.
To summarize the aforementioned points, Linux is technically a kernel rather than a complete operating system by itself. However, in casual conversation, people often utilize the word Linux to denote the entire operating system furnished by Linux distributions. Grasping this distinction assists in better understanding how Linux functions internally and why various distributions can possess the same kernel but offer distinct user experiences.
In the forthcoming article, we shall explore the process of how a Linux system boots, from the moment the power button is pressed to the appearance of the login prompt. I eagerly anticipate our next discussion in Linux from Scratch #3.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to