OS function: managing peripherals and drivers

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

OS function: managing peripherals and drivers

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement describes what the OS does when you plug in a new printer?
A It detects the new device and loads the correct driver for it
B It turns the printer into part of the CPU so no driver is needed
2. What is the job of a device driver?
A It lets the OS and applications communicate with a specific peripheral
B It protects the computer from viruses entering through the peripheral
3. You plug in a new webcam but the computer cannot use it because no driver is installed. What is the likely result?
A The webcam works normally because the OS guesses how to use it
B The webcam does not work until the correct driver is loaded
4. A word processor sends a document to print. Who controls the data passing to the printer?
A The operating system, using the printer driver
B The word processor sends it directly with no OS involved
5. Which is a task of the OS when managing peripherals?
A Creating the physical keys on a keyboard
B Controlling data passing to and from a keyboard, mouse or printer

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1detect_device(usb_port) AIF driver_found = FALSE THEN device_works ← FALSE
2load_driver(printer) BThe OS notices that a new peripheral has been plugged in so it can set it up for use
3The OS controls the data passing between a program and a peripheral CThe webcam is marked as working before the driver is loaded. The OS must load the correct driver first, and only then can the device be used.
4If there is no driver for a device, the OS cannot use the device and it does not work DThe OS loads the mouse driver but then passes the mouse data to a different device, so the data goes to the wrong peripheral. It should pass the data to the program that needs it.
5plug_in(webcam) webcam_works ← TRUE load_driver(webcam) Esend_data(document, printer)
6load_driver(mouse) send_data(mouse, keyboard) FThe OS finds and loads the correct driver so the printer can be used

Definitions

peripheral management

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF newDevice = TRUE THEN __________(newDevice) ENDIF
2.
IF driverFound = _____ THEN OUTPUT "Device does not work" ENDIF
3.
sendData(_______, document)
4.
driver ← findDriver(______)
5.
IF driverFound = TRUE ____ OUTPUT "Device ready" ENDIF

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A IF device disconnected THEN
B FIND driver for device
C LOAD driver
D ENDIF
Question 2
A OS detects new printer
B OS finds printer driver
C OS ignores the driver
D Printer can now be used
Question 3
A INPUT key FROM keyboard
B OS stops key reaching program
C OUTPUT key TO screen
Question 4
A driver ← none
B OS detects scanner
C IF driver = none THEN
D scanner works fine
E ENDIF
Question 5
A program sends data to OS
B OS gives data to the keyboard
C driver sends it to printer

Answer Key

OS function: managing peripherals and drivers
Section A: Quick Questions
Q1
A — It detects the new device and loads the correct driver for it
Q2
A — It lets the OS and applications communicate with a specific peripheral
Q3
B — The webcam does not work until the correct driver is loaded
Q4
A — The operating system, using the printer driver
Q5
B — Controlling data passing to and from a keyboard, mouse or printer
Section B: Match the Pairs
Q1
detect_device(usb_port) → The OS notices that a new peripheral has been plugged in so it can set it up for use
Q2
load_driver(printer) → The OS finds and loads the correct driver so the printer can be used
Q3
The OS controls the data passing between a program and a peripheral → send_data(document, printer)
Q4
If there is no driver for a device, the OS cannot use the device and it does not work → IF driver_found = FALSE THEN device_works ← FALSE
Q5
plug_in(webcam) webcam_works ← TRUE load_driver(webcam) → The webcam is marked as working before the driver is loaded. The OS must load the correct driver first, and only then can the device be used.
Q6
load_driver(mouse) send_data(mouse, keyboard) → The OS loads the mouse driver but then passes the mouse data to a different device, so the data goes to the wrong peripheral. It should pass the data to the program that needs it.
Section C: Definitions
Q1
peripheral management — The OS controls data passing to and from peripherals and loads the correct driver for each device so it can be used. Without a driver, the device does not work.
Section D: Fill in the Blanks
Q1
IF newDevice = TRUE THEN loadDriver(newDevice) ENDIF
Q2
IF driverFound = FALSE THEN OUTPUT "Device does not work" ENDIF
Q3
sendData(printer, document)
Q4
driver ← findDriver(device)
Q5
IF driverFound = TRUE THEN OUTPUT "Device ready" ENDIF
Section E: Spot the Error
Q1
A — The OS needs to detect a newly connected device before it loads a driver. The condition should be 'IF device connected THEN', not 'disconnected'.
Q2
C — The OS must load the driver so the printer can be used. 'OS ignores the driver' should be 'OS loads the driver'.
Q3
B — The OS controls the data passing from the peripheral to the program. It passes the key to the program and does not stop it.
Q4
D — A missing driver means the device does not work. Line 4 should say the scanner does not work.
Q5
B — The OS passes the data to the printer's driver, which sends it to the printer. A keyboard is the wrong peripheral for printing.