AS and A Level OCR AS/A Level Computer Science
System software development (1.2.1)
Navigate to resources by choosing units within one of the unit groups shown below.
Introduction
Overview
Delivery guides are designed to represent a body of knowledge about teaching a particular topic and contain:
- Content: a clear outline of the content covered by the delivery guide;
- Thinking Conceptually: expert guidance on the key concepts involved, common difficulties students may have, approaches to teaching that can help students understand these concepts and how this topic links conceptually to other areas of the subject;
- Thinking Contextually: a range of suggested teaching activities using a variety of themes so that different activities can be selected that best suit particular classes, learning styles or teaching approaches.
Curriculum content
Overview
a) The need for, function and purpose of operating systems.
b) Memory Management (paging, segmentation and virtual memory).
c) Interrupts, the role of interrupts and Interrupt Service Routines (ISR), role within the fetch-decode-execute cycle.
d) Scheduling: round robin, first come first served, multi-level feedback queues, shortest job first and shortest remaining time.
e) Distributed, Embedded, Multi-Tasking, Multi-User and Real-Time operating systems.
f) BIOS.
g) Device drivers.
h) Virtual machines: any instance where software is used to take on the function of a machine, including executing intermediate code or running one operating system within another.
Thinking conceptually
Overview
Common misconceptions or difficulties students may have
This topic contains quite a few different words (see below) that students may not have encountered before. A student’s glossary is an excellent idea; students can add terms that are unfamiliar to them and define them in their own words.
Some examples:
- Primary/Secondary memory – RAM is primary memory whereas hard disks or flash drives are secondary memory.
- Paging (also called swapping) – is the process of moving data between RAM and virtual memory. It moves data out of RAM that is not immediately needed and replaces it with data that is. This process is slower than using just using primary memory alone since secondary storage is slower and the data has to move around more. It achieves this by using a page table to keep track of where data resides.
- Segmentation – When programs are loaded up into memory, segmentation allows the primary memory to store only the bit it needs at that particular time. For example, Dynamic Link Libraries can be stored on the hard disk until called by main memory using a program.
- Virtual Memory – The memory manager can trick the operating system into thinking that it has more physical memory than it actually does by making use of secondary storage such as the hard disk or flash drives.
- Interrupt – Interrupts what the CPU is currently doing and performs the ISR then lets the CPU return to what it was doing before
- ISR – The Interrupt Service Routine is called when an interrupt occurs. Afterwards the CPU can carry on with what it was doing before.
Other keywords: Fetch-decode-execute cycle, Scheduling, Round-robin, First come first served, Multi-level feedback queues, Shortest job first, Distributed OS, Embedded OS, Multi-Tasking OS, Multi-user OS, RTOS, BIOS, Drivers, Virtual machine.
Conceptual links to other areas of the specification – useful ways to approach this topic to set students up for topics later in the course
This unit content will support element 1.1.1 Structure and Function of the Processor where students are introduced to the structure of a processor and the fetch-decode-execute cycle.
Operating systems can quite easily be taught as a standalone part of the specification, and it would be logical to go onto 1.2.2 Applications Generation, which requires the same level of in-depth understanding.
The need for, function and purpose of operating systems
The topic starts by understanding the need for and function of operating systems. See Operating systems 1 and 2.
A good way to introduce this is to get students to brainstorm the operating systems that are out there, and you could perhaps instruct students to have a go at some different operating systems, either through having some computers with them installed (Windows, Linux, Mac OS), or by having some different versions of operating systems on Raspberry Pi SD cards: See Operating systems 3 or through emulators; see Operating systems 4.
Students should discuss why they use certain operating systems, positive and negative experiences they have had etc.
A single/group card matching task to help students learn about the functionality of an operating system: see Operating systems 5 link.
A video covering the basics of operating systems, looking into the different managers (Process, File, Device, Memory): see Operating systems 6 link.
Memory Management (paging, segmentation and virtual memory)
Students should understand that virtual memory uses secondary storage (such as the hard disk) as an extension of physical memory (RAM). Paging using a paging table is the process whereby data is moved to and from virtual memory when needed.
Segmentation allows programs to be broken up into smaller address spaces; each can have its own type of protection and can be shared amongst other processes.
See Memory management 1 and 2.
Students can also read the article within the Memory management 3 link about virtual memory in more practical terms.
You could start a class discussion about students’ experiences with memory in computers and smartphones, asking, for instance, how much memory is in a Smartphone compared to a desktop computer or laptop, whether they have ever upgraded the memory, what are the memory requirements for different operating systems and games, etc. Students could also research graphics cards and how this type of memory is different from other types of memory.
Interrupts, the role of interrupts and Interrupt Service Routines (ISR), role within the fetch-decode-execute cycle
Interrupts are useful in computers because, rather than continually polling the inputs for changes, as soon as an event (e.g. a button being pressed) happens, the CPU interrupts what it is currently doing and takes a snapshot of all the registers in the CPU at that point in time so that it can return to that state when it has finished dealing with the interrupt. The process that happens as a result of the interrupt is called the Interrupt Service Routine (ISR)
The fetch-decode-execute cycle is a topic that is covered in specification content 1.1.1b so it would make sense to refer back to any prior teaching you have done on that or teach both parts together.
Interrupts 1 and 2 contain some information as a refresher about the fetch-decode-execute cycle if students need it.
Scheduling: round robin, first come first served, multi-level feedback queues, shortest job first and shortest remaining time
Scheduling in a computer is where processes are given access to system resources e.g. processor time which enables multitasking.
Round robin allocates a fixed time per process and then cycles through them until they are done.
First come first served is the simplest as it just puts the actions in a queue as and when they arrive.
Multi level feedback queues categorise processes into their own queues, which have their own priorities. Each queue may have its own prioritisation algorithm. For instance, user and system processes may have their own queues.
Shortest job first is where the scheduler prioritises smaller jobs first to get them out of the way.
Shortest remaining time is similar to shortest job first except that it is pre-emptive (it interrupts the current processing rather than queuing it to be next). See Scheduling 1 and 2.
A simple and fun activity to show how deadlock can occur is within the Scheduling 3 link. Another activity which deals with different types of scheduling can also be found on page 13 of the document in Scheduling 3.
Distributed, Embedded, Multi-Tasking, Multi-User and Real-Time Operating Systems
There are different types of operating system.
A distributed operating system (OS) is a collection of independent networked nodes. Each node may have its own hardware associated with it, and there will be some sort of system management software that brings all the interconnected systems together and co-ordinates individual and collaborative activity on the different nodes.
Embedded operating systems are those that have a dedicated function and are part of (or can be part of ) a larger device. They are generally lower power consumption, low cost and use a limited amount of hardware resources which means that they need to be interfaced with in a more bespoke manner than commonplace OS systems. An example of an embedded operating system would be embedded Linux on the Raspberry Pi.
Multi-user operating systems allow many different users to take advantage of the computer’s resources simultaneously. Multiuser operating systems share processor time. Unix is an example of a multi-user OS.
Multi-tasking operating systems are those that allow you to have many different tasks happening at once, and so this is our standard modern operating system. However, some tasks such as complex scientific/bank calculations can require much more processing power. In this case, supercomputers are used but because they cost a lot of money, instead of being single-user they are designed as multi-user systems so that many users can send tasks to them and share the resources.
Real-time operating systems (RTOS) are supposed to run under predefined deadlines and so can be classed as time critical. For instance, on an aeroplane when the pilot wants something to happen, it should do so straight away. One very important thing to remember about RTOS systems is that “the right answer too late is wrong”, since calculations for movements of a robot, for example, that arrive too late may no longer be valid.
See Operating systems 7 and 8.
BIOS
BIOS stands for Basic Input Output System. It is firmware that is designed to run when the PC is first switched on. It is responsible for detecting, initialising and testing the hardware components, as well as booting the operating system: see Bios 1 and 2 links.
Bios 3 link is a website which contains some BIOS simulators that can be explored by students to understand what they do.
This 'howstuffworks' article (see Bios 4 link) gives a good overview of BIOS in more practical terms.
Device drivers
When interfacing a piece of physical hardware to a computer, sometimes you may need to install a driver, although these days if you have a more common piece of hardware then the likelihood is that your driver may already be included in the operating system. See Device drivers 1 and 2.
Students should investigate what sort of devices drivers are used for and why they are needed. Have they ever had to install a driver? What is a HID device? How do you think the introduction of the internet and USB (as opposed to parallel and serial ports) has made drivers less annoying? (i.e. updates can be more automatic, you can’t lose the disk, fewer different cables to worry about, you usually have more than 1 USB, whereas there was usually only 1 parallel port).
Virtual machines: any instance where software is used to take on the function of a machine, including executing intermediate code or running one operating system within another
A virtual machine is an operating system that emulates dedicated hardware. The user has the same experience on the virtual machine as they do on a dedicated machine. This enables the user to choose which operating system they would like to use. It saves cost by reducing the need for separate hardware. See Virtual machines 1 link.
Students could watch the demo, in Virtual machines 2 link, of a virtual machine being used and could discuss why someone would want to do this.
Also, when using a virtual operating system, you can have virtual device drivers that fool the operating system into thinking that it is directly communicating with a certain piece of hardware, but in actuality it is going through some function calls to the host operating system. See Virtual machines 3.
Thinking contextually
How computers work
See How computers work link.
This activity involves getting the students to act out a simple computer simulation. Each student takes on the role of a different part of a simplified computer and they work in groups to run a simple program. The end result of this program is to draw a picture on a simulated computer display.
Doing a million things at once
See Workshop 1 link.
This activity gives students an idea of multitasking and why computers might ”freeze”. It illustrates the ideas of first come first served and round robin.
The activity starts off by questioning if the students use instant messaging programs, and if so, how many other programs they have open at the same time. This leads into a discussion of how a computer might achieve that.
- You will then need to divide the class into groups of 6/7.
- One member of each group should be chosen as the Processor.
- This student must be a good writer and reader and must be comfortable doing both in front of the group.
- One member of each group should be chosen as the Scheduler.
- This student should be the most organised in the group and should be happy telling the others what to do.
- The remaining group members will be tasks numbered from 1 to 4 or 5 (depending on group size).
One problem, 1000 machines
See Workshop 2 link.
Gives students an idea of the limitations of single processors and discusses the advantages and disadvantages of distributed computing.
The task starts off by discussing the idea of why we would want to share the load of a task, using practical and mathematical examples.
You then need to have three teams – each team is a ‘machine’.
- Choose 1 team to be the Addition table (max 4 people)
- Choose 1 team to be the Multiplication table (max 4 people)
- Choose 1 team to be the Value/Result table (max 5 people)
- Any remaining people can act as the Network.
Acknowledgements
Overview
OCR’s resources are provided to support the teaching of OCR specifications, but in no way constitute an endorsed teaching method that is required by the Board and the decision to use them lies with the individual teacher. Whilst every effort is made to ensure the accuracy of the content, OCR cannot be held responsible for any errors or omissions within these resources. We update our resources on a regular basis, so please check the OCR website to ensure you have the most up to date version.
© OCR 2015 - This resource may be freely copied and distributed, as long as the OCR logo and this message remain intact and OCR is acknowledged as the originator of this work.