3.2.1 - Operating systems

3.2.1 - Operating systems

An operating system is the quiet coordinator behind every open file, running app and connected device. This lesson shows how it controls hardware and software, shares limited resources, and gives each user an appropriate way into the system. By the end, you will be able to explain file, process, peripheral and user management in a precise Paper 1 response.

OS purpose and interfaces

Suppose a student signs in to a laptop, opens a presentation and starts some music. The applications need processor time and main memory, the presentation needs a stored file, the screen and speakers need instructions, and the student's account must have permission to use each resource. One piece of system software coordinates all of this: the operating system.

Operating system

An operating system (OS) is system software that controls and manages a computer's hardware and software resources and provides services through which users and applications can use the computer.

An application does not need to contain its own complete system for scheduling processor time, organising storage and controlling every model of device. It requests services from the OS. The OS acts as an intermediary between users and applications on one side and the hardware on the other.

The OS also provides a user interface, a way for the user to issue commands and receive information.

InterfaceMain featureExample interaction
Graphical user interface (GUI)Uses graphical controls such as windows, icons, menus and a pointer or touch inputSelecting a file icon and choosing Rename
Command-line interface (CLI)Accepts typed commands that follow a defined command syntaxTyping an exact command to list the files in a directory
Natural-language interfaceAccepts ordinary spoken or typed language and interprets the user's intended requestSaying, "Open my computing folder"

A CLI and a natural-language interface can both use text, but they are not the same. A CLI expects commands in its defined syntax; a natural-language interface attempts to interpret everyday language.

The OS is not just an interface and it is not an application: it manages shared resources and provides common services that interfaces and applications use.

File management

A file remains useful only if the system can store it, locate it again and keep it organised among other files.

File management

File management is the operating system's organisation, storage and retrieval of files.

The OS organises files in a hierarchy of directories, also called folders. A folder inside another folder is a subfolder. This structure gives each file a location and helps the OS retrieve the intended file even when files in different folders have the same name.

For example:

Plain text
Schoolwork/
  Computing/
    Operating-systems/
      notes.txt
      queue-notes.txt
  English/
    notes.txt

The two files called notes.txt do not clash because they are stored in different folders.

Common file-management functions include:

FunctionWhat the OS enables
SaveStore a new file or store changes to an existing file
OpenLocate and retrieve a file so that an application can use it
RenameChange the file's name while keeping its contents
DeleteRemove a file from the active file system

Worked example. Imani writes a report and selects the folder Schoolwork/Computing/Operating-systems. The OS stores the file there when she saves it. The next day, it follows that location to retrieve the file when she opens it. She can rename the file without changing its contents, or delete it when it is no longer required.

Seeing folders and icons on screen is the GUI view of the organisation. The underlying file management is still performed by the OS; it is not performed by the word-processing application alone.

Processes and scheduling

A program stored on secondary storage is not automatically a running process.

Process

A process is a program that has been loaded into main memory so that it can be executed.

At one time, a laptop might have processes for a presentation, spell checking, file synchronisation and audio playback. These processes compete for finite resources. Process management is the OS's control of active processes and its sharing of resources such as processor time and main memory between them.

In the simplified scheduling model used here, one CPU core executes instructions for one process at an instant. The OS changes which process receives the core so quickly that several processes can appear to run at the same time.

The scheduler uses a scheduling algorithm to choose or prioritise the next ready process. Ready processes wait in a queue. A selected process receives a short time slot (or time slice) on the processor. If the process finishes, it leaves the queue. If its time slot ends while it is still ready but unfinished, it returns to the rear of the queue to await another turn.

Worked scheduling example. Three ready processes begin in this queue:

Plain text
front -> Presentation -> Spell check -> File sync -> rear

The table shows one possible sequence. It models queue and time-slot behaviour; it is not the detail of a named scheduling algorithm.

Time slotQueue before selectionProcess using the CPU coreOutcomeQueue after the slot
1Presentation, Spell check, File syncPresentationUnfinishedSpell check, File sync, Presentation
2Spell check, File sync, PresentationSpell checkFinishedFile sync, Presentation
3File sync, PresentationFile syncUnfinishedPresentation, File sync
4Presentation, File syncPresentationFinishedFile sync

Notice the first process does not keep the CPU core until it finishes. At the end of time slot 1, Presentation is unfinished, so the OS places it behind the other waiting processes. This is how the OS prevents one ready process from keeping all the processor time in this model.

Managing process memory

Processor time is not the only finite resource shared between processes. A process needs space in main memory for the instructions and data currently required for execution. The OS allocates each active process its own section of RAM and keeps track of how that space is being used.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account