You are on page 1of 3

TSN 2101 Operating Systems (Test B, 30 marks)

Duration: 8.30 pm to 9.45 pm (1 Hour 15 Minutes)


Date: 3 Feb 2022, Friday, via online

Name : ____________________
Student ID: _____________________
Answer all the Questions (Question 1, 2 and 3)
Note:
You must write/print the following Honesty Pledge before the starting of this ‘TestB’ and affix your signature.
This is a mandatory requirement, and this should be placed as the first page of your answer sheet during your
submission. Note that submission of answer sheets from the students will not be accepted without honesty
pledge.
• Answer all the questions
• Mode of writing the answers: Handwritten A4 Sheets
• Convention for naming the submission file: studentid_studentname.pdf
• Mode of Submitting the answers: Upload the handwritten answer sheets along with honesty pledge as a
single file (.pdf format) here with proper labelling of the questions and page numbers.
• Additional sheets showing calculations, if any, can be attached. Pls. note that typed answers will not be
accepted. Submissions must be done by 9.45 pm. Submissions after 9.45 pm will not be accepted for
evaluation.

Honesty Pledge:

I affirm that I will not give or receive any unauthorized help on this “Test2”, through whatever means and all
work submitted will be my own. I also understand that cheating in this test will lead to getting me zero mark
automatically.

———————————
Signature of the student

Name of student_____________________________________

Student ID:___________________________________________
Question 1 (10 marks)
a. Identify the page numbers and offsets for the following address references (Given as decimal numbers).
Assume the page size is 2 KB, where 1 KB = 1024 Bytes. [1.5 x 2 = 3 marks]
i) 10222
ii) 345678

b. On a simple paging system, Translation Lookaside Buffer (TLB) holds the most active page entries and the
full page table is stored in the main memory. If reference to TLB takes 50 ns, and memory reference takes
105ns, identify the hit ratio to achieve an effective access time of 550ns. Marks will be deducted if the steps
are not clearly indicated. [3 marks]

c) On a system using demand-paged memory, it takes 25 ms to satisfy a memory request if the page is in
memory. If the page is not in memory, the request takes 250 ms if a free frame is available or the page to be
swapped out has not been modified. It takes 1050 ms if the page to be swapped out has been modified. What is
the effective access time if the page fault rate is 18%, and 68% of the time the page to be replaced has been
modified/free frame is not available? [4 marks]

Question 2 (10 marks)

a) Consider a computer system with a 64-bit logical address and 64-KB page size. The system supports up to 4
GB of physical memory. Marks will be deducted if the steps are not clearly indicated. [1 mark x 4 = 4 marks]
i) . How many entries are there in a conventional single-level page table
ii) How many entries are in a level-two-page table, if the first 32 bits of the address serve as the index into the
first-level page table?
iii) How many entries in an inverted page table?
iv) How many entries are in the virtual address space? If the first 32 bits of the address serve as the index into
the first-level page table

b) Consider the following segment table:

Segment Base Length


0 11 5
1 22 6
2 33 7
3 44 8

What are the physical addresses for the following logical addresses? [1 mark x 2 = 2 marks]
i) 2, 4
ii) 0, 8
c) Suppose that a file system contains 12 direct pointers to data blocks, 1 indirect pointer, 1 double indirect
pointer and 1 triple indirect pointer. Assume that the size of the data blocks is 4 KB and each block number is
represented as 8 byte unsigned integers. Marks will be deducted if the steps are not clearly indicated.
i) What is the maximum number of bytes addressed by 12 direct pointers? [0.5 mark]
ii) What is the maximum number of bytes addressed by a single indirect pointer? [0.5 mark]
iii) What is the maximum number of bytes addressed by a double indirect pointer? [0.5 mark]
iv) What is the maximum number of bytes addressed by a triple indirect pointer? [0.5 mark]
v) What is the maximum file size that can be supported by this file system? [2 marks]

Question 3 (10 marks)


a) Consider the following page reference string: 4,3,4, 3,5,6, 3,2,7, 4,2,3, 2,3,7 Assume the availability of
THREE frames and all the frames are initially empty. Marks will be deducted if the steps are not clearly
indicated. [2 marks x 2 = 4 marks]
i) How many page faults would occur for the Optimal Page Replacement (OPT) page replacement algorithm?
Identify the final pages in the frames.
ii) How many page faults would occur for the Least Recently Used (LRU) page replacement algorithm? Identify
the final pages in the frames.

b) Suppose that a disk drive has 1000 tracks, numbered 0 to 999. Assume that the disk drive is currently serving
a request at track 345, and the head is moving towards track 0. The queue of pending requests, in FIFO order is
123, 874, 692, 475, 105, 376 Starting from the current head position, what is the total seek distance (in tracks)
that the disk arm moves and the total seek time (in ms) required to satisfy all the pending requests, for each of
the following algorithms? Assume the seek time required for traversing each track is 3 ms. Marks will be
deducted if the steps are not clearly indicated. [1.5x 4 = 6 marks]
i) SSTF
ii) LOOK
iii) C-LOOK
iv) C-SCAN

You might also like