Table of Contents

What is an Operating System?

An operating system (OS) does exactly what the name states: It is software that operates a computer system!

Not all computers have had or required an operating system. Particularly simple computers, including the earliest models of both business computers and microcomputers, as well as very simple embedded computers, do not require an operating system. The computer embedded into a simple mass-market microwave oven, for example, only ever runs one program, does not have communications capabilities, does not multitask, and is nevery updated, and therefore has no operating system.

However, virtually all contemporary computer systems, including embedded devices, are sufficiently complex that they are equipped with an operating system.

What does an Operating System do?

An operating system performs four main functions:

Management and Separation of Resources

Think of the specifications that were advertised when you bought your last computer (or smartphone):

All of these are system resources. The operating system manages these resources to ensure that they are used effectively, and to ensure that there are no conflicts over their use.

As requested by the user(s), or as triggered by other factors such as the time of day or operational requirements, the OS will create processes – running copies of computer programs. Each process is allocated compute resources by being permitted to run on one or more computer cores. To run a large number of processes, the OS will switch between them, stopping one process and starting another as needed to ensure that all of the processes get a fair share of system resources (which may not always be an equal share).

The operating system will allocate the available memory to processes and to the operating system's internal operations. The OS will program the system hardware to ensure that no process can overwrite memory allocated to another process.

The OS will also allocate storage space to various files as they are created and extended, and deallocate space when those files are truncated (shortened) or deleted. The space allocated to one file will be protected from use in other files.

Display space is similarly shared; the operating system will ensure that multiple programs can each display in their own windows, but prevent them from destroying graphics being displayed by other windows.

Peripheral devices are managed in different ways according to the characteristics of the device. For example, sound output from multiple processes will be combined for simultaneous output to the speakers (or other output devices). However, when a process accesses a printer, output from that processes is collected into a document, and the documents are queued for sequential printing, because simultaneous access would result in garbled output.

Security Enforcement

It’s important to keep information private in some contexts, and to share information in other contexts. The operating system is responsible for enforcing security rules. For example, on a smartphone, a social media app shouldn’t be able to access data from a banking app, and on a cloud server, one customer shouldn’t be able to access another customer’s data. However, multiple smartphone apps might be permitted to access a photo album, and a company employee might need to view a report generated on a server from multiple customers’ data.

The operating system is responsible for enforcing the security rules but not for creating them – the system administrators and/or users are responsible for creating and maintaining the security settings and policies which the operating system enforces.

Hardware Abstraction

There are many different types of devices that perform similar functions, and multiple ways that these devices can be connected. For example:

The operating system abstracts away these hardware details. This means that programs can access devices in a general way without having to be programmed to individually deal with each type of device that may be used. This enables a program to request keyboard input or play sounds without regard to the details of the specific hardware available.

Maintaining the Programming Model

The operating system, computer hardware, and development tools (compiler, linker, and so forth) work together to present the “programming model” – a conceptual framework which software developers use when creating software.

As a simple example, several different application program may be designed to occupy the same area of memory; obviously, this presents a conflict when these applications are used at the same time, so the operating system works with the computer’s hardware to load the applications into different areas of physical memory, and then use the computer’s virtual memory capabilities to make each program appear to be loaded into the region of memory for which it was written.

Components of an Operating System

Most modern operating systems are delivered as five separate and inter-related parts:

The Kernel

This is the heart of the operating system, the main program (or group of programs) that controls the computer. The kernel operates in a special privileged mode, which allows it to manage the resources and security settings for all other software. The kernel is loaded by the computer’s firmware (built-in software) and sets up the computer’s hardware and resources before starting the services and user interface(s) in non-privileged mode, programming the computer’s hardware to enforce the privilege level.

System Libraries

Many programs need to perform the same operations, such as accessing the network, playing sound, or drawing something on the screen. Libraries provide a common set of software routines (also known as functions, methods, procedures, or subroutines) which programs access to perform these common operations. This eliminates the need for each program to contain duplicate code for these common operations, which reduces software duplication and program size. Although additional libraries may be installed on the computer, the system libraries provided as part of the operating system provide the most broadly-used routines required by nearly every program.

Services

These are programs that run continuously in the background, providing services such as WiFi authentication, print management, and file sharing. Unlike the kernel, these programs don’t operate with full system privilege, and are therefore subject to the same type of resource and security management as regular programs, and they also utilize the system libraries.

The User Interface(s)

This is the software that enables the user to interact with the system. Most operating systems provide at least two user interfaces:

1. A text-based user interface that enables the user to enter commands, view the output from those commands, and interact with full-screen text interfaces such as file editors and file managers. This may be referred to as a text user interface (TUI) or a command line interface (CLI). Here are command line interfaces on Windows, Linux, and Android systems displaying similar information:

A side-by-side view of Windows (10), Linux (Fedora 38), and Android command-line interfaces (CLI) displaying similar information.

2. A graphical user interface (GUI) that typically enables the user to interact with multiple application windows, using a keyboard and a pointing device such as a mouse, trackpad, or touchscreen. Here are graphical user interfaces on Windows and Linux systems showing similar capabilities and information:

A side-by-side view of Windows (10) and Linux (Fedora 38 - Gnome) graphical user interfaces displaying similar information.

Utilities and Applications

Most operating systems provide a set of tools to enable users to perform setup, configuration, and maintenance tasks. For example, they may provide “utility” software to add/remove software, configure hardware, and manage files. This utility software may take the form of commands that are accessed through a CLI, or graphical utilities that are accessed through a GUI. Most operating systems also provide a set of basic starter applications, such as a text editor, clock, a few games, and sometimes a web browser; the quantity and complexity of the included applications vary considerably from one operating system to another.

GUI vs CLI: Advantages and Disadvantages

Both graphical user interfaces (GUIs) and Command Line Interfaces (CLIs) have strengths and weaknesses, making them suited for different types of use.

The visual nature of a graphical user interface makes it well-suited for creating, editing, and viewing visual media, such as photos, videos, presentations, and highly-formatted documents. A GUI is also well-suited to dense displays of visual information, such as data dashboards. However, most GUIs are not well-suited to automation, and the large amount of information in the display may consume a lot of network bandwidth if the GUI is used over a remote connection.

On the other hand, a CLI is well-suited to task automation, and many tasks may require fewer steps to perform than when using a GUI. CLIs generall require much less bandwidth when used over a network, making them well-suited to remote administration tasks.

To compare the data demands of the two types of user interfaces, consider the amount of information that needs to be sent to the display to update it:

As an example of the strengths of each type of user interface, consider the task of croping, resizing, and changing the format of photographs:

A Brief History of Operating Systems

Many operating systems have been released. This is a timeline of some of the milestone events leading to some of the most prominent operating systems used today:

Anatomy of a Command Line Interface (CLI)

A CLI is provided by two programs:

  1. A terminal program, which is responsible for collecting user input and displaying the output from the shell and commands.
  2. A shell, which interprets the user's written commands.

These may be on the same machine, or they may be on different computers. For example, it is common to access both Linux and Windows systems over a remote connection, using a protocol such as SSH (secure shell, which protects the connection using encryption). In that case, the terminal program runs on the computer in front of the user, and the shell runs on the remote computer system.