0% found this document useful (0 votes)
10 views2 pages

CSW355 - OldBylaw - OperatingSystems - Midterm - Term2 - 2025 (Model Answer)

This document outlines the midterm exam for the CSW355 - Operating Systems course at Ain Shams University, detailing the exam structure and topics covered. It includes sections on general concepts, CPU scheduling, and memory management, with specific questions and marks allocated for each section. The exam is scheduled for April 10, 2025, and is designed for second-term undergraduate students in their third year.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

CSW355 - OldBylaw - OperatingSystems - Midterm - Term2 - 2025 (Model Answer)

This document outlines the midterm exam for the CSW355 - Operating Systems course at Ain Shams University, detailing the exam structure and topics covered. It includes sections on general concepts, CPU scheduling, and memory management, with specific questions and marks allocated for each section. The exam is scheduled for April 10, 2025, and is designed for second-term undergraduate students in their third year.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: ID: Bylaw:

Faculty of Computer & Information Sciences Instructors: Prof: Mostafa Aref


Ain Shams University Dr. Ahmed Salah
Course: CSW355 - Operating Systems Offering Dept: Computer Science
Exam: Midterm 10-04-2025 Academic year: 2024-2025
Year: (2nd term) 3rd undergraduate Duration: 60 min
Answer the following questions: (total marks: 10 (+1))

WRITE YOUR ANSWERS IN SAME EXAM PAPER


FIRST: General Concepts [2 Marks]
MCQ: Process State [2 Marks: 0.5/Each]
1. The Process Image element that contains the collection of attributes needed by the O/S to control a
particular process is called the:
a) User Data b) Process Control Block c) None of the choices
d) User Stack e) User Heap f) All of the choices

2. In the five-state process model, the transition from running →blocked state happens when:
a) process terminates b) waiting event is occurred c) process wait for I/O
d) process is swapped out e) process reaches max allowed time f) None of the choices

3. In the seven-state process model, why the process is placed in Suspended state?
a) Free some memory b) Increase the CPU utilization
c) Allow OS to support priorities among processes d) All of the choices

4. Which of the following statement(s) is/are NOT true? [Chose all that apply]
1. Locked bit is set to 1 by the memory management unit (MMU)
2. Modified bit is set to 1 by the OS
3. Modified bit is set to 0 by the memory management unit (MMU)
4. Modified bit is checked by the OS
5. Present bit is set to 1 by the OS
6. Present bit is set to 0 by the OS

SECOND: CPU Scheduling [2 Marks]


Consider the following processes on a single CPU, using a Highest Response Ratio Next (HRRN) scheduling
with: (Time now at which the CPU is available = 10)
Process Arrival Service
A 8 5
B 4 5
C 6 5
Question Answer Mark
1.5 mark
1. Calculate the finish time of each process? A: 25 B: 15 C: 20
0.5/each
Since the service times are the same, it 0.5
2. Comment on the behavior of the scheduling
selects based on wait time ➔ It mimic for
on this particular case… What does it mimic?
FCFS clarification

THIRD: Memory Management [6(+1) Marks]


Measures: (1 KB = 210, 1 MB = 220, 1 GB = 230, 1 TB = 240)
Virtual Memory Management [6(+1) Marks: 1/Each]
In a system using virtual paging, the page size is 1 KB, the program virtual memory size is 1 GB and the
physical memory size is 16 GB. It’s desired to limit the page table size to one page. Answer the following
questions: (1 KB = 210, 1 MB = 220, 1 GB = 230)
Question Answer
1. What’s the number of bits for the offset field? 10 bit(s)
2. What’s the min number of levels for the page tables? 3
3. What’s the min amount of internal fragmentation (if any) that occur in page 1024 – 16x4 = 960
table(s)? bytes
A)

In the above system, assume that the fetch policy is demand paging and the resident set size is 4 pages
per program. The replacement policy is FIFO. The free frame list is (10, 20, 30, 40, 50, 60, 70). Frames
allocation will be done from the list head (left most). De-allocated frames will be added to the list tail (right
most). The TLB cache size is 3. Consider a program with the following sequence of page references:
7 (r), 3 (r), 3 (w), 1 (w), 3 (w), 6 (r), 4 (w), 3 (r)
Answer the following questions:
Question Answer
1. What’s the final content of the resident set? Page num 4 3 1 6
2. What’s the final content of the TLB cache? Page num 6 3 4
Frame num 40 20 50
Modified bit 0 1 1
3. What’s the total number of TLB hits? 3
BONUS: how many times is the hard disk accessed? #reads: 5 #writes: 0

req

Wishing to you all the best isA ☺,


Ahmed Salah

You might also like