Skip to content

What Is an Operating System ​

An operating system (OS) is system software that manages the hardware and computer resources and creates an environment where users and application programs can use the computer conveniently and efficiently. Windows, macOS, Linux, UNIX, the older MS-DOS, and Android and iOS on smartphones are all operating systems.

At a Glance ​

  • The operating system is the middle manager (interface) between application programs and the hardware. Applications do not touch the CPU or disk directly; they ask the operating system, "Please do this for me."
  • Analogy: the operating system is like a building management office.
    • The shops in the building (applications) do not repair or divide up the electricity, water and elevators (CPU, memory, disk) themselves.
    • The management office decides who uses how much and when, keeps one shop from intruding on another's space, and also manages access cards (accounts and permissions).
    • Thanks to this, the shops can focus on their own business (useful work).
  • Each operating system has strengths that depend on its use. For example, Windows suits personal PCs, Linux suits servers, and embedded OSes suit small devices.

As in the picture below, a user's request passes through the application and then the operating system before reaching the hardware, and the result comes back the same way in reverse.

A layered structure with the user, application, operating system and hardware stacked from top to bottom

Image source: Wikimedia Commons (Golftheman, CC BY-SA 3.0)

text
┌──────────────────────────────────────┐
│   User                                │
├──────────────────────────────────────┤
│   Applications (browser, Notepad ...) │
├──────────────────────────────────────┤
│   Operating system (kernel + device drivers) │ ← resource management, protection, the bridge in between
├──────────────────────────────────────┤
│   Hardware (CPU, memory, disk, devices) │
└──────────────────────────────────────┘

The core part of the operating system is called the kernel. The kernel always stays loaded in memory and provides basic services to every other part. The window through which an application asks the kernel to do work is the system call.

What the Operating System Is Responsible For ​

RoleWhat it does
Process managementProcesses and threads, CPU scheduling, synchronization, IPC (inter-process communication)
Storage managementMemory management, virtual memory, file systems
NetworkingSupport for TCP/IP and other network protocols
User managementAccount management, access permission management
Device driversManaging sequential access devices, random access devices, network devices

Let's look at each one in detail below.

1. Process Management ​

This function manages the application programs (processes) running on top of the operating system. In a sense, it can also be seen as managing the CPU.

  • It picks the process that gets to use the CPU now (scheduling), and actually hands the CPU over to that process.
  • It coordinates so that several processes do not access shared resources at the same time (synchronization), and lets processes exchange data with each other (IPC).

Related articles:

2. Storage Management ​

This function manages the primary storage, main memory (RAM), and the secondary storage, hard disks (HDD) and NAND flash memory such as SSDs.

Primary Storage (Main Memory) ​

  • It hands out memory regions to processes (allocation) and takes them back when they are done (deallocation).
  • It stops one process from intruding on another process's memory region.
  • It provides virtual memory so that even programs larger than the actual memory can run, using main memory efficiently.

Related articles: Memory Layout, Memory Management, Page Replacement Algorithms

Secondary Storage (HDD, SSD, etc.) ​

  • Data is stored in the form of files.
  • The operating system manages the file system, the way these files are organized and found.
  • Many file systems are in use, such as FAT, NTFS, EXT2 (EXT4 is common now), JFS, XFS and APFS (macOS).

Related article: File Systems

3. Networking ​

Today's computers are hard to use without a network. To connect to the TCP/IP-based internet, or for applications to use the network, the operating system must support network protocols. Today's commercial operating systems support a very wide range of network protocols.

Applications do not handle the network card directly; they communicate through features the operating system provides, such as sockets. In this way, the operating system sits between the user and the hardware, running and managing the hardware, and controls applications and hardware through software.

4. User Management ​

One PC is not always used by only one person. Just as family members each create their own account on the same computer, a single computer is often shared by several people.

  • So the operating system needs a function for managing accounts.
  • For privacy and security, other users must be kept out of your personal files.
  • It lets you specify, for each file or system resource, who can do what (access permissions).

Related articles: Users and Groups, File Systems and Permissions

5. Device Drivers ​

A computer has many pieces of hardware attached, such as the keyboard, disk, graphics card and network card. The operating system must recognize and manage these devices so that applications can use the hardware.

  • So the operating system needs a layer that abstracts the hardware. This layer is called the device driver.
  • Analogy: a device driver is an interpreter assigned to each device. Even if every printer maker speaks a different dialect (control method), the operating system just says the same thing, "Print," and the interpreter translates it into each printer's language.
  • With so many kinds of hardware, there are also many device drivers, and managing these drivers is also the operating system's job.
Device typeCharacteristicsExamples
Sequential access deviceReads and writes data in order from the beginningKeyboard, serial port, tape
Random access deviceGoes directly to the desired location to read and writeHDD, SSD
Network deviceSends and receives data over the networkEthernet, Wi-Fi card

How a device tells the CPU "I'm done" is covered in the Interrupts article.

Summary ​

ConceptPlain-language summary
Operating systemThe management office between the hardware and programs that hands out and guards resources
KernelThe core of the operating system. Always resident in memory, providing basic services
Process managementDecides who uses the CPU and when, and lets processes cooperate without clashing
Storage managementHands out and protects memory, and organizes files on the disk
NetworkingSupports protocols so programs can use the internet
User managementProtects your files from others with accounts and permissions
Device driversInterpreters that turn each device's own dialect into the operating system's common language

Reference: Lee Man-woo, 『도전 임베디드 OS 만들기』 (Challenge: Building an Embedded OS, Insight) · What Is an Operating System?