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

Free lesson

7.2 (1 of 4): Types of operating system

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

45 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

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 that runs the computer and shares its parts between programs.Windows, Linux, Android
BatchRunning collected jobs later, one after another, with nobody waiting.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 once.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-timeAlways answering within a fixed, short time.A car airbag
NetworkComputers joined to share things.College Wi-Fi

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

Which kind of operating system?

Have a go

Loading…

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

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.

Make a free account to save your work and track your progress.

What is an interrupt?

Note

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

Note

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 means on time, every time

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

It runs monitoring and control: an airbag, a factory robot, a heart monitor. It also runs 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

A network system looks after a network

A network operating system runs on a server and looks after a whole network. A network is a group of computers joined together. It has three main jobs.

Resource sharing: many people use one printer or one file store.

User management: it knows each user and what they may open.

Communication: it passes messages between computers on the network.

Extra: Who does the system think you are?

Command
whoami

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

Extra: User management

Tip

The system printed the name of the account you are using. A network operating system keeps a list of accounts like this. It decides what each account may open. This is user management.

Extra: Who may use a shared folder?

Command
ls -ld /srv/projects

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

Extra: Read the first letters

Tip

The line starts with drwxr-xr-x. The d means a folder. Then come three groups of letters: the owner, the group and everybody else. The letter w means may write. Only the owner has it here. This is user management.

A mobile system saves battery

A mobile operating system runs on a smartphone or a tablet. Android and iOS are two examples.

These devices have a weaker processor and a small battery. So the system does less work that you cannot see. It also puts unused apps to sleep. This gives a longer battery life.

Your turn: choose the system

Write the function choose_os. It gets a short phrase that says what a computer needs. Give back the kind of operating system that fits: batch, multitasking, real-time, network or mobile. The starter lists the five phrases. Use if, elif and else. Any other phrase gives "unknown". Press Run Tests to check.

Code: python
def choose_os(need):
    # need is a short phrase. Give back the kind of operating system that fits it.
    # "no user waiting" -> "batch"
    # "many programs at once" -> "multitasking"
    # "answer must be on time" -> "real-time"
    # "share files and manage users" -> "network"
    # "small battery" -> "mobile"
    # Use if, elif and else. Anything else gives "unknown".
    return None

Make a free account to save your work, or press Start lab to work through the whole lesson.

Extra: Your turn: share the processor

A multitasking system gives each task a short turn, called a slice. Write the function run_order. It gets two lists: the names of the tasks, and how many slices each one needs. Each round, every task that is not finished gets one slice. Give back a list with the name of the task for each slice, in the order they run. For example, run_order(["music", "chat"], [2, 1]) gives ["music", "chat", "music"]. Press Run Tests to check.

Code: python
def run_order(names, slices):
    # names is a list of task names. slices is how many slices each task needs.
    # Each round, every task that is not finished gets one slice, in list order.
    # Give back a list with the name of the task for each slice, in the order they run.
    # run_order(["music", "chat"], [2, 1]) gives ["music", "chat", "music"].
    # Change None to your list.
    return None

Make a free account to save your work, or press Start lab to work through the whole lesson.

Key words crossword

Have a go

Loading…

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

Final check

Have a go

Final check

5 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

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.