Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Types of operating system

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

Three things at once

Your phone plays music. A chat message arrives. A game is open too.

One small processor does all of this. Who decides what runs and when? The operating system is the main program that runs the computer. Different jobs need different kinds of it.

Key words

WordWhat it meansExample
Operating systemThe main program. It runs the computer and shares its parts between other programs.Windows, Linux, Android
BatchJobs are collected and run later, one after another. Nobody waits for the result.Printing 10000 bills (papers that say how much to pay) at night
SchedulingChoosing which job runs next, and when.Run the jobs in a set order
MultitaskingRunning many programs at the same time.Music and chat together
Time-slicingGiving each program a very short turn on the processor, again and again.10 milliseconds each (1 millisecond is one thousandth of a second)
InterruptA signal that says "stop, I need attention now".A key press
Real-timeThe answer must come within a fixed, short time.A car airbag
NetworkComputers joined together so they can share things.College Wi-Fi

The cells students fill in are left blank in this preview.

Five types at a glance

TypeMain ideaKey featuresExample use
BatchRun big jobs later, with no userNo user waiting, very many jobs, schedulingPaying wages, printing bills
MultitaskingMany programs seem to run togetherTime-slicing, interruptsA laptop or phone
Real-timeAlways answer in timeMonitoring and control, transaction processing (payments and bookings)Airbags, robots, card payments
NetworkLook after a whole networkResource sharing (many people use one printer or files), user management, communicationA college server
MobileWork well on small devicesSmall processor, long battery lifeAndroid, iOS

The cells students fill in are left blank in this preview.

Batch and multitasking

A batch system has no user waiting. The jobs wait in a line (a queue). Scheduling decides the order. A company pays all its workers at night. Nobody types, and the machine stays busy.

Multitasking is different. You are there, and you want many things now. The processor gives each program a short turn. This is time-slicing. It happens so fast that all the programs seem to run together.

Try it: time-slicing

Code: python
# The processor gives each task one short slice of time, in turn, again and again.
tasks = ["music", "chat", "game"]
for round_number in range(1, 4):
    for name in tasks:
        print("Round", round_number, "->", name, "gets a slice")

# Add a new task, such as "photos", and run it again.

What is an interrupt?

data-callouts.note.label

You press a key while the processor is busy. The keyboard sends an interrupt. The processor pauses, does what the key asks, then goes back to its work. Without interrupts the computer would not notice you.

Extra: Meet a real operating system

Command
uname -sr

A command for the lesson’s lab terminal. It is shown here and not run.

Extra: See many tasks at once

Command
ps -e | head -8

A command for the lesson’s lab terminal. It is shown here and not run.

Extra: Count the tasks

Command
ps -e | wc -l

A command for the lesson’s lab terminal. It is shown here and not run.

Extra: What you saw

data-callouts.note.label

The first command named the operating system, Linux. The second listed tasks that run now. The third counted them. A small server already runs many tasks, and each one gets short turns on the processor.

Real-time operating systems

A real-time operating system must answer inside a fixed time. A late answer is a wrong answer.

It is used for monitoring and control: an airbag, a factory robot, a heart monitor. It is also used for transaction processing: a card payment or a plane seat booking must finish at once and without mistakes. A transaction is one payment or one booking.

Quick check: real-time

Have a go

Quick check: real-time

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

10 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.