COMP9201 Final Exam V3

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 1/17

Dashboard  My courses  COMP9283-COMP3231-COMP3891-COMP9201-5203_00462  General  Sample Final Exam V2

Information

Question 1
Not answered

Marked out of

Question 2
Not answered

Marked out of

Question 3
Not answered

Marked out of

Question 4
Not answered

Marked out of

Started on Monday, 11 May 2020, 5�01 PM

State Finished

Completed on Monday, 11 May 2020, 5�06 PM

Time taken 4 mins 56 secs

Grade 12.00 out of 86.00 (14%)

(Staff Only)

 Site Home

 Announcements 

 User Guides

For each question in this section, classify the overall statement as �ẃẴǴ if the statement is generally true, or à ǀ ḵẎǴ if the statement (or
a component of it) is false.

You will receive one mark for each correct classification, and lose one mark for each incorrect

classification. You gain zero marks for each question left unclassified. 

One deadlock prevention method is to release all locks held by a thread when the thread finds a lock that it requires is held by

another thread. This method prevents deadlock, but not necessarily livelock.

Select one:

The correct answer is: True

Multi-threaded applications (i.e. user-level code) can avoid race conditions by disabling and enabling interrupts.

Select one:

The correct answer is: False

Mǀ ṎḮ ǴẃῗẎ ǀ ḵḅṙ ẃḙẤḎṊ  can be used to avoid competing processes deadlocking without requiring any knowledge of their resource
requirements in advance.

Select one:

The correct answer is: False

A group of processes are ḵḙỴǴḵṙ ǜḮ ǴǨ if they are all in the ǘḵṙ ǜḮ ǴǨ state, and are making no effective progress.

Select one:

The correct answer is: False

COMP3231/COMP9201/COMP3891/COMP9283 Operating Systems T1-2020 Kah May Tan

https://moodle.telt.unsw.edu.au/my/
https://moodle.telt.unsw.edu.au/course/view.php?id=48561
https://moodle.telt.unsw.edu.au/mod/quiz/view.php?id=2957991
http://www.unsw.edu.au/
http://bit.ly/2vxLDNi
http://bit.ly/2vxLDNi
http://bit.ly/2CsKery
http://bit.ly/2CsKery
http://bit.ly/2FECVjK
http://bit.ly/2FECVjK
https://moodle.telt.unsw.edu.au/?redirect=0
http://moodle.telt.unsw.edu.au/mod/page/view.php?id=41448
https://student.unsw.edu.au/moodle/support

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 2/17

Question 5
Not answered

Marked out of

Question 6
Not answered

Marked out of

Question 7
Not answered

Marked out of

Question 8
Not answered

Marked out of

Question 9
Not answered

Marked out of

ZḙṎḙṎḅ ṿḎḙḵṙ Ẏṙ ṿḎǴẃẎ can avoid deadlock using a single lock for the entire table.

Select one:

The correct answer is: True

Implementing a ẎṿḙṎḵṙ ǜḮ with an atomic ẤǴẎẤᾷǀ ṎǨᾷẎǴẤ instruction avoids the issue of busy waiting.

Select one:

The correct answer is: False

A system uses a resource management policy that is potentially prone to starvation (e.g. shortest job first scheduling). When

starvation occurs, the whole system makes no progress.

Select one:

The correct answer is: False

Sparse files save disk space by not storing the blocks of the file that are not written to.

Select one:

The correct answer is: True

Using a bitmap to manage free blocks on a disk reduces the usable disk capacity compared to the approach of storing the addresses

of free blocks in the free blocks themselves.

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 3/17

Question 10
Not answered

Marked out of

Question 11
Not answered

Marked out of

Question 12
Not answered

Marked out of

Question 13
Not answered

Marked out of

Question 14
Not answered

Marked out of

A typical i-node-based UNIX file system features differing levels of indirection (levels of indirect blocks) depending on the offset of

access to the file. File access performance would be improved for small files if the file system was simplified to use three levels of

indirection for all offsets in the file.

Select one:

The correct answer is: False

A buffer cache improves performance by buffering writes to disk, allowing the application to continue computation while buffers are

written to the disk in the background. Meta-data and data writes are generally treated equally and simultaneously flushed to disk

periodically.

Select one:

The correct answer is: False

When an application performs a series of small file system writes, having the operating system contiguously allocate multiple blocks

on the initial write (and occasionally on subsequent writes) can improve file system performance compared to allocating a block at a

Select one:

The correct answer is: True

In a typical UNIX file system, such as ext2fs, the attributes of the file (e.g., file owner, size, and creation time) are stored in the

directory entry.

Select one:

The correct answer is: False

