Advanced System Software and Security: Computer Science 9618 (Cambridge International AS & A Level)
Syllabus 16.1, 16.2, 17.1 · Strand 4 System Software and Security
- Questions
- 10
- Total marks
- 67
- Tier mix
- 10 Core
0 of 10 questions completed
Syllabus coverage
- 16.1 5 questions completed
- 16.2 3 questions completed
- 17.1 2 questions completed
This A Level topic (syllabus ref 16.1–16.2, 17.1) goes deeper into how an operating system juggles multiple programs and how a compiler and a secure connection actually work. A running program cycles through process states (running, ready, blocked) and a scheduling algorithm (round robin, shortest job first, first-come-first-served, shortest remaining time) decides which process runs next; virtual memory, paging and segmentation let the system pretend there’s more memory than physically exists, at the cost of possible disk thrashing if it’s overused.
A compiler does more than one job: lexical analysis groups characters into tokens, syntax analysis checks them against a grammar (expressible as a syntax diagram or in Backus-Naur Form), and code generation with optimisation produces the final machine code, with Reverse Polish Notation offering a stack-based way to evaluate expressions without brackets. Separately, encryption protects data in transit: symmetric cryptography shares one key, asymmetric cryptography uses a public/private key pair, and SSL/TLS with digital certificates verifies identity and secures client-server communication such as web traffic.
The worked examples below are original, tracing scheduling, parsing and encryption scenarios step by step.
Question 1
A word-processing application is currently in the running state on a single-processor computer. It is the process actually being executed by the CPU right now. The application then requests to read a large file from the hard disk. This disk read will take a significant amount of time to complete, during which the application cannot do anything further with the data it has requested.
Which of the following correctly identifies the process state transition that occurs for this application at the moment the disk read is requested, and the reason for it?
Question 2
A single-processor computer uses round-robin scheduling with a time quantum of 3 ms to share the CPU between processes that are all ready to run. Two processes, P1 and P2, both arrive in the ready queue at time = 0 ms, and neither needs any I/O during this trace:
- P1 needs 7 ms of CPU (burst) time in total to finish.
- P2 needs 4 ms of CPU (burst) time in total to finish.
Whenever both processes are in the ready queue at the same moment, P1 is always chosen ahead of P2. No other processes arrive during this trace.
(a) Describe what the scheduler does when a running process's time quantum expires but that process has not yet finished executing, and state which process is given the CPU first in this trace, and for how long. [2]
(b) Copy and complete a trace table like the one below to show how the CPU is shared between P1 and P2, from time = 0 ms until both processes have finished executing.
| Time slice (ms) | Process run | Burst time remaining before | Time run in this slice | Burst time remaining after |
|---|---|---|---|---|
[4]
(c) State the time at which each process completes execution. [2]
Question 3
A laptop has 8 GB of physical RAM installed. Its user opens a video editor, several browser windows and a virtual machine at the same time, so that the total memory demanded by every currently open process is far larger than the 8 GB of RAM actually fitted, yet the operating system continues to run every one of these processes without crashing or refusing to open any of them.
(a) Explain, referring to pages, frames and a backing store, how virtual memory allows the laptop to run processes whose combined memory demand exceeds the size of its physical RAM. [3]
(b) State one difference between how paging and segmentation divide up a process's memory. [2]
(c) After a while, the user notices the laptop has become extremely slow: the hard disk activity light is almost constantly lit, yet very little visible progress is being made in any of the open applications. Name this phenomenon, explain why it is happening, and suggest one way the user could reduce it. [3]
Question 4
A compiler is translating a line of source code containing the expression below. Before generating machine code, the compiler's code generation stage first converts this checked infix expression into Reverse Polish Notation (RPN), also called postfix notation, which can then be evaluated using a stack without needing any brackets.
(a + b) * (c - d) / e
(a) Write the Reverse Polish Notation (postfix) form of the expression
(a + b) * (c - d) / e. [2]
(b) The variables take the values a = 6, b = 2, c = 9, d = 5 and e = 4. Copy and
complete a trace table to show the contents of the stack after each token of your RPN expression
from part (a) is processed, and state the final value the expression evaluates to. [4]
(c) Name the stage of compilation that is responsible for producing this RPN and generating the final machine code from it, and briefly describe what happens during the stage that comes immediately before it. [2]
Question 5
GreenLeaf Books is an online bookshop. A customer buys a book from its website, which uses SSL/TLS to secure the connection.
(a) The customer's browser needs to send their credit card details to GreenLeaf Books so that only GreenLeaf Books can read them. State which key should be used to encrypt the credit card details, and explain why using this key means only GreenLeaf Books can decrypt the resulting cipher text. [2]
(b) GreenLeaf Books wants its order-confirmation email to carry a digital signature, so the customer can be confident it genuinely came from GreenLeaf Books and was not altered after it was sent. Describe how GreenLeaf Books creates this digital signature, and how the customer's computer verifies it. [4]
(c) GreenLeaf Books' server presents a digital certificate, issued by a Certificate Authority (CA), when the SSL/TLS connection with the customer's browser is set up. State the purpose this digital certificate serves in the connection, and describe the process by which GreenLeaf Books obtained it from the CA. [3]
Question 6
A computer's operating system must decide which of several ready processes to run next. One particular non-preemptive scheduling algorithm always selects, from every process currently in the ready queue, the one with the smallest total burst (CPU) time. Once this chosen process has been given the CPU, it always runs to completion without being interrupted, even if a process with an even smaller burst time later arrives in the ready queue.
Which scheduling algorithm is being described here?
Question 7
An operating system uses First Come First Served (FCFS) scheduling, a non-preemptive algorithm, to share a single processor between processes purely in the order they arrive in the ready queue. Three processes arrive as follows, and none of them need to perform any I/O once they start running:
- P1 arrives at time = 0 ms and needs 5 ms of CPU (burst) time.
- P2 arrives at time = 2 ms and needs 1 ms of CPU (burst) time.
- P3 arrives at time = 3 ms and needs 8 ms of CPU (burst) time.
(a) Explain how First Come First Served scheduling decides which ready process is given the CPU next, and state whether it is preemptive or non-preemptive. [2]
(b) Copy and complete a table like the one below, showing the start time, completion time and waiting time (waiting time = completion time − arrival time − burst time, i.e. the time spent only waiting in the ready queue) for each of P1, P2 and P3.
| Process | Arrival time (ms) | Burst time (ms) | Start time (ms) | Completion time (ms) | Waiting time (ms) |
|---|---|---|---|---|---|
| P1 | |||||
| P2 | |||||
| P3 |
[4]
(c) P2 has a much shorter burst time than P1, yet your trace shows P2 must still wait a noticeable time before it can run. Explain why this happens under First Come First Served scheduling, and name this general problem. [2]
Question 8
A compiler's lexical analysis stage scans a program's source code character by character before syntax analysis begins. It is about to process the following single line of code, which assigns a new value to the identifier Total:
Total ← Count * 2 + 5
(a) State what is meant by lexical analysis, and describe two further tasks (other than grouping characters into tokens) that this stage typically carries out on source code such as this line. [3]
(b) Copy and complete a table like the one below, giving the token class (for example
identifier, operator or literal) of each of the following tokens taken from this line: Total,
←, Count, *, 2, +, 5.
| Token | Token class |
|---|---|
| Total | |
| ← | |
| Count | |
| * | |
| 2 | |
| + | |
| 5 |
[3]
(c) Explain the role that a symbol table plays during lexical analysis when identifiers such as
Total and Count are first encountered. [2]
Question 9
A grammar for a simplified <identifier> used by a compiler's syntax analysis stage is defined
by the following BNF rules:
<identifier> ::= <letter> | <identifier> <letter> | <identifier> <digit>
<letter> ::= "a" | "b" | "c" | ... | "z"
<digit> ::= "0" | "1" | ... | "9"
(a) State what is meant by a grammar in the context of a compiler, and state one way (other than BNF) that a grammar can be expressed. [2]
(b) Using this grammar, state, with a reason, whether each of the following is a valid
<identifier>:
(i) x9
(ii) 9x
(iii) total2 [3]
(c) A compiler may include an optimisation stage in addition to syntax analysis and code generation. State at which point in the compilation process optimisation typically takes place, and give one example of a technique it might use to improve the object code produced. [3]
Question 10
An online bank's website uses SSL/TLS to protect the connection with a customer's browser. Symmetric encryption uses a single shared key for both encrypting and decrypting data, whereas asymmetric encryption (already used elsewhere on this site to protect the customer's login details) uses a linked public/private key pair.
(a) State one advantage of using symmetric encryption, rather than asymmetric encryption, to encrypt the large volume of data exchanged during the rest of the browsing session. [2]
(b) State the problem that arises if the customer's browser and the bank's server want to use symmetric encryption to protect their session, but have no existing secure way to share a key with each other. Explain why this same problem does not apply to asymmetric encryption. [2]
(c) Describe how an SSL/TLS connection uses both asymmetric and symmetric encryption together, first to solve the problem in part (b), and then to protect the rest of the session efficiently. [4]