0%

Chapter 3

What an Operating System Does

The Operating System Is the Working Layer

Right now your computer might be playing music, opening a browser window, and saving a document, all at the same time. Those are three separate programs sharing one processor, one pool of memory, one set of files, and one screen, and not one of them knows the other two exist.

Something has to referee that, and the thing that does is the .

Applications send requests through shared operating-system services, which then coordinate access to the hardware.

Between applications and hardware

Applications spend their lives asking for things: open this file, reserve some memory, put these pixels in my window, play this audio. The operating system checks each request, sorts out the ones that compete, and coordinates the shared and services needed to carry it out.

Sitting in that middle position gives it a connected set of jobs:

  • manage running programs, share CPU time among them, and allocate memory;

  • organize files and enforce access rules about who can read or change them;

  • provide shared services for displays, keyboards, storage, audio, and networks.

One thing is worth separating early because it causes real confusion later: the operating system is not the desktop. Windows, icons, menus, and a pointer make up one interface built on top of the operating system’s services. Other interfaces can use those same services, and plenty of computers run an operating system without presenting a desktop at all.

A music player wants to send sound to an audio device. Which description best matches the operating-system layer model?

What the operating system does not do

It does not know what matters to you. Scheduling follows written policies, assigned priorities, and observed behavior, not an understanding of your intentions. It cannot tell that the long job you started an hour ago matters more to you than the browser tab you are idly scrolling.

It does not replace the application or the CPU either. The application decides what job to request, the CPU executes instructions, and the operating system coordinates the shared resources and protected services involved.

In the next lesson we watch two programs compete for real resources, and see where those decisions actually land.