File systems based on contiguous allocation are suitable for read-only media such as optical disks (DVDs and CDs).

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 4/17

Question 15
Not answered

Marked out of

Question 16
Not answered

Marked out of

Question 17
Not answered

Marked out of

Question 18
Not answered

Marked out of

Question 19
Not answered

Marked out of

All application calls to the standard C library result in a transition into Ḯ ǴẃṎǴḵ Ṋ ṙ ǨǴ to process the call, after which the processor
returns to the application in ẴẎǴẃ Ṋ ṙ ǨǴ.

Select one:

The correct answer is: False

An operating system can enforce security by putting security checks in the ẎẤǀ ṎǨǀ ẃǨ Qᾷḵḙǘẃǀ ẃӑῢ

 

Select one:

The correct answer is: False

An operating system provides a high-level programming interface to the low-level computer hardware for applications.

Select one:

The correct answer is: True

Adding more levels of I/O buffering always improves performance.

Select one:

The correct answer is: False

ĎṿḙṎḵṙ ǜḮ Ẏ can never be more efficient to use than blocking locks, even on a multiprocessor machine.

Select one:

The correct answer is: False

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 5/17

Question 20
Not answered

Marked out of

Question 21
Not answered

Marked out of

Question 22
Not answered

Marked out of

Question 23
Not answered

Marked out of

Question 24
Not answered

Marked out of

On a multiprocessor machine, a single ẃǴǀ Ǩӑ ẂẴǴẴǴ in the operating system provides automatic load balancing across CPUs.

Select one:

The correct answer is: True

An I/O-bound process spends a significant fraction of its execution time blocked waiting for I/O. One can reduce the overall execution

time of the application by using user-level threads to overlap the application’s blocking I/O with its execution.

Select one:

The correct answer is: False

Application multi-threading provided by kernel-provided threads can have higher overheads (i.e. the time it takes to execute

individual operations) than user-level threads as thread management (such as creation, and blocking/unblocking) requires a system

call into the operating system.

Select one:

The correct answer is: True

Application multi-threading implemented entirely at user-level (i.e. user-level threads) can be used to take advantage of multiple

processors to increase performance, even in the situation of a single runnable process.

Select one:

The correct answer is: False

Application multi-threading implemented entirely at user-level (i.e. user-level threads) does not expose the concurrency available in

the application to the operating system.

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 6/17

Question 25
Not answered

Marked out of

Question 26
Not answered

Marked out of

Question 27
Not answered

Marked out of

Question 28
Not answered

Marked out of

Question 29
Not answered

Marked out of

In a multi-threaded process, every thread has its own virtual address space.

Select one:

The correct answer is: False

In a multi-threaded environment, local variables declared within a function have to be synchronised as they are allocated on a stack

shared between all the threads.

Select one:

The correct answer is: False

The traditional UNIX scheduler uses priorities to favour I/O-bound processes over CPU-bound processes. It fails to adjust when

CPU-bound processes become I/O-bound and vice versa.

Select one:

The correct answer is: False

General purpose schedulers aim to improve interactivity and I/O performance by favouring I/O-bound processes (and threads) over

CPU-bound processes (and threads). This improvement for I/O-bound processes comes with the disadvantage of dramatically

reducing the CPU available to CPU-bound processes (and threads).

Select one:

The correct answer is: False

The arguments to system calls are placed in registers (or on the application’s stack) based on a mutually defined convention

between the operating system and user-level applications.

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 7/17

Question 30
Not answered

Marked out of

Question 31
Not answered

Marked out of

Question 32
Not answered

Marked out of

Question 33
Not answered

Marked out of

Question 34
Not answered

Marked out of

A process and the operating system kernel share the same stack so they both can execute a high-level language like the

Q programming language.

Select one:

The correct answer is: False

Applications running as the ẃṙ ṙ Ấ user under UNIX (or ǀ ǨṊ ḙṎḙẎẤẃǀ Ấṙ ẃ under Windows XP/Vista/7/8/10) all run in the processor’s
privileged mode.

Select one:

The correct answer is: False

Page-based virtual memory using a single page size is likely to suffer from external fragmentation in main memory.

Select one:

The correct answer is: False

A page table implemented as a simple array in physical memory that is indexed by page number would provide fast access to page

table entries with a single memory reference. However, it is impractical and inefficient to allocate such an array for each virtual

address space.

Select one:

The correct answer is: True

In a system using page-based virtual memory, increasing the page size will generally decrease the working set size of an existing

application.

Select one:

The correct answer is: False

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 8/17

Question 35
Not answered

Marked out of

Question 36
Not answered

Marked out of

Question 37
Not answered

Marked out of

Question 38
Not answered

Marked out of

Question 39
Not answered

Marked out of

