GoalDescribe the main tasks of an operating system and explain how it manages the resources of a computer.
New words
operating system · system software that manages the computer’s resources and lets people and other programs use the hardwareresource · something a computer uses to do its work, such as power, memory, storage or a hardware devicesystem software · software that runs and looks after the computer itself, not software for the user’s own tasksuser account · a person’s own login, with its own space and its own rights on the computer
Explanation
A computer has only a limited amount of each resource: power, memory, storage space and hardware devices. The operating system is the manager that shares them out. It also gives people an interface, so that they can use the hardware and run other programs. Its main tasks are memory management (deciding how much RAM each running program gets and making room when needed), file management (storing files in secondary storage and keeping track of their names, folders and places), device management (passing data to and from devices such as a printer or microphone), and power management (switching off unused parts, or dimming the screen when the battery is low). It also looks after user accounts and security: a person must log in, and different accounts get different rights. The operating system is system software.
Task
What the operating system looks after
Example
Memory management
how much RAM each running program gets
makes space before a new program opens
File management
where files and folders are stored
moves, copies or deletes a file when asked
Device management
data going to and from devices
sends a print job to the printer
Power management
how the battery or mains power is used
dims the screen when the battery is low
User accounts and security
who may log in and what they may do
asks for a username and password
Worked examples
Bus station
Computer
Operating system task
bays for the buses
spaces in RAM for programs
memory management
the timetable of where each bus is
a record of where each file is stored
file management
the radio link to each driver
a connection to each device
device management
the fuel supply
the battery
power management
staff passes
usernames and passwords
user accounts and security
A bus station and a computer. A station manager has limited bays, fuel and staff, and decides who gets what. The operating system does the same job for the computer’s resources. Both must keep a record, share fairly and stop people from using what they should not.
Program
Blocks of RAM used
music player
6
notes program
5
free
5
total in the tablet
16
Memory management with numbers. A tablet has 16 blocks of RAM. A music player uses 6 blocks and a notes program uses 5, so 16 − 11 = 5 blocks are free. A drawing program asks for 8 blocks. 5 is less than 8, so the operating system cannot start it yet. If the music player is closed, 6 more blocks become free: 5 + 6 = 11, which is enough, and the drawing program can start.
Power management as a decision. Input: the battery level is 20. The program checks the smallest limit first. 20 is not at most 10, but it is at most 20, so it prints Battery saver on. The same program prints Sleep mode soon for 8 and Normal for 55.
Class activity
Be the operating system (no computer). Draw a strip of 10 squares on paper: this is the RAM. Make cards for four programs and their sizes: Game 4, Writer 3, Calculator 1, Video 5. A partner opens and closes programs in any order they choose, for example “open Game, open Video, open Writer”. You place each program in the squares it needs, or say “not enough room” and say which program you could close to make space. Write down the free squares after each request.
Practice
1
Write the operating system task each sentence describes: memory management, file management, device management, power management or user accounts and security.
Sentence
Task
(a) It decides how much RAM each running program gets.
?
(b) It remembers in which folder a document is saved.
?
(c) It turns the screen brightness down after two minutes without use.
?
(d) It asks for a password before opening a learner’s files.
?
(e) It sends a picture to the printer.
?
(a) memory management; (b) file management; (c) power management; (d) user accounts and security; (e) device management.
2
A computer has 12 blocks of RAM. Program A uses 3 blocks and program B uses 4 blocks. A new program C needs 7 blocks. How many blocks are free? Can C start? What could the operating system do?
Program
Blocks of RAM used
A
3
B
4
C (waiting)
needs 7
Free: 12 − (3 + 4) = 5 blocks. C needs 7, so it cannot start yet. If program A is closed, 3 more blocks are free, so 8 blocks are free, which is enough for C.
3
A phone runs this program. Predict the output for the inputs 4, 5 and 30. Explain the result for 5.
Python
1battery = int(input("Battery %: "))
2if battery < 5:
3print("Switch off extra parts")
4elif battery < 30:
5print("Dim the screen")
6else:
7print("Normal")
Input 4: Switch off extra parts. Input 5: Dim the screen, because 5 < 5 is false but 5 < 30 is true. Input 30: Normal, because 30 < 30 is false.
4
Two learners share one family computer. Give two reasons why the operating system should give each of them a separate user account.
Each learner’s files stay private and safe because the other must know the password to open them. The operating system can also give each account its own storage space and different rights, for example so that a younger child cannot change the settings.