Consider a scenario where a computer system has a small


Question1 

a) Consider a scenario where a computer system has a small number ofactiveprocesses using a large amount of their virtual address space, i.e., the systemisrunning a small number of very large applications/processes. Mostmodern computers support more than one size for page frames, e.g., modern x86-64capable CPUs can support 4KB, 2MB, or even 1GB. Discuss how (i) a smaller page framesizeand (ii) a larger page frame size would impact the performance of the abovesystem.

b) Each page that is mapped into the virtual memory of a process has permissionssuchas read, write, and/or execute associated with it. Explain the benefits of havingsuchpermissions associated with each page, and what would happen if thesepermissionswere breached, e.g., a process attempted to write to a page that did not havethe write permissiongranted.

c) Consider a scenario where the memory of the computer has a total of threephysicalpage frames and the following sequence of page references aregenerated:

1, 2, 3, 4, 1, 2, 3, 2, 1, 4, 1, 2, 3, 4, 5, 6, 5, 4, 3,1

i) Prepare tables/diagrams demonstrating the operation of the optimal,FIFO, and LRU page replacement algorithms for the abovescenario;

ii) Identify how many page faults occur for each algorithm; and

iii) LRU is commonly used because it's performance is close to optimal.Explain why (1) optimal itself is not used, and (2) why LRU's performance is closeto optimal.

Question2

a) Explain the concept of a critical region and how critical regions occur (i)whenpseudo-concurrency is used, and (ii) when physical concurrency is used.

b) In the class slides for Week 6, on Slide 31 a scenario is presented demonstratingwhere a deadlock could occur using two semaphores. Explain how deadlockcould occur if only one semaphore wereused.

c) Consider a scenario where an organisation has been using the same softwarereliablyfor many years. The software does not include any mechanisms for managingdeadlock, i.e., there is no deadlock recovery, avoidance, or preventionmechanisms in place. Recently the organisation upgraded their hardware, which among otherimprovements also included an upgrade from a single-core CPU to a multi-coreCPU.After the upgrade, the software the organisation has been using reliably nowregularly experiences deadlock. Explain why this scenario is possibleand recommend an approach to solving it.

d) Consider the following information about resource usage:


Allocation A B C

A

Max B

C

AvailableA B C

P0

1

2

2

9

8

8

2 2

2

P1

1

1

2

4

3

3



P2

2

1

1

2

1

7



P3

2

2

1

3

3

2



P4

2

2

2

7

7

7



Using the Banker'sAlgorithm:

i. Demonstrate that the system is in a safe state.

ii. Demonstrate that the system would not be in a safe state if a request forone C resource was granted toP2.

iii. If process P2were to request one C resource, as suggested in (ii), thesystemwould not deadlock. Explain.

Question3

a) Executable files are regular files that follow a particular format (see Week 8 Slide11). Would it be possible for two different operating systems running on the sametypeof hardware to share the same executables, e.g., Linux and FreeBSD running on an x86-64 PC? Explain.

b) A friend of yours has made an amazing discovery when searching their computerfora file. They are looking for a file that they modified some time ago. They attempted to search for the file using the file name, then attempted to search for the file usingthe approximate date/time the file was last modified. Although both searcheswereunsuccessful, returning no results, they were surprised to discover that searchingbased on the approximate date/time, which would be a numerical comparison,tookmuch longer than the file name comparison, which would be a string comparison. Given that comparing numbers should be much faster than textual strings, explain how each of these searches would work, and why there is a difference betweenthetimes.

c) A file system can be configured to use a block size independent of any disksectorsize (see Week 9 Slide 6). Consider a scenario where the file system is reconfigured to use a smaller block size in an attempt to increase the available/free disk space,however the disk space is actually reduced. Explain how this scenario could occur. In your answer, explain the relationship between file system block size and diskspace wasted per file.

d) Consider partitioning the disk for a Linux installation to maximise performance with the following partition requirements: the boot partition (1GB), the root filesystem(5GB), the /usr folder (20GB), the /home folder (100GB), and the swap partition used for paging to disk (24GB). The disk will be used in a system used to run largecomputation tasks which regularly use more memory than the computer has RAM. Your tasks are asfollows:

i) Consider how the partitions should be laid out on the disk and draw afigureillustrating the logical layout you have designed, e.g., the followingfigureshows how you might draw the logical layout (note that this examplealso represents an incorrectanswer).

/

/usr

/home

Swap

Boot

ii) Explain why you laid out the partitions of the disk in the manner youchoseand why it is suitable for a computer running large computation tasks.

MarkingScheme

Question 1 -

  • Part (a)
    • Explanation of how smaller page frame size impacts performance.
    • Explanation of how larger page frame size impacts performance.
  • Part (b)
    • Explanation of benefits for associating permissions with each page.
    •  Explanation of what happens upon breach of permission.
  • Part (c)
    • (i) Correct optimal / FIFO / LRU diagrams.
    • (ii)  Correct number of page faults for optimal / FIFO / LRU.
    • (iii) Explanation of why optimal is not used; explanation ofwhyLRU is close to optimal.

Question 2 -

  • Part (a)
    •   Explanation of critical regions.
    •   Explanation for critical regions and pseudo-concurrency.
    • Explanation for critical regions and physical concurrency.
  • Part (b)
    • Correctly identify how deadlock could occur with one semaphore.
    •  Explanation of how deadlock could occur.
  • Part (c)
    •   Explanation of why deadlock didn't occurpreviously.o (3 marks) Explanation of why deadlock occurs afterupgrade.
    •  o Discussion of proposedsolution.
  • Part (d)
    • (i)  Correct working for each step of execution for safe state.
    • (ii) Correct working demonstrating unsafe state.
    • (iii)  Explanation of why the system will not deadlock.

Question 3 -

  • Part (a)
    •   Correctly identifies whether executable files could be shared between different operatingsystems.
    •   Explanation of why executable files could/could not be shared.
  • Part (b)
    • Explanation of how filename vs date/time searcheswork.
    • Explanation of why file name searches would take less time.
  • Part (c)
    •   Explanation of the relationship between file system block sizeand disk space wasted perfile.
    •   Explanation of how reducing the file system block size could reducethe available/free diskspace.
  • Part (d)
    •   Design of partition layout illustrated in reasonable figure/diagram.
    •   Explanation/justification of design of partition layout.
    • Explanation of suitability of partition layout for largecomputation tasks.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Consider a scenario where a computer system has a small
Reference No:- TGS01401005

Expected delivery within 24 Hours