Internal fragmentation is space wasted in main memory. External fragmentation is space wasted on disk.

Select one:

The correct answer is: False

It is possible to construct a time-sharing system able to withstand malicious applications on a computer architecture possessing only

ǘǀ ẎǴ ǀ ṎǨ ḵḙṊ ḙẤ registers for memory management.

Select one:

The correct answer is: True

The minimum virtual-memory page size available for use by the operating system is determined by the properties of the underlying

hardware architecture.

Select one:

The correct answer is: True

A hypothetical computer has a 48-bit virtual address space and a 32-bit physical address space. It also uses an 8KiB page size. On

such a computer, a single level page table would need entries.

Select one:

The correct answer is: False

Every access to an application virtual address is translated to a physical address using the information in a page table. The processor

itself may cache a subset of the translation information in the Ấẃǀ ṎẎḵǀ Ấḙṙ Ṏ ḵṙ ṙ Ḯ ᾷǀ ẎḙǨǴ ǘẴḂḂǴẃ (TLB).

Select one:

The correct answer is: True

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 9/17

Question 40
Not answered

Marked out of

Question 41
Not answered

Marked out of

Question 42
Not answered

Marked out of

Information

The Ấẃǀ ṎẎḵǀ Ấḙṙ Ṏ ḵṙ ṙ Ḯ ǀ ẎḙǨǴ ǘẴḂḂǴẃ (TLB) that translates virtual addresses to physical addresses for every CPU instruction is sometimes
implemented in software.

Select one:

The correct answer is: False

In this section you will match pairs that are the most closely related. Each correct pair earns  of the marks available for the

question, where is the number of pairs to match.

ZǴǀ Ǩḵṙ ǜḮ ṿẃǴỴǴṎẤḙṙ Ṏ is a strategy where one of the four conditions required for deadlock is prevented, thereby preventing deadlock
from occurring.

Listed below are the four conditions required for deadlock and four approaches to preventing the condition from occurring. Match

the individual condition with its method of prevention.

Circular Wait Choose…

Hold and Wait Choose…

Mutual exclusion Choose…

No Preemption Choose…

The correct answer is: Circular Wait → Use a single defined order of resource acquistion, Hold and Wait → Allocate all required

resources initially, Mutual exclusion → Always infeasible, No Preemption → Nearly always impractical to remove a resource

Given the statements below, match them to whether they describe internal, external, or not fragmentation.

Space wasted due to space needed being larger than space available between existing allocations. Choose…

Space wasted due to space needed being smaller than space allocated. Choose…

The correct answer is: Space wasted due to space needed being larger than space available between existing allocations. → External

fragmentation, Space wasted due to space needed being smaller than space allocated. → Internal fragmentation

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 10/17

Question 43
Not answered

Marked out of

Question 44
Not answered

Marked out of

Information

For each resource, OS or processor feature listed below, indicate whether it is accessible in kernel (privileged) mode, user mode, or

in both modes.

 

An interrupt disabling instruction Choose…

The application’s memory containing the ẎẤǀ ṎǨǀ ẃǨ Q ḵḙǘẃǀ ẃӑ Choose…

Application memory Choose…

An add instruction Choose…

Hard disk drive controller registers Choose…

The registers used to transfer system call arguments. Choose…

The application’s page table Choose…

A TLB management instruction Choose…

The correct answer is: An interrupt disabling instruction → Kernel mode, The application’s memory containing the ẎẤǀ ṎǨǀ ẃǨ Q ḵḙǘẃǀ ẃӑ
→ Kernel mode and user mode, Application memory → Kernel mode and user mode, An add instruction → Kernel mode and user

mode, Hard disk drive controller registers → Kernel mode, The registers used to transfer system call arguments. → Kernel mode and

user mode, The application’s page table → Kernel mode, A TLB management instruction → Kernel mode

In a system that supports multi-threaded processes, for each attribute listed below, indicate whether it is a per process or a per

thread attribute.

 

Local variables Choose…

Global variables Choose…

Open file descriptors Choose…

Stack Choose…

General purpose registers Choose…

Program counter Choose…

Virtual address space Choose…

The execution state, e.g. blocked, ready, running Choose…

The correct answer is: Local variables → Per thread, Global variables → Per process, Open file descriptors → Per process, Stack →

Per thread, General purpose registers → Per thread, Program counter → Per thread, Virtual address space → Per process, The

execution state, e.g. blocked, ready, running → Per thread

This section consists of choosing the most correct answer from the multiple choices available.

A correct answer earns 100% of the marks available. An incorrect answer subtracts   of the marks available, where  is the

number of choices available in the question.

For example, an incorrect answer to a questions with 5 choices would reduce your marks by  of the marks available for the

