Purposes of an Operating System (OS)

Computer Science A2 · System Software. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science A2 topics

The idea

The operating system shares the processor, memory and devices so that none is left idle, and it hides the hardware behind a user interface: the user clicks Save and the OS finds the disk blocks.

A process is a program being executed. With multi-tasking, several processes seem to run at once because the processor is switched between them quickly. Each process is running, ready (waiting for the processor) or blocked (waiting for input or output). A scheduling routine chooses which ready process runs next; the kernel does the switch when an interrupt arrives.

Virtual memory uses part of the disk as extra memory, so programs larger than the free RAM can run.

Rules to remember

Common mistake

Students confuse ready and blocked. A ready process could run now and is only waiting for the processor; a blocked process cannot run even if the processor is free, because it is waiting for an event such as input.

Worked example

Processes P1, P2 and P3 need 5, 3 and 1 units of processor time. All arrive at time 0 in that order. Round robin is used with a time slice of 2 units. At what time does each process finish?

  1. P1 runs 0 to 2 (3 left), P2 runs 2 to 4 (1 left), P3 runs 4 to 5 and finishes.
  2. P1 runs 5 to 7 (1 left), P2 runs 7 to 8 and finishes.
  3. P1 runs 8 to 9 and finishes. Check: 5 + 3 + 1 = 9 units in total.

Answer: P3 finishes at time 5, P2 at time 8 and P1 at time 9.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Boolean Algebra and Logic CircuitsTranslation Software →Take a Computer Science A2 test