The answersDownload the PDF
Worksheet

F9.9 Operating systems and utilities

Logic and computer systems · GCSE · OCR J277 1.5.1, AQA 8525 3.4.3, Edexcel 1CP2 3.2.1 · about 15 min

BugBotLab
NameClassDate

What this lesson is about

What an operating system does, scheduling, and utility software.

Questions 6 marks in all

  1. [1 mark]What is a device driver?

    1. AA program that lets the operating system talk to a particular device
    2. BA person who fixes hardware
    3. CA utility that speeds up the disk
    4. DThe part of the CPU that controls devices
  2. [1 mark]How does an operating system run several programs on one core?

    1. AIt gives each a short time slice and switches between them quickly
    2. BIt runs them all at the same instant
    3. CIt runs one program to the end before starting the next
    4. DIt copies each program to a separate core
  3. [1 mark]What does defragmentation do?

    1. AMoves the pieces of each file on a hard disk back together
    2. BRemoves viruses
    3. CMakes files smaller
    4. DCopies files to another drive
  4. [1 mark]Why should an SSD not be defragmented?

    1. AIt gains no speed and the extra writes wear it out
    2. BIt deletes the files
    3. CSSDs cannot store files in pieces
    4. DIt makes the SSD volatile
  5. [1 mark]What does an incremental backup copy?

    1. AOnly the files changed since the last backup
    2. BEvery file on the computer
    3. COnly the operating system
    4. DOnly files that have been deleted
  6. [1 mark]What does this program print?

    queue = ["a", "b", "c"]
    job = queue.pop(0)
    queue.append(job)
    print(queue)

The task: a round-robin scheduler

Write a round-robin scheduler with a time slice of 2 units. Each job in jobs needs some units of processor time. Take the job at the front of the queue, run it for 2 units or for what it has left, whichever is less, and print <name> ran for <n>. If it is not finished, put it at the back of the queue; if it is, print <name> finished at <t>, where t is the total time so far.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

jobs = [("motors", 3), ("camera", 5), ("radio", 2)]
time_slice = 2

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f9-9-operating-systems-and-utilities/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Try a time slice of 1 and of 10. Which is fairest? Which switches least?
  2. Give each job a priority and always run the highest priority job that is waiting.
  3. Make an incremental backup: given yesterday's files and today's, print only the files that are new or changed.