specific question.

No marks are awarded or subtracted for unanswered questions.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 11/17

Question 45

Mark 6.00 out

Bill and Ben are two threads that execute the functions of the same name below respectively. Bill and Ben are prone to deadlock.

Identify the function calls in Bill and Ben where they end up deadlocked if they deadlock. 

Each line of code in each function has a line number to help you identify the location of deadlock. 

void bill() 
1:    lock_acq(&file2)
2:    lock_acq(&file3)
3:    lock_acq(&file1)

/* access all three files mutually exclusively */

4:    lock_rel(&file3)
5:    lock_rel(&file1)

/* do nothing */

6:    lock_acq(&file1)

/* access file1 and file2 mutually exclusively */

7:    lock_rel(&file1)
8:    lock_rel(&file2)

void ben()
1:     lock_acq(&file2)
2:     lock_acq(&file3)
3:     lock_acq(&file1)

/* access all three files mutually exclusively */

4:    lock_rel(&file3)
5:    lock_rel(&file2)

/* do nothing */

6:    lock_acq(&file3)

/* write to file1 and file3 */

7:    lock_rel(&file1)
8:    lock_rel(&file3)

Select one:

Bill line 6, Ben line 6

Bill line 4, Ben line 7

Bill line 6, Ben line 3

Bill line 3, Ben line 6 

The correct answer is: Bill line 3, Ben line 6

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 12/17

Question 46

Mark 6.00 out

In most UNIX file systems, every file has an index block, called an ḙᾷṎṙ ǨǴ, which is used to store
information about the file as well as pointers to data blocks, as shown in the diagram below.

Assume a block size of 2 KiB (2048 bytes) and 4-byte block numbers. What is the approximate largest possible file size supported

by this filesystem?

Select one:

275415851008 bytes 

24576 bytes

1048576 bytes

536870912 bytes

274877906944 bytes

8.796 * 10^12 bytes

The correct answer is: 275415851008 bytes

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 13/17

Question 47
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x7fffe18d, choose the most accurate answer from the options below.

Select one:

Physical address 0x5418d is accessed, stores are not allowed.

Physical address 0x54 is accessed, and stores are allowed.

Physical address 0x54 is accessed

A TLB exception occurs.

Physical address 0x5418d is accessed, and stores are allowed.

The correct answer is: Physical address 0x5418d is accessed, and stores are allowed.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 14/17

Question 48
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x00009dde, choose the most accurate answer from the options below.

Select one:

Physical address 0x7a is accessed

Physical address 0x7adde is invalid, but stores are allowed.

Physical address 0x7a is invalid but stores are allowed.

A TLB exception occurs.

Physical address 0x7adde is accessed, and stores are allowed.

The correct answer is: A TLB exception occurs.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 15/17

Question 49
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x7fffd257, choose the most accurate answer from the options below.

Select one:

Physical address 0x56 is invalid but stores are allowed.

Physical address 0x56257 is accessed, and stores are allowed.

Physical address 0x56 is accessed

Physical address 0x56257 is invalid, but stores are allowed.

A TLB exception occurs.

The correct answer is: A TLB exception occurs.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 16/17

Question 50
Not answered

Marked out of

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x200a2f, choose the most accurate answer from the options below.

Select one:

Physical address 0x31aa2f is accessed, and stores are allowed.

Physical address 0x31a is accessed, but stores are not allowed.

Physical address 0x31a is accessed

Physical address 0x31aa2f is accessed, but stores are not allowed.

A TLB exception occurs.

The correct answer is: Physical address 0x31aa2f is accessed, but stores are not allowed.

11/05/2020 Sample Final Exam V2: Attempt review

https://moodle.telt.unsw.edu.au/mod/quiz/review.php?attempt=7079496&cmid=2957991&showall=1 17/17

Question 51
Not answered

Marked out of

Information

Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.

All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame

number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry

is writable (1) or not (0). All numbers are hexadecimal.

200 31a 0 1

7fffe 54 1 1

7fffd 56 0 0

7ffff 50 1 1

201 6d 1 1

203 aa 0 1

202 4f 1 1

7fffc 97 1 1

 

If software attempts to access virtual address 0x00005765, choose the most accurate answer from the options below.

Select one:

Physical address 0x6c765 is accessed, stores are not allowed.

Physical address 0x6c is accessed

A TLB exception occurs.

Physical address 0x6c is accessed, and stores are allowed.

Physical address 0x6c765 is accessed, and stores are allowed.

The correct answer is: Physical address 0x6c765 is accessed, and stores are allowed.

This is the last page of the exam. 

You can submit your exam by clicking Finish attempt … , and Submit all and finish at the bottom of the page, and confirm via the