Beruflich Dokumente
Kultur Dokumente
com
http://vujannat.ning.com
Largest Online Community of VU Students
FINALTERM EXAMINATION
FALL 2006 Marks: 75
CS604 - OPERATING SYSTEMS Time: 120min
StudentID/LoginID: ______________________________
Exam Date:
a. There is no choice.
3. Do not ask any questions about the contents of this examination from
anyone.
a. If you think that there is something wrong with any of the questions,
attempt it to the best of your understanding.
a. If you believe that two (or more) of the choices are the correct ones for
a particular question, choose the best one.
b. On the other hand, if you believe that all of the choices provided for a
particular question are the wrong ones, select the one that appears to
you as being the least wrong.
not be considered as errors. So try to only answer the question and put
your idea and
Segmented paging incurs less internal fragmentation than pure process-level paging.
► True
► False
► Ambiguous question
The Multi-Level Feedback Queue (MLFQ) scheduling algorithm is the same as Shortest-
Job-First.
► True
► False
► Ambiguous question
► True
► False
► Ambiguous question
Question No: 4 ( Marks: 2 ) - Please choose one
► True
► False
► Ambiguous question
► True
► False
► Ambiguous question
The following is a semaphore-based solution for the n-process critical section problem. Is it a
good solution? Explain your answer.
Question No: 7 ( Marks: 20 )
Suppose there are 2 copies of resource A, 3 copies of resource B, and 3 copies of resource C.
Suppose further that process 1 holds one unit of resources B and C and is waiting for a unit
of A; that process 2 is holding a unit of A and waiting on a unit of B; and that process 3 is
holding one unit of A, two units of B, and one unit of C. Draw the resource allocation graph.
Is the system in a deadlocked state? Why or why not?
(a) Given the following snapshot of a system, determine whether or not the system is in a safe
state.
SHOW YOUR WORK justifying your answer. (Use Banker’s algorithm)
Process Maximum need Current Available
ID allocation
R1 R2 R3 R1 R2 R3 R1 R2 R3
P1 3 2 3 2 2 2 1 1 2
P2 1 3 2 0 1 2
P3 4 4 4 0 2 2
P4 1 6 1 1 0 1
(b) Given the following resource-allocation state of a system at time T0, determine whether
or not the system is in deadlock at T0. Justify your answer.
Consider a pure demand paging system with a paging disk that has
an average access and transfer time of 20 milliseconds. Addresses
are translated through a page table in main memory, with an access
time of 50 nanoseconds per memory access. Thus, each memory
reference through the page table takes two accesses. To improve this
time, we have added cache memory that reduces access time to one
memory reference, if page table entry is in the cache. Assume that
cache access time is negligible.
Assume that 80% of the accesses are in the cache, of the remaining,
10% cause page faults, and 50% of the replaced pages are dirty.
Write down the expression / equation for the effective memory
access time for the computer system. Show your work.
b. (4 Points) What are the sizes of logical address and logical address
space?
Logical Address:
Logical Address Space:
d. (3 Points) How many levels of paging does the system support? Why?
Show the break down of the logical address in the form of pi's and d. Clearly
show the number of bits needed for d and each pi.
f. (4 Points) What is the effective memory access time for the system?
Show your work.
A system call
1. Is an entry point into the kernel code
2. Allows a program to request a kernel service
3. Is a technique to protect I/O devices and other system resources
4. All of the above
5. None of the above
MIDTERM EXAMINATION
FALL 2006 Marks: 60
CS604 - OPERATING SYSTEMS Time: 60min
StudentID/LoginID: ______________________________
Exam Date:
Please read the following instructions carefully before attempting any question:
a. There is no choice.
b. You will have to answer all questions correctly in this examination to get the
maximum possible marks.
3. Do not ask any questions about the contents of this examination from anyone.
a. If you think that there is something wrong with any of the questions, attempt it to
the best of your understanding.
4. Examination also consists of multiple-choice questions. Choose only one choice as your
answer.
a. If you believe that two (or more) of the choices are the correct ones for a
particular question, choose the best one.
b. On the other hand, if you believe that all of the choices provided for a particular
question are the wrong ones, select the one that appears to you as being the least
wrong.
5. All Programming questions should be answered using C language syntax. Errors of syntax
will not be considered as errors. So try to only answer the question and put your idea and
concept using C. Don’t use any tool or IDE.
**WARNING: Please note that Virtual University takes serious note of unfair means.
Anyone found involved in cheating will get an `F` grade in this course.
Consider a UNIX system with threshold priority of 125. Assume two processes, P1 and P2,
which came
into the system at the same time. P1 has a nice value of 15 and 'recent CPU usage' 45 ticks. P2
has a nice
value of 10 and ‘recent CPU usage’ 65 ticks. It is time for scheduling. Which of the two
processes will be
chosen for execution?
► P1 because its recent CPU usage is less than that of P2’s and, therefore, its priority is
higher than P2’s priority.
What is spooling?
► Ability of an OS to protect jobs from writing into the wrong memory location
► Ability of an OS to read jobs from cards onto the disk, and load a new job from the
disk to empty memory partition
Which component ensures that a process can execute only within its own address space?
► I/O device
► Memory-addressing hardware
► Timer
► Virtual memory
► A positive integer associated with an open file. Its value describes the type of data in
the file and the file location on disk.
► A positive integer used to index the per process file descriptor table to eventually
access an open file’s attributes, including its location.
► A positive integer used to index the per process file descriptor table, which points to
the inode of the file containing the executable image of the process on disk.
What are the differences between trap and interrupts? What is the use of each function?
Given the five processes below with their indicated number of run time units, answer the questions
that follow. Assume processes arrived in numerical order at time 0.
(a) Show the scheduling order for these processes under first-come-first-served, shortest-job first,
and round-
robin scheduling (quantum = 1)
(b) For each process in each schedule above, indicate the wait time (Total time spent in the wait
queue) and
turnaround time.
Give source code for a C program to implement the following process hierarchy in a UNIX/Linux
system.
P1
P2 P3
P4
Consider the following set of processes with their CPU burst times
(milliseconds), arrival times (milliseconds) and priorities. For example,
process P1 arrives 2 milliseconds after the start of the system, has
priority 3 and needs the CPU for 12 milliseconds.
What are the average turnaround time and the average waiting time in
the scheduler queue in milliseconds for this set of processes running
on a system using each of the scheduling algorithms listed below?
Show your work to get any or full points.
1. Round Robin scheduling algorithm (quantum = 1 millisecond).
2. Shortest Job First (non-preemptive).
I/O device
Memory-addressing hardware
Timer
Virtual memory
Selects the processes that should be brought in the ready queue, from
the job pool.
Selects which process should be executed next and allocates CPU.
Which removes process from memory and reduces degree of
multiprogramming.
What are threads, describe only two advantages and two disadvantages
of threads.
What are the five major activities of an operating system in regard to file
management?
Describe shortly about the following Linux directories and their purpose,
1. Root (/)
2. Boot
3. Dev
4. Bin
5. home
What is spooling?
I/O device
Memory-addressing hardware
Timer
Virtual memory
Selects the processes that should be brought in the ready queue, from
the job pool.
Selects which process should be executed next and allocates CPU
which removes process from memory and reduces degree of
multiprogramming
/proc
Priority wise
CPU Burst
Distribute CPU resources equally among all processes
Describe shortly about the following Linux directories and their purpose,
1. lib
2. etc
3. Boot
4. Root
5. home
2. Boot:-
3. Dev:-
4. Bin
5. home
What are threads, describe only two advantages and two disadvantages of threads.
The following is a semaphore-based solution for the n-process critical section problem.
Is it a good solution? Explain your answer.
Consider the following set of processes with their CPU burst times
(milliseconds), arrival times (milliseconds) and priorities. For example,
process P1 arrives 2 milliseconds after the start of the system, has
priority 3 and needs the CPU for 12 milliseconds.
What are the average turnaround time and the average waiting time in
the scheduler queue in milliseconds for this set of processes running
on a system using each of the scheduling algorithms listed below?
Show your work to get any or full points.
1. Round Robin scheduling algorithm (quantum = 1 millisecond).
2. Shortest Job First (non-preemptive).
StudentID/LoginID: ______________________________
a. There is no choice.
3. Do not ask any questions about the contents of this examination from
anyone.
a. If you think that there is something wrong with any of the questions,
attempt it to the best of your understanding.
a. If you believe that two (or more) of the choices are the correct ones for
a particular question, choose the best one.
b. On the other hand, if you believe that all of the choices provided for a
particular question are the wrong ones, select the one that appears to
you as being the least wrong.
**WARNING: Please note that Virtual University takes serious note of unfair
means. Anyone found involved in cheating will get an `F` grade in this
Connecting VU Students
course.
b) Clearly state the progress condition in the context of solutions for the critical section
problem. (5)
1. Given memory partitions of 100K, 600K, 200K, 300K, and 500K (in order), how would each
of the First-fit, Best-fit, and Worst-fit algorithms place processes of 409K, 236K, 125K, and
514K (in order)? (12)
What could be the possible conditions, which can ensure that a deadlock will not occur? Explain.
Write a note on how sharing of files is done on multi user systems? Give five different
ways.
A system call
► CPU
► Compiler
► Hard disk
► True
► False
► Priority wise
► CPU Burst
► All of these
Kernel means