← Security and privacy

What the operating system does

Apps never talk to hardware directly. They ask the operating system, and the OS uses a driver for each device, so one app works with any webcam or storage. Because every request goes through it, the OS can also decide which apps may use what.

There are thousands of different webcams, and your video call app works with all of them. How?

A computer runs many apps on many kinds of hardware. The operating system (OS: Windows, macOS, Android, iOS, ChromeOS) sits in between. Apps ask the OS to do things; the OS talks to each device through a driver, a small program that knows that one device.

PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.

A new webcam

You plug in a new brand of webcam. What has to change so your video call app can use it?

TryTry it on the board and compare the result with your prediction.

Try: swap the hardware

Was your prediction right? Read the message under the layers after each press.

Try it yourselfYour edits are saved in this browser.

Start the camera, then swap the webcam and start it again. Save a file, swap the storage and save again. Did the apps change?

Use the board. This ticks when you get there.

InvestigateWork out why it happens, one step at a time.

Worked example: one request

Worked exampleBefore each step, say what you think comes next.
  1. app: "start the camera"\text{app: "start the camera"}The app asks for a camera, not for a particular brand.

Now say what a driver is.

What is a **driver**?

Sam explains why new hardware needs new apps. Click the line where it first goes wrong.

Because every app has to ask the OS, what else can the OS do?

ModifyChange the problem on purpose and see what happens.

Vary: change one thing

Try it yourselfYour edits are saved in this browser.

Swap to webcam B and start the video call. Webcam B's driver is missing. What happens?

Use the board. This ticks when you get there.

Install the driver and try again.

Use the board. This ticks when you get there.

Press the Game's camera button. What does the OS do?

Use the board. This ticks when you get there.

Allow Game to use the camera and try again.

Use the board. This ticks when you get there.

PractiseA few on your own, to check you have it.

The OS

Your school laptop saves files to the internal drive or a USB stick, and the Save button looks the same either way. Why?

A torch app asks for permission to read your contacts. What should you do?

Review: with TCP, what happens when a packet is lost?

MakeMake your own problem using what you have learned. Expect a few tries; that is normal.

Set up a new computer

Then: on your own phone, find one app with a permission it doesn't need.

Try it yourselfYour edits are saved in this browser.
Need a hint?

The video call should work with webcam B.

Another hint

Webcam B needs its driver.

Another hint

Game doesn't need the camera: leave it off.

Set this computer up: webcam B plugged in and working for the video call, the game NOT allowed to use the camera, and a file saved to the USB stick.

Use the board. This ticks when you get there.

For teachers

Students swap webcams and storage under unchanged apps, install a missing driver and grant or refuse an app's camera permission, to explain how the operating system hides hardware from applications and controls access (AC9TDI10K01 node 1). About 35 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Try the board yourself.

The one idea: the OS is a layer of abstraction (apps ask for "a camera"; drivers handle each device) and, because it is in the middle, it is the gatekeeper for access. The access idea returns in lesson 3.

Hands-on: show Device Manager (Windows) or System Information (macOS) on a school laptop, and a phone's app permission screen.

Running the lesson

  1. Predict: students who chose "rewrite the app" hold Sam's misconception.
  2. Try: ask what stayed the same and what changed each time.
  3. Worked example: ask who checks the permission, the app or the OS.
  4. Vary: ask why the OS refuses before the camera is even touched.
  5. Make: compare: did anyone give the game camera access, and why not?

The hard part (on purpose)

The layers are invisible in everyday use. Keep pointing at the three rows on the board and ask "who is talking to whom?"

When students get stuck

Stretch and support

Stretch: Why can a phone app ask for the camera but not read another app's files? Look up what a sandbox is.

Support: A three-layer diagram card: Apps / Operating system (permissions, drivers) / Hardware.

Where it leads

Next: Names and addresses (DNS and IP).

Where it leads: Who are you, and what may you do? (sign-in and permissions on a shared system).

What each step is for

Now you can
Next lesson2. Names and addressesEvery device on the internet has an IP address, and every packet carries the address it is going to. DNS turns a name like school.edu.au into that address, and routers use their tables to send each packet the right way. A name that only looks right gets a different address, and a different computer.