Linux is cool and can do amazing things in the enterprise data center, whether it’s hosting a web app or acting as an Internet firewall. But what makes up the modern Linux OS? What are the many pieces and parts that make the Linux OS work? Before we answer those questions, let’s start by answering a few more basic questions about Linux architecture such as…
What is an operating system?
The short answer is that an operating system, or OS, is software that you load on your hardware to make it do things. Without an operating system, most hardware is useless. For example, you might have a Dell computer that runs the Windows 10 operating system from which you run your applications. You might have an iPhone that runs the iOS operating system. You may also have an Apple MacBook that runs the Apple macOS operating system. The operating systems on these hardware platforms are what enable them to run applications, as shown in the graphic.
What is a kernel, and what does it do?
The kernel is the special piece of the operating system that controls the CPU hardware, allocates memory, accesses data, schedules processes, runs the applications and protects them from each other. It is the first program loaded on the computer when the computer starts up. The most critical pieces of code in the kernel are loaded into protected areas of memory so that they can’t be overwritten by other applications running in the operating system.
The components that comprise the Linux operating system
Linux is an open-source OS that can be installed on a variety of different types of hardware to allow you to develop software, run applications and more. At the heart of Linux is the kernel. Linux was developed in C and assembly language to run on i386 personal computers, but it has since been ported to more hardware than just about any other operating system in history. Today, Linux is the most installed operating system globally. In fact, the Space X Falcon 9 rocket and the International Space Station both use Linux!
Linux is typically administered from a command line interface (CLI), also known as a shell. Besides the kernel, which manages the hardware and software processes, Linux distributions include a collection of Linux software, such as device drivers for accessing and controlling hardware, shared libraries, applications and system daemons, which run the in background and respond to network requests. The graphic below shows an example of what a common Linux distribution might look like. Numerous programming languages are available for Linux, as well as more than 70,000 different applications. Applications are installed from packages, which contain the application itself and metadata about the application.
Understanding user space vs. kernel space
It’s important to know that operating systems all execute their kernel in protected and restricted memory that is called kernel space (see the graphic below) to prevent the kernel from terminating and crashing the system. When a user runs an application or tool, that application or tool executes in what is called user space. This distinction is critical. Applications can come from a variety of sources, may be poorly developed or originate unknown sources. By running these applications separate from kernel space, they can’t tamper with the kernel resources and cause the system to panic (crash).
All applications, even system daemon processes that perform critical operating system functions, must make what is called a system call to the kernel in the kernel space in order to access system resources such as memory or network devices. Every modern multi-user operating system has some type of user space versus kernel space design, which is intended to keep it secure, high-performing and reliable.
In short, the separation between user space and kernel space is made to ensure that Linux is as reliable and secure an operating system as possible.
In this post you learned what an operating system is, what a kernel is, what the kernel does, the components that make up the Linux OS and, as a bonus, the definition between user space and kernel space. I hope that you now have a better understanding of the underlying pieces of the Linux OS and what makes the Linux OS so reliable.