0% found this document useful (0 votes)
4 views

OS

The document provides an overview of operating systems, detailing their objectives, functions, and various components such as interrupts, memory management, and multiprocessor systems. It includes a series of questions and answers that cover key concepts like system calls, timesharing, and the differences between various system architectures. Additionally, it discusses the advantages and disadvantages of different system types, including client-server and peer-to-peer systems.

Uploaded by

aswins2236
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

OS

The document provides an overview of operating systems, detailing their objectives, functions, and various components such as interrupts, memory management, and multiprocessor systems. It includes a series of questions and answers that cover key concepts like system calls, timesharing, and the differences between various system architectures. Additionally, it discusses the advantages and disadvantages of different system types, including client-server and peer-to-peer systems.

Uploaded by

aswins2236
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023

UNIT I OPERATING SYSTEMS OVERVIEW


Computer System Overview-Basic Elements, Instruction Execution, Interrupts, Memory Hierarchy,
Cache Memory, Direct Memory Access, Multiprocessor and Multicore Organization. Operating
system overview-objectives and functions, Evolution of Operating System.- Computer System
Organization-Operating System Structure and Operations-System Calls, System Programs, OS
Generation and System Boot.
PART-A

1 List the services of operating system?


 Program execution,
 I/O operations,
 File-system manipulation,
 Communications,
 Error detection
2 What is the purpose of system programs? (Apr 2022)
System programs can be thought of as bundles of useful system calls. They providebasic
functionality to users so that users do not need to write their own programs to solve
common problems.
3 What is the purpose of interrupts? How does an interrupt differ from a trap? (Nov
2016) ( Dec 2021)
An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is
summoned to deal with the cause of the interrupt; control is then returned to the interrupted
context and instruction. A trap is a software-generated interrupt. An interrupt can be used to
signal the completion of an I/O to obviate the need for device polling. A trap can be used to call
operating system routines or to catch arithmetic errors.
4 What is the need for DMA?
DMA, or Direct Memory Access, is a sub controller that can access memory insequential
order without intervention from the processor.
It is used to avoid programmed I/O for large data movement , It bypasses CPU to
transfer data directly between I/O device and memory, It can access the data items in
primary and secondary cache
5 Define multiprocessor system and give down the advantages of Multiprocessor
Systems? ( Dec 2021)
Multiprocessor systems (also known as parallel systems or multi core systems or tightly
coupled systems) have two or more processors in close communication, sharing the computer
bus and sometimes the clock, memory, and peripheral. Advantages are:
Increased throughput, Economy of scale and increased reliability.
6 Define Clustered systems with its types?
Another type of multiprocessor system is a clustered system, which gathers together multiple
CPUs to accomplish computational work. In asymmetric clustering, one machine is in hot
stand by mode while the other is running the applications. The hot standby host does nothing
but monitor the active server. In symmetric mode, two or more hosts are running
applications, and they are monitoring each other.

St. Joseph’s College of Engineering Page 1 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
7 Define Symmetric and asymmetric multiprocessing?
Symmetric: That all processors are peers; no master-slave relationship exists between
processors. Each processor concurrently runs a copy of the operating system.
Asymmetric: In which each processor runs an identical copy of the operating system,
and these copies communicate with one another as needed
8 Define system call? What is the purpose of system calls? (April 2018)
It provides the interface between a process and the operating system. Its categories are
process control, file management, device management, information maintenance, and
communications. System calls allow user-level processes to request services of the
Operating system.
9 Do timesharing differ from Multiprogramming? If so, How? (April 2015)
Multiprogramming increases CPU utilization by organizing jobs (code and data) so that
the CPU always has one to execute. Timesharing (or multitasking) is a logical extension of
multiprogramming. In time-sharing systems, the CPU executes multiple jobs by switching
among them, but the switches occur so frequently that the users can interact with each
program while it is running.
10 What are the disadvantages of multiprocessor system (Nov 2016)
Overhead—The time wasted in achieving the required communications and control status
prior to actually beginning the client‘s processing request
Latency—The time delay between initiating a control command, or sending the command
message, and when the processors receive it and begin initiating the appropriate actions
Determinism—The degree to which the processing events are precisely executed Skew—A
measurement of how far apart events occur in different processors, when
they should occur simultaneously
11 Define Client- server systems with its types?
User-interface functionality that used to be handled directly by the centralized systems is
increasingly being handled by the PCs. As a result, centralized systems today act as server
systems to satisfy requests generated by client systems.
The two types of client – server systems are, Compute-server, File-server systems.
12 What is cache coherency?
In a multiprocessor environment addition internal registers are maintained, each of the CPUs
also contains a local cache. In such an environment, a copy of A may exist simultaneously in
several caches. Since the various CPUs can all execute in parallel, we must make sure that an
update to the value of A in one cache is immediately reflected in all other caches where A
resides. This situation is called cache coherency, and it is
usually a hardware issue.
13 Why API’s need to be used rather than system calls? (April 2015)
 System calls differ from platform to platform. By using a stable API, it is easier to
migrate your software to different platforms.
 The API usually provides more useful functionality than the system call directly. If
you make the system call directly, you'll typically have to replicate the pre-call and
post-call code that's already implemented by the API.
 The API can support multiple versions of the operating system and detect which
version it needs to use at run time. If you call the system directly, you either need to
replicate this code or you can only support limited versions.

St. Joseph’s College of Engineering Page 2 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
14 What is a trap?
A trap (or an exception) is a software-generated interrupt caused either by an error (for
example, division by zero or invalid memory access) or by a specific request from a
user program that an operating- system service be performed.
15 What are the activities performed by the process management?
Creating and deleting both user and system processes, Suspending and resuming
process, Providing mechanisms for process synchronization, Providing mechanisms for
process communication, Providing mechanisms for deadlock handling
16 What are the activities performed by the main-memory management?
Keeping track of which parts of memory are currently being used and by whom,
Deciding which processes are to be loaded into memory when memory space becomes
available., Allocating and deal locating memory space as needed.
17 What is dual mode operation and what is the need of it? (May 2019) (Apr 2022)
There are two separate modes of operation - User mode , Kernel mode(Supervisor mode or
system mode or privileged mode) . Mode bit, is added to the hardware of the computer to
indicate the current mode: kernel (0) or user (1) . The mode bit, can distinguish between a
task that is executed on behalf of the operating system and one that is executed on behalf of
the user. When the computer system is executing on behalf of a user application, the system
is in user mode and when a user application requests a service from the operating system
the system must make a transition from user to kernel mode .

Need :
 Handling interrupts
 To switch from user mode to kernel mode
 Input Output management
For protecting the operating system from errant users
18 Can traps be generated intentionally by a user program? If so, for what purpose.
A trap can be generated intentionally by a user program. It can be used to call
operating system routines or to catch arithmetic errors.

19 Why do some systems store the operating system in firmware, while others store it
on disk?
For certain devices, for handheld PDA‘s and cellular telephones, a disk with a file
system may be not being available for the device. In this situation the OS must be
stored in firmware.
20 What are the advantages of peer to peer systems over client server systems? (April
2016)
 It is easy to install and so is the configuration of computers on this network
 All the resources and contents are shared by all the peers, unlike server-client
architecture where Server shares all the contents and resources.
 P2P is more reliable as central dependency is eliminated. Failure of one peer doesn‘t
affect the functioning of other peers. In case of Client –Server network, ifserver own.
 There is no need for full-time System Administrator. Every user is the administrator
of his machine. User can control their shared resources.
 The over-all cost of building, maintaining this type of network is comparatively very
less
 Security : Rules defining security and access rights can be defined at the time of
set-up of server.

St. Joseph’s College of Engineering Page 3 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
21 Under what circumstances would a user be better off using a timesharing system rather than a
PC or single -user workstation.(Nov 2018)
Time-sharing is a technique which enables many people, located at various terminals, to use
a particular computer system at the same time. Time-sharing or multitasking is a logical
extension of multiprogramming. Processor's time which is shared among multiple users
simultaneously is termed as time-sharing. A workstation is a special computer designed for
technical or scientific applications. Intended primarily to be used by one person at a time,
they are commonly connected to a local area network and
run multi-user operating systems.
22 Consider a memory system with a cache access time of 10 ns and a memory access time of 110
ns – assume the memory access time includes the time to check the cache. If the effective
access time is 10% greater than the cache access time, what is the hit ratio H ?
effective access time =cache hit ratio*cache access time+ cache miss ratio *(cache accesstime
+main memory access time)
effective access time =10% greater the cache access time ==>11
let cache hit ratio be h.
11 = h*10ns +(1-h) (110)
11= 10h+110-110h
100h= 99 ie, H= 99/100= 99%`
23 What is system boot?
The procedure of starting a computer by loading the kernel is known as booting the system.
On most computer systems, a small piece of code known as the bootstrap program or
bootstrap loader locates the kernel, loads it into main memory, and starts its execution.
Some computer systems, such as PCs, use a two-step process in which a simple bootstrap
loader fetches a more complex boot program from disk, which in turn
loads the kernel.
24 What is difference between trap and interrupt? (April 2018)
An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is
summoned to deal with the cause of the interrupt; control is then returned to the interrupted
context and instruction. A trap is a software-generated interrupt. An interrupt can be used to
signal the completion of an I/O to obviate the need for device polling. A trap can be used to call
operating system routines or to catch arithmetic errors.
25 List out some system calls required to control the communication system. (May 2019)
 create, delete communication connection
 send, receive messages
 Transfer status information
 attach or detach remote devices
26 What is Interrupt ? Give example.( APRIL/MAY 2021)
An interrupt is a computer signal that tells the computer to stop running the current program so
that a new one can be started or a circuit that carries such a signal. An example of an interrupt is a
signal to stop Microsoft Word so that a PowerPoint presentation can gear up.
27 Some computer systems do not provide a privileged mode of operation in hardware. Is it
possible to construct a secure operating system for these computer systems?(Nov 2018)
An operating system for a machine of this type would need to remain in control (or monitor
mode) at all times. This could be accomplished by two methods( i) Software interpretation of all
user programs (like some BASIC, Java, and LISP systems). The software interpreter would
provide, in software, what the hardware does not provide.(ii) Require meant that all
programs be written in high‐level languages so thatall object code is compiler produced. The
compiler would generate (either in‐line or by
function calls) the protection checks that the hardware is missing.

St. Joseph’s College of Engineering Page 4 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
28 Compare and contrast DMA and Cache Memory (Nov 2015)
Direct Memory Access Cache Memory
It‘s a module in computer system which It‘s a small storage present within CPU or
helps the devices in system to read/write in between CPU and Main memory and stores
the Main memory without the most frequently used copy of data
intervention of CPU
Advantage: It fastens bulk transfer of data Advantage: It fastens the memory
from devices to main memory, as there is reference of required data, therefore
no need of CPU for every transfer fetching time reduced and execution isfaster

Disadvantage: Slows down processor due Disadvantage: Maintaining Cache


to Cycle stealing coherence and updating in copies of main
memory and secondary storage is anoverhead

28 Write the difference between Batch Systems and Time Sharing Systems.(Nov 2015)
Batch Systems Time Sharing Systems
Batch systems focuses to improve the CPU Time Sharing Systems focuses to improve
Utilization multi user interactive environment
Batches the jobs (programs) together and Handle multiple-interactive jobs, by
executes job in sequence. Thus reducesidle sharing processor time among multipleusers.
time of CPU Multiple users access via terminals
Eg IBM SYS, IBM OS for 7090/ 7094 Eg: Compatible time sharing systems
(CTSS)
29 Differentiate system calls and system programs.( APRIL/MAY 2021)
The system calls are list of the function that will be call in section between user and kernel.
But the system program is the program that can do system works like : Change system
settings.
PART-B
1 Explain in detail computer system organization.
2 With neat sketch discuss Computer System Overview (Nov 2015) ( Apr 2022)
3 Explain about various managements of operating system and responsibilities
4 Discuss about various services provided by operating system. ( APRIL/MAY 2021)
5 List and explain the classification of system calls and its significance (Nov 2018)
6 Describe System Calls, System Programs in detail with neat sketch and OS
Generation (April 2017, Dec 2021)
7 Enumerate different operating system structures and explain with neat sketch (April2017)
(May 2019)
8 Discuss the following ( Apr 2022)( Dec 2021)
a) Operating System functions
b) Cache Memory
c) Direct Memory
9 Discuss the essential properties of the following types of systems
(i) Time sharing systems.
(ii) Multiprocessor systems
(iii) Distributed systems
(iv) Clustered systems
10 With a neat diagram, explain the memory hierarchy and the performance of various levels of
storage system.

St. Joseph’s College of Engineering Page 5 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
11 Give the details about hardware protection and dual mode protection.
12 Give reason why caches are useful. What problems do they solve? What problems do
they cause? If a cache can be made as large as the device for which it is caching why notmake
it that large and eliminate the device? (April 2018)
13 How could a system be designed to allow a choice of operating system from which to boot?
What would the boot strap program need to do?
14 Discuss about the evolution of Virtual Machines. Also explain how virtualization could be
implemented in operating systems. (April 2015)
Discuss about the functionality of System boot with respect to operating system
(April 2015)
15 Distinguish between the (April 2016)
i) client server and peer to peer models of distributed systems
ii) symmetric and asymmetric multiprocessing.
iii)multiprocessor and Multicore organization
UNIT II PROCESS MANAGEMENT
Processes-Process Concept, Process Scheduling, Operations on Processes, Interprocess
Communication; CPU Scheduling- Scheduling criteria, Scheduling algorithms, Multipleprocessor
Scheduling. Threads- Overview, Multithreading Models, Threading issues.Process Synchronization
- Critical Section Problem, Semaphores, Classical problems of synchronization. Monitors.
Deadlock – System model, Deadlock characterization, Methods for handling deadlocks, Deadlock
prevention, Deadlock avoidance, Deadlock detection, Recovery from deadlock.
PART-A
1 Define process state?
The state of a process is defined in part by the current activity of that process. Each
process may be in one of the following states: New, running, waiting, ready,Terminated.

2 Define thread pool


A thread pool is a group of pre-instantiated, idle threads which stand ready to be given
work. These are preferred over instantiating new threads for each task when there is a large
number of a short task to be done rather than a small number of long ones.
3 Define IPC?
It provides a mechanism to allow processes to communicate and to synchronize their actions
without sharing the same address space. Example: Chat program
4 Define multilevel queue- scheduling algorithm.
A multilevel queue- scheduling algorithm partitions the ready queue into several separate
queues. The processes are permanently assigned to one queue, generally based on some
property of the process, such as memory size, process priority, or process type.
Each queue has its own scheduling algorithm.
5 List out the benefits and challenges of thread handling.(May 2019)
Benefits
 Responsiveness
 Resource sharing
 Economy
 Scalability
Challenges
 Identifying tasks
 Balance
 Data splitting
Data dependency Testing and debugging

St. Joseph’s College of Engineering Page 6 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
6 What are the Scheduling Criteria?
CPU utilization, Throughput, Turnaround time, Waiting time, Response time
7 What are the two models of interprocess communication? What are the strengths and
weaknesses of the two approaches? ( Dec 2021)
The two models of interprocess communication are message passing model and the shared-
memory model. Message passing is useful for exchanging smaller amounts of data and also
easier to implement. Shared memory allows maximum speed and convenience of
communication, while message passing requires the more time- consuming task of kernel
intervention. Shared memory also has problems of protection
and synchronization.
8 Define Threads. List the advantages of thread. (May 2013)
It is also called as lightweight process (LWP), is a basic unit of CPU utilization; it
comprises a thread ID, a program counter, a register set, and a stack.
Advantages of thread:
Thread minimizes context switching time. Use of threads provides concurrency within a
process, Efficient communication, Utilization of multiprocessor architecture.
9 Define program and process.
A Program is a passive entity, such as the contents of a file stored on disk, whereas a
process is an active entity, with a program counter specifying the next instruction to
execute.

10 Define dispatcher and Dispatch latency.


The dispatcher is the module that gives control of the CPU to the process selected by theshort-
term scheduler. This function involves Switching context, Switching to user mode,
Jumping to the proper location in the user program to restart that program.
The dispatcher should be as fast as possible, given that it is invoked during everyprocess
switch. Dispatch latency is the time taken for the dispatcher to stop one process and start
another process to run.
11 Define deadlock.
A process requests resources; if the resources are not available at that time, the process enters a
wait state. Waiting processes may never again change state, because the resources they have
requested are held by other waiting processes. This situation is
called a deadlock.
12 What are conditions under which a deadlock situation may arise?
A deadlock situation can arise if the following four conditions hold simultaneously in a
system: Mutual exclusion, Hold and wait, No pre-emption, Circular wait.

13 What are binary semaphores?


A binary semaphore is a semaphore with an integer value that can range only between 0and 1.
A binary semaphore can be simpler to implement than a counting semaphore, depending
on the underlying hardware architecture.
14 What are the methods for handling deadlocks?
The deadlock problem can be dealt with in one of the three ways:
 Use a protocol to prevent or avoid deadlocks, ensuring that the system will neverenter
a deadlock state.
 Allow the system to enter the deadlock state, detect it and then recover.
Ignore the problem , and pretend that deadlocks never occur in the system.

St. Joseph’s College of Engineering Page 7 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
15 Define Semaphore. ( APRIL/MAY 2021)
Semaphores are integer variables that are used to solve the critical section problem by using two
atomic operations, wait and signal that are used for process synchronization.
Definition of wait() is as follows:
wait(S)
{
while (S<=0)
; // busy wait
S--;
}
The definition of signal() is as follows:
signal(S)
{ S++;
}
16 What are the 3 requirements to solve critical-section problem?
 Mutual exclusion,
 Progress,
 Bounded waiting
17 Give the structure of semaphore while implementing mutual-exclusion? (Apr 2022)
do
{
Wait (mutex);
Critical section
Signal (mutex);
remainder section
} while (1);
18 Define monitors? How will you represent the monitors?
A monitor is characterized by a set of programmer-defined operators. It consists of declaration of
variables whose values define the state of an instance of the type, as well as the bodies of
procedures or functions that implements operations on the type.
19 What is a resource-allocation graph?
Deadlocks can be described more precisely in terms of a directed graph called a system resource
allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of
vertices V is partitioned into two different types of nodes; P the set consisting of all active
processes in the system and R the set consisting of all resource types in the system.
20 What can the operating system do to recover from deadlock? (Nov 2014)
Kill all deadlocked processes , Kill one deadlocked process at a time and release its
resources , Steal one resource at a time, Roll back all or one of the processes to a
checkpoint that occurred before they requested any resources, then continue
21 Define deadlock prevention.
Deadlock prevention is a set of methods for ensuring that at least one of the four necessary
conditions like mutual exclusion, hold and wait, no pre-emption and circular wait cannot
hold. By ensuring that that at least one of these conditions cannot hold, the occurrence of a
deadlock can be prevented.

St. Joseph’s College of Engineering Page 8 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
22 Define spin lock with its advantage? (May 2013) (Nov 2015) (April 2016)
Spin lock or Busy waiting wastes CPU cycles that some other process might be able to use
productively.
Advantage: Is that no context switch is required when a process must wait on a lock, and a
context switch may take considerable time. Thus, when locks are expected to be held for
short times, spin locks are useful. Not preferred in uniprocessor. Preferred in multiprocessor
(as lock held for short time)
23 Define deadlock avoidance.
An alternative method for avoiding deadlocks is to require additional information about how
resources are to be requested. Each request requires the system consider the resources
currently available, the resources currently allocated to each process, and the future requests
and releases of each process, to decide whether the could be satisfied or
must wait to avoid a possible future deadlock.
24 Differences between a Process and Thread. ( APRIL/MAY 2021)
Process Thread
Process is a heavy weight process Thread is a lightweight process
Process switching needs interface with Thread switching does not need to call an
operating System. Operating system and cause an interrupt
to the kernel
In multiple processes, implementation of All thread can share same set of open files,
each process executes the same code buthas child process
its own memory and file resources
If one server process is blocked, no other When one server thread is blocked, second
server process can execute until the first thread in the same task could run.
process is unblocked
In multiple process each process One thread can read write or completely
operates independently of the others wipe out another thread stack.
25 What are the benefits of synchronous and asynchronous communication?(Apr/May2018)
 Interfaces for the O.S that enable I/O devices to be treated in a standard, uniformway.
 I/O system calls encapsulate device behaviors in generic classes
 Device-driver layer hides differences among I/O controllers from I/O subsystemof
the kernel
 Devices vary in many dimensions
o Character-stream or block
o Sequential or random-access
o Synchronous or asynchronous
o Sharable or dedicated
o Speed of operation
26 Give an programming example in which multithreading does not provide better performance
than a single threaded solutions.( Apr/May 2018)
Any kind of sequential program is not a good candidate to be threaded. An example of this is
a program that calculates an individual tax return. Another example is a ―shell‖ program
such as the C-shell or Korn shell. Such a program must closely monitor its own working
space such as open files, environment variables, and current working directory.

St. Joseph’s College of Engineering Page 9 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
27 Can a multithreaded solution using multiple user-level threads achieve better performance on
a multiprocessor system than on a single processor system?(Nov/Dec’18)
A multithreaded system comprising of multiple user-level threads cannot make use of the
different processors in a multiprocessor system simultaneously. Consequently, there is no
performance benefit associated with executing multiple user-level threads on a
multiprocessor system.
28 “Priority inversion is a condition that occurs in real time systems where a low priority
is starved because higher priority processes have gained hold of the CPU” – Comment on this
statement. (April 2017)
Priority inversion can occur without causing immediate harm—the delayed execution of the
high priority task goes unnoticed, and eventually the low priority task releases the shared
resource. However, there are also many situations in which priority inversion can cause
serious problems. If the high priority task is left starved of the resources, it might lead to a
system malfunction.
Priority inversion can also reduce the perceived performance of the system. Low priority
tasks usually have a low priority because it is not important for them to finish promptly.
Similarly, a high priority task has a high priority because it is more likely to be subject to
strict time constraints—it may be providing data to an interactive user, or acting subject to
real time response guarantees.
29 Distinguish between CPU bounded and I/O bounded process (Nov 2016) (Apr 2022)
The CPU-bound process will get the CPU and hold it. During this time, all the other
processes will finish their I/O and move into the ready queue, waiting for the CPU. While
the processes wait in the ready queue, the I/O devices are idle. Eventually, the CPU-bound
process finishes its CPU burst and moves to an I/O device. All the I/O- bound processes,
which have very short CPU bursts, execute quickly and moves back to the I/O queues. At
this point, the CPU sits idle. The CPU-bound process will then move
back to the ready queue and be allocated the CPU.
30 Differentiate single threaded and multi- threaded processes (April 2017)
Multithreaded Programming Single Threaded Programming
In this type of programming multiplethreads In this type of programming a singlethread
run at the same time runs at a time.
Multithreaded model doesn‘t use eventloop Single threaded model uses a processevent
with polling loop with polling
CPU time is never wasted. CPU time is wasted.
Idle time is minimum. Idle time is more.
It results in more efficient programs. It results in less efficient programs.
When one thread is paused due to some When one thread is paused, the systemwaits
reason, other threads run as normal. until this thread is resumed.
31 Difference between pre-emptive and non pre-emptive scheduling? (Nov 2014)
Non-preemptive is designed so that once a process enters the running state (is allowed a
process), it is not removed from the processor until it has completed its service time (or it
explicitly yields the processor).
Preemptive scheduling is driven by the notion of prioritized computation. The process with
the highest priority should always be the one currently using the processor. If a process is
currently using the processor and a new process with a higher priority enters, the ready list,
the process on the processor should be removed and returned to the
ready list until it is once again the highest-priority process in the system.

St. Joseph’s College of Engineering Page 10 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
32 What is busy waiting.(Nov/Dec’18) ( Dec 2021)
Busy waiting means that a process is waiting for a condition to be satisfied in a tight
loop without relinquishing the processor.

33 Give the queuing diagram representation of process scheduling.(May 2019)

34 What are the differences between user level threads and kernel level threads? Under
what circumstances is one type better that the other?(Nov 2015) (April 2016)
User Level Threads Kernel Level Threads
Threads that run user programs and Threads that runs the kernel operations
applications are user level threads and kernel programs are called as kernellevel
threads
User threads are supported above the kernel threads are supported and
kernel and are managed without kernel managed directly by the operating system.
support
In one-one thread model, user thread requires creating the corresponding kernel
thread. Because the overhead of creating kernel threads can burden the performance
of an application
In many-one thread model developers can create as many user threads as
necessary, and the corresponding kernel threads can run in parallel on a
multiprocessor.
PART-B
1 What is the need for process synchronization? Explain critical section problem with a
two process. Discuss about Petersons solution for two process
2 i. What is a race condition? Explain how a critical section avoids this condition.
ii. Discuss about hardware Synchronization and Write the algorithm using test and set
instruction that satisfy all the critical section requirements(May 2019)
3 i. Give a solution for readers writers problem using conditional critical region
ii. Discuss about producer Consumer Problem and suggest a solution for this.
4 Discuss about the problems in solving Dining Philosopher problem using semaphore and
how will you solve the above problem using monitors

5 Describe the difference among short-term, medium-term and long-term schedulingwith


suitable example. (April 2018)

St. Joseph’s College of Engineering Page 11 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
6 i) Draw the state diagram of a process from its creation to termination, including ALL
transitions, and briefly elaborate every state and every transitions (Nov 2014)
ii) What are threads? Why are they required? Discuss and differentiate between kernel
level and user level thread (Nov 2014)
7 i) Consider the following set of processes, with the length of the CPU-burst time
given in milliseconds: (May 2019)
Process Burst Time Priority Arrival Time
P1 10 3 0
P2 1 1 1
P3 2 3 2
P4 1 4 1
P5 5 2 2
Draw the Gantt chart for the execution of these processes using FCFS, SJF, SRTS, pre-emptive
and non-preemptive priority , Round Robin with time slice of 2 ms. Find the average waiting
and turnaround time using each of the methods.
ii) Compare and contrast preemptive and non-preemptive scheduling
8 Consider the following set of processes, with the length of the CPU-burst time given in
milliseconds: ( Apr 2018) ( Apr 2022)
PROCESS BURST PRIORITY ARRIVAL
TIME
P1 10 3 0
P2 1 1 1
P3 2 3 2
P4 1 4 3
P5 5 2 4

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
a. Draw four Gantt charts illustrating the execution of these processes using FCFS,
SJF(preemptive & non-premptive), priority (preemptive & non-premptive) (a smaller
priority number implies a higher priority), and RR (quantum = 2) scheduling.
b. Find the average waiting time and turnaround time using each of the methods.
c. Which results in the minimal average waiting time (over all
processes)?
9 Consider the following snapshot of a system(May 2019)(Apr 2022 ) (Dec 2021)
Process Allocation Max Available
A B C D A B C D A B C D
P0 2 0 0 1 4 2 1 2 3 3 2 1
P1 3 1 2 1 5 2 5 2
P2 2 1 0 3 2 3 1 6
P3 1 3 1 2 1 4 2 4
P4 1 4 3 2 3 6 6 5
Answer the following question using Banker‘s algorithm
(i) Illustrate that the system is in safe state by demonstrating an order in which the processes
may complete.
(ii) If a request from a process P1 arrives for (1,1,0,0) , Can the request be granted
immediately?
(iii) If the request from P4 arrives for (0,0,2,0) , Can the request be granted immediately

St. Joseph’s College of Engineering Page 12 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
10 What is a Deadlock? How does a deadlock occur? How can a system recover from
deadlock?

11 i. Discus the methods for Handling Deadlocks


ii. Explain in detail about deadlock avoidance and detection algorithm ( Dec 2021)
12 i. Discuss about various necessary conditions for deadlock
ii. Explain Banker‘s Algorithm in detail. ( Apr 2022)
iii. Write short notes on Resource-Allocation Graph.

13 Consider the following snapshot of a system(May 2019)(Apr 2022 ) (Dec 2021)

Process Allocation Max Available


A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2

P1 2 0 0 3 2 2

P2 3 0 2 9 0 2
P3 2 1 1 2 2 2

P4 0 0 2 4 3 3

Answer the following question using Banker‘s algorithm


(i) Illustrate that the system is in safe state by demonstrating an order in
which the processes may complete.
(ii) If a request from a process P4 arrives for (3,3,0) , Can the request be granted
immediately?
(iii) If the request from P0 arrives for (0,2,0) , Can the request be granted
immediately
UNIT III STORAGE MANAGEMENT
Main Memory- Background, Swapping, Contiguous Memory Allocation, Paging Segmentation ,
Segmentation with paging, 32 and 64 bit architecture Examples; Virtual Memory- Background,
Demand Paging, need for Page Replacement, Page Replacement algorithms, Allocation, Thrashing;
Allocating Kernel Memory, OS Examples.
PART-A
1 Define logical address and physical address. (April 2016)
An address generated by the CPU is referred as logical address. An address seen by thememory
unit that is the one loaded into the memory address register of the memory is
commonly referred to as physical address.
2 What is logical address space and physical address space?
The set of all logical addresses generated by a program is called a logical address space; the
set of all physical addresses corresponding to these logical addresses is a physical
address space.
3 Why are the page sizes always power of 2? (Nov 2016)
The paging is implemented by breaking up an address into a page and offset number. It is
most efficient to break the address into X page and Y offset bits, rather than perform
arithmetic on the address to calculate the page number and offset. Because each bit position
represents a power of 2, splitting an address between bits results in a page size that is a power
of 2.

St. Joseph’s College of Engineering Page 13 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
4 What are overlays?
To enable a process to be larger than the amount of memory allocated to it, overlays are used. The
idea of overlays is to keep in memory only those instructions and data that are needed at a
given time. When other instructions are needed, they are loaded into
space occupied previously by instructions that are no longer needed.
5 Define swapping. (APRIL/MAY 2021)
A process needs to be in memory to be executed. However a process can be swapped
temporarily out of memory to a backing store and then brought back into memory for
continued execution. This process is called swapping.
6 What are the common strategies to select a free hole from a set of available holes?
The most common strategies are First fit, Best fit, Worst fit
7 What do you mean by best fit?
Best fit allocates the smallest hole that is big enough. The entire list has to be searched,
unless it is sorted by size. This strategy produces the smallest leftover hole.
8 What do you mean by first fit?
First fit allocates the first hole that is big enough. Searching can either start at the
beginning of the set of holes or where the previous first-fit search ended. Searching canbe
stopped as soon as a free hole that is big enough is found.
9 What do you mean by frames and pages?
Physical memory is broken into fixed size blocks called frames. Logical address is also
broken into blocks of same size called pages.
10 Define Page table
The page table contains the base address of each page in physical memory. This base
address is combined with the page offset to define the physical memory address that issent to
the memory unit. The page number is used as an index into the page table.
11 What is virtual memory? (Apr 2022)
Virtual memory is a technique that allows the execution of processes that may not be
completely in memory. It is the separation of user logical memory from physical memory.
This separation provides an extremely large virtual memory, when only a
smaller physical memory is available.
12 Consider the following segmentation table(May 2019)
Segment Base Length
0 219 600
1 2300 14
2 90 100
3 1327 580
4 1952 96

What are the physical addresses for the logical addresses 3400 and 0110?

Physical addresses for the logical addresses 3400 is 1727 and 0110 is 329
13 Will optimal page replacement algorithm suffer from Belady’s anomaly? Justify your
answer. (April 2017)
Optimal page replacement algorithm does not suffer from Belady‘s anomaly. Because optimal
page replacement algorithm follows the stack property. It replaces the page that will not be
used for the longest time. Belady's anomaly occurs when a page- replacement algorithm evicts
a page that will be needed in the immediate future.

St. Joseph’s College of Engineering Page 14 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
14 Define Segmentation?
Segmentation is a memory management scheme that supports the user view of memory.
Logical address space is a collection of segments. Each segment has a name and length.
15 Define External Fragmentation?( Apr/May 2018) ( Dec 2021)
External fragmentation is occurs when all blocks of free memory are too small to
accommodate a segment. Segmentation may cause external fragmentation.
16 What is Demand paging? (Nov 2015)
Virtual memory is commonly implemented by demand paging. In demand paging, the pager
brings only those necessary pages into memory instead of swapping in a whole process.
Thus it avoids reading into memory pages that will not be used anyway,
decreasing the swap time and the amount of physical memory needed.
17 Define lazy swapper.
Rather than swapping the entire process into main memory, a lazy swapper is used. A
lazy swapper never swaps a page into memory unless that page will be needed.
18 What is a pure demand paging?
When starting execution of a process with no pages in memory, the operating system sets the
instruction pointer to the first instruction of the process, which is on a non- memory resident
page, the process immediately faults for the page. After this page is brought into memory, the
process continues to execute, faulting as necessary until every
page that it needs is in memory. At that point, it can execute with no more faults.
19 Define effective access time.
Let p be the probability of a page fault (0<p<1). The value of p is expected to be close to 0,
that is there will be only a few page faults. Effective access time = (1-p) * ma + p * page fault
time where ma : memory access time.

20 What are the major problems to implement demand paging?


The two major problems to implement demand paging is developing - Frame allocation
algorithm, Page replacement algorithm.
21 What are the counting based page replacement algorithm?(April 2018)
Counting sort is an algorithm for sorting a collection of objects according to keys that are
small integers; that is, it is an integer sorting algorithm. It operates by counting the number of
objects that have each distinct key value, and using arithmetic on those counts to determine
the positions of each key value in the output sequence.
22 What is the basic approach of page replacement?
If no frame is free is available, find one that is not currently being used and free it. A frame
can be freed by writing its contents to swap space, and changing the page table to indicate
that the page is no longer in memory. Now the freed frame can be used to hold the page for
which the process faulted.
23 What do you mean by “Thrashing”? (April 2015) (April 2016)
Thrashing – A high paging activity. Consider a process not having enough frames. This
raises to page fault and an active page is selected as victim. This again produces quick Page
Fault again and again. It can be avoided using working set strategy.
24 Define Paging
Paging is a scheme that allows the logical address space of a process to be non- contiguous.
Paging avoids the considerable problem of fitting the varying sized memory chunks onto
the backing store.

St. Joseph’s College of Engineering Page 15 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
25 What is the resident set and working set of the process? (Nov 2014)
Resident set is that portion of the process image that is actually in real-memory at a
particular instant. Working set is that subset of resident set that is actually needed for
execution.
26 List the steps needed to perform page replacement? (Nov 2014) (Nov 2015)
The steps required to perform page replacement are:
 Find out which page is to be removed from the memory
 Perform an operation of page-out.
 Perform an operation page-in.
27 What is thrashing and how to resolve this problem?(May 2019)( APRIL/MAY 2021)
Thrashing occurs when computer virtual memory resources are overused. If a process does
not have enough pages, the page-fault rate is very high. This high paging activity is called
thrashing. A process is thrashing if it
spends more time paging than executing.
Steps to Resolve
Limit the effects of thrashing by using a local replacement algorithm. With local replacement, if
one process starts thrashing, it cannot steal frames from another process. To prevent
thrashing, we must provide a process with as many frames as it needs. The working-set
strategy starts by looking at how many frames a process is actually using. This approach
defines the locality
model of process execution.
28 Write down the need for page replacement. ( Apr 2022)
The steps required to perform page replacement are:
● Find out which page is to be removed from the memory
● Perform an operation of page-out.
● Perform an operation page-in.
29 What is the purpose of paging the page table? (Nov 2016) ( Dec 2021)
The page number is used as an index into a page table. The page table contains the base
address of each page in physical memory. This base address is combined with the page
offset to define the physical memory address that is sent to the memory unit.
30 What is the difference between a user-level instruction and a privileged instruction?
Which of the following instructions should be privileged and only allowed to executein kernel
mode? (April 2017)
a) Load a value from a memory address to a general-purpose register-Privileged
b) Set a new value in the program counter (PC) register- Privileged
c) Turn off interrupts- Privileged
Machines have two kinds of instructions 1. ―normal‖ instructions, e.g., add, sub, etc.
2. ―privileged‖ instructions, e.g., initiate I/O switch state vectors or contexts load/savefrom
protected memory.
PART-B
1 Explain various dynamic contiguous memory allocation using suitable example

2 Explain in detail about paging with suitable diagram (APRIL/MAY 2021)


3 Explain in detail about paging with TLB. with suitable diagram (Nov 2015) (April 2017)
4 Explain the basic concepts of segmentation with suitable diagram (April 2016) (Dec 2021)
5 Explain the basic concepts of Demand Paging and list the sequence of operations that occur when a
page fault is occurred. ( Apr 2022)
6 Explain the various structures to implement the page table. ( Apr 2022)

St. Joseph’s College of Engineering Page 16 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
7 Explain why sharing a re-entrant module is easier when segmentation is used than
when pure paging is used with example. (April 2018)
8 Write in detail about (Dec 2021)
i) Virtual memory.
ii) Memory mapped files
iii) Hardware Address Protection
9 Consider the following page reference string: 1 2 3 2 5 6 3 4 6 3 7 3 1 5 3 6 3 4 2 4 3 4 5 1 Indicate
page faults and calculate total number of page faults and successful ratio for FIFO, Optimal
and LRU, LFU, MFU, Algorithms. Assume there are four frames and initially all frames are
empty.
10 i)Explain the global and local frame allocation algorithms and their pros and cons. (Apr 2022)
ii) Consider the following page reference s tring. 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6
How many page faults would occur for the following replacement algorithms, assuming 1
and 3 free frames. Remember that all frames are initially empty so that first unique page
request will all cost one fault each. LRU replacement, FIFO, Optimal replacement, LRU, LFU
and MFU.
11 (i) Describe about free space management on I/O buffering and blocking (April 2017)
ii)Discuss the concept of buddy system allocation with neat sketch (April 2017)
12 i. Explain in detail about swapping and thrashing. (Nov 2019)
ii. Explain in detail about paging in 32 bit and 64 bit architectures
13 Discuss situation under which the most frequently used page replacement algorithmgenerates
fewer page faults than the least recently used page replacement algorithm.
Also discuss under which circumstance the opposite holds.(April 2018) (Dec 2021)
14 i) Consider a computer system with 16 bit logical address and 4 KB page size. The system
supports upto 1 MB of physical memory. Assume that the actual process size is only 33 KB,
page table base register contains 1000, and free frame list contains 13,11,9,7,5,3,1,2,4,6,8.
Construct the physical and logical memory structures, page table of the corresponding process.
Find the physical address of 13,256 and another logical address with page number 2 and
offset of 128. Discuss about the possible valid-invalid bit and possible protection bits in page
table. (8) (May 2019)
ii) Consider a paging system with page table stored in memory.(May 2019)
(1) If a memory reference takes 50 ns, how long does a paged memory reference take?
If we add TLB and 75% of all page table references are found in TLB, what is the effective
memory reference time? (Assume that find a page entry in TLB takes 2 ns, if entry is
present) (5)
15 i. Explain the difference between internal and external fragmentation (Nov 2016)
Briefly explain Slab allocator
UNIT IV FILE SYSTEMS AND I/O SYSTEMS
Mass Storage system- Overview of mass storage structure, Disk Structure ,Disk Scheduling and
Management, swap space management; File System Interface- File Concepts, Access methods,
Directory Structure, Directory organization, File Sharing and Protection; File System
Implementation- File System Structure, Directory implementation, Allocation Methods, Free Space
Management, Efficiency and Performance, Recovery; I/O Systems – I/O Hardware, Application
I/O interface, Kernel I/O subsystem, Streams, Performance.
PART-A
1 Define rotational latency (May 2013) and seek time (May 2012)
Rotational latency - additional time waiting for the disk to rotate the desired sector to the
disk head. Seek time - time for the disk arm to move the heads to the cylinder containing the
desired sector.
St. Joseph’s College of Engineering Page 17 of 26
CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
2 Define disk bandwidth
The disk bandwidth - total number of bytes transferred, divided by the time between the
first request for service and the completion of the last transfer.
3 What is the need for disk scheduling algorithm? (Nov 2012)
The disk-scheduling algorithms focus primarily on minimizing the amount of disk head
movement in magnetic disk drives.
4 Give the importance of swap-space management. (Nov 2012)
Swap-space management is another low-level task of the operating system. Virtual memory
uses disk space as an extension of main memory. Since disk access is much slower than
memory access, using swap space significantly decreases system performance. The main
goal for the design and implementation of swap space is to
provide the best throughput for the virtual memory system.
5 What is a file? List the various file attributes and operations. (Apr 2022)(Nov 2018) (APRIL/MAY
2021)
A file is a named collection of related information that is recorded on secondary storage.A file
contains either programs or data. A file has certain ―structure‖ based on its type.
 File attributes: Name, identifier, type, size, location, protection, time, date
 File operations: creation, reading, writing, repositioning, deleting,
truncating, appending, renaming
 File types: executable, object, library, source code etc.
6 What is the information associated with an open file? ( Dec 2021)
Several pieces of information are associated with an open file which may be:
 File pointer - pointer to last read/write location, per process that has the file open
 File-open count - counter of number of times a file is open – to allow removal ofdata
from open-file table when last processes closes it
 Disk location of the file - cache of data access information
 Access rights - per-process access mode information
7 What is the use of boot block?
For a computer to start running when powered up or rebooted it needs to have an initial
program to run. This bootstrap program tends to be simple. It finds the operating system on
the disk loads that kernel into memory and jumps to an initial address to begin the operating
system execution. The full bootstrap program is stored in a partition called the boot blocks, at
fixed location on the disk. A disk that has boot partition is
called boot disk or system disk.
8 Define File system mounting (May 2019) ( APRIL/MAY 2021)
A file system must be mounted before it can be accessed or it can be available to processes on
the system. OS is given the name of the device, and the location within the file structure at
which to attach the file system is called mount point.
9 What are the various layers of a file system?
The file system is composed of many different levels. Each level in the design uses the feature
of the lower levels to create new features for use by higher levels. Application programs,
Logical file system, File-organization module, Basic file system, I/O control, Devices
10 What are the functions of virtual file system (VFS)?
It has two functions
 It separates file-system-generic operations from their implementation defining a clean VFS
interface. It allows transparent access to different types of file systems mounted locally.
 VFS is based on a file representation structure, called a v node. It contains a numerical
value for a network-wide unique file .The kernel maintains one v node
structure for each active file or directory.
St. Joseph’s College of Engineering Page 18 of 26
CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
11 Define Network File System
On distributed systems, files may be shared across a network. Network File System(NFS)
is a common distributed file-sharing method.
12 What is Distributed Information Systems?
Distributed information systems known as distributed naming services, provide unified access to
the information needed for remote computing to make client – server systems easier to manage.
13 What are the different accessing methods of a file?
 Sequential access: Information in the file is accessed sequentially
 Direct access: Information in the file can be accessed without any particularorder.
 Other access methods: Creating index for the file, indexed sequential accessmethod
(ISAM) etc.
14 Define FCB. ( Dec 2021)
File Control Block (FCB) – storage structure consisting of information about a file

15 What is consistency semantics in file sharing?


Consistency semantics specify how multiple users are to access a shared file
simultaneously and should specify when modifications of data by one user are
observable by other users.
16 Define spooling.
A spool is a buffer that holds output for a device, such as printer, that cannot accept
interleaved data streams. When an application finishes printing, the spooling system queues
the corresponding spool file for output to the printer. The spooling system
copies the queued spool files to the printer one at a time.
17 List the various ways to maintain free space in the memory.
 Linked list:
 Bit vector
 Grouping
 Counting
18 A disk has 2310 cylinders, 16 tracks and 63 sectors. The disk spins at 7200 rpm. Seek time
between adjacent tracks is 1ms. How long does it take to read the entire disk?(Nov 2015)

Bytes per cylinder ,b=512bytes*63sectors*16tracks=516096 bytes


Rotation Speed=7200 rotations per minute
(1minute /7200 rotations)*(60 seconds/1minute)=60 seconds/7200 rotations=8.33ms
Seek time=1ms
Disk has 63 sectors per track ,performs rotation in 8.33ms.

Thus transfer time, x =(16/63)*8.33ms=2.11ms


tread, Total time to read 16 tracks in the disk=8.33+1 ms=9.33ms

St. Joseph’s College of Engineering Page 19 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
19 What are the different I/O registers?
Status register – contain bits that can be read by host,
Control register – can be written by the host to start a command or to change the modeof a
device
Data-in register – is read by the host to get input
Data-out register – is written by the host to send
20 Compare bitmap-based allocation of blocks on disk with a free block list. (Nov 2014)
Bitmap-based allocation - each block is represented by 1 bit. If the block is free, the bit is 1; if
the block is allocated, the bit is 0. The main advantage of this approach is its relative
simplicity and its efficiency in finding the first free block or n consecutive free blocks on the
disk. Indeed, many computers supply bit-manipulation instructions that can be used
effectively for that purpose.
Free block list - link together all the free disk blocks, keeping a pointer to the first free
block in a special location on the disk and caching it in memory. This first block contains a
pointer to the next free disk block, and so on. This scheme is not efficient; to traverse the list, we
must read each block, which requires substantial I/O time.
21 What is an I/O buffer? (Nov 2014) / Define buffering.
A buffer is a memory area that stores data while they are transferred between two
devices or between a device and an application. Buffering is done for three reasons
o To cope with a speed mismatch between the producer and consumer of a data
stream
o To adapt between devices that have different data-transfer sizes
o To support copy semantics for application I/O
22 Compare Character device and block device.
Block devices include disk drives
- Understands commands include read(), write(), seek()
- Raw I/O or file-system access (simple linear array of blocks)
- Memory-mapped file access possible
- layered on top of block-device derivers
- same mechanism as demand-paged virtual-memory access
Character devices include keyboards, mice, serial ports
- Commands include get(), put()
- Libraries layered on top allow line editing
23 What is blocking and non-blocking I/O?
Blocking I/O- process suspended until I/O completed
- Easy to use and understand
- Insufficient for some needs
Non-blocking I/O - I/O call returns as much as available
- User interface, data copy (buffered I/O)
- Eg. User interface receives keyboard and mouse i/p while processing and
displaying data on the screen
- Returns quickly with count of bytes read or written
24 State the typical bad sector transactions.(April 2018)
A bad sector is an unusable part or subdivision within a track on a magnetic or optical disc
located on a computer's hard disk or flash drive. It typically forms as a result of physical
damage or, rarely, the operating system's (OS) inability to access the
information.

St. Joseph’s College of Engineering Page 20 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
25 Define SAN.
SAN – Storage Area Network is a private network among the servers and storageunits.
It is common in large storage environments (and becoming more common). Here
multiple hosts are attached to multiple storage arrays .
26 What is HSM? Where it is used? (April 2015)
Hierarchical storage management (HSM) is a data storage technique, which automatically
moves data between high-cost and low-cost storage media. HSM systems exist because high-
speed storage devices, such as hard disk drive arrays, are more expensive (per byte stored)
than slower devices, such as optical discs and magnetic tape drives. While it would be ideal to
have all data available on high-speed devices all the time, this is prohibitively expensive for
many organizations.
27 Why is rotational latency usually not considered in disk scheduling?(April 2016)
Most disks do not export their rotational position information to the host. Even if they did,
the time for this information to reach the scheduler would be subject to imprecision and the
time consumed by the scheduler is variable, so the rotational position information would
become incorrect. Further, the disk requests are usually given in terms of logical block
numbers, and the mapping between logical blocks and physical
locations is very complex.
28 What is meant by free space management? (Nov 2012)( Apr 2022)

Free-Space Management
 Since disk space is limited, we need to reuse the space from deleted files for newfiles,
if possible.
 To keep track of free disk space, the system maintains a free-space list. The free-space
list records all free disk blocks.
 To create a file, we search the free-space list for the required amount of space and
allocate that space to the new file.
When a file is deleted, its disk space is added to the free-space list.
29 Identify the 2 important functions of Virtual file System layer in the concept of
system implementation.(Nov 2015)
The VFS layer serves two important functions:
 It separates file-system-generic operations from their implementation by defining a
clean VFS interface. Several implementations for the VFS interface may coexist on the
same machine, allowing transparent access to different types of file systems mounted
locally.
 It provides a mechanism for uniquely representing a file throughout a network. The
VFS is based on a file-representation structure, called a vnode, that contains a
numerical designator for a network-wide unique file.
30 What is SSD?(May 2019)
An SSD is nonvolatile memory that is used like a hard drive. SSDs have the same
characteristics as traditional hard disks but can be more reliable because they have no moving
parts and faster because they have no seek time or latency. It consumes less power. It is more
expensive per megabyte than traditional hard disks, have less capacity than the larger hard
disks and may have shorter life spans than hard disks. So their uses are limited. One use for
SSDs is in storage arrays, where they hold file-system metadata that require high performance.
SSDs are also used in some laptop computers to make them smaller, faster and more energy
efficient.

St. Joseph’s College of Engineering Page 21 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
31 Define c-scan scheduling (Nov 2016)
Circular SCAN (C-SCAN) scheduling is a variant of SCAN designed to provide a more
uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the
other, servicing requests along the way. When the head reaches the other end, however, it
immediately returns to the beginning of the disk, without servicing any requests on
the return trip.
32 Do FAT file system advantageous? justify your answer.(Nov 2018)
The main advantage of FAT is its efficient use of disk space. FAT can place the parts ofthe
file wherever they fit. File names can be up to 255 characters and file extensions
longer than 3 characters. Easy to recover file names that have been deleted.
33 Why is it important to scale up system bus and device speed as CPU speed increases?
(Nov 2016)
Consider a system which performs 50% I/O and 50% computes. Doubling the CPU
performance on this system would increase total system performance by only 50%. Doubling
both system aspects would increase performance by 100%. Generally, it is important to
remove the current system bottleneck, and to increase overall system performance, rather
than blindly increasing the performance of individual system
components.
PART-B

1 Explain the various disk scheduling algorithms with examples. (April


2018) (Apr 2022) (Dec 2021)
2 i) What is disk management? Explain in detail how to improve the disk performance.
(Nov 2014)(May 2019)
ii) Describe three circumstances under which blocking I/O should be used. Describe three
under which nonblocking I/O should be used. Why not just implement nonblocking I/O and
have processes busy-wait until their device is ready? (Nov 2014)
3 What are files and explain the access methods for files? (April 2011) (April 2017) (APRIL/MAY
2021)
4 i) Explain about file protection and sharing. (April 2011)
ii) Explain about directory implementation.
5 i) Discuss the different techniques with which a file can be shared among differentusers.
(Nov 2014) (April 2017)
ii) Write short notes on Streams.
6 Explain the different file allocation methods for disk space. Mention their advantages
and disadvantages.(May 2019) ( Apr 2022) (Dec 2021)
7 i) Explain the issues in designing a file system.
ii) Explain the various directory structures. (Nov 2012) (April 2017)
8 Write in detail about layered file system.
Write short notes on I/O on Linux.
9 Explain the various methods for free space management.
10 i. With a diagram discuss about the tree structured directory structure (APRIL/MAY 2021)
ii. Explain the Step Process to Perform DMA Transfer with neat Diagram
11 i) Explain about interrupts and interrupt-driven I/O cycle
ii) Explain how to transform I/O to hardware operations with necessary diagram.
iii) Discuss the performance of I/O system.

St. Joseph’s College of Engineering Page 22 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
12 (i) Explain about kernel I/O subsystem and transferring I/O to hardware operations (Nov
2012) (April 2017)
(ii) What optimization were used to minimize the discrepancy between CPU and I/O
speeds on early computer systems.(April 2018)
13 i)Write a detailed note on indexed memory allocation. (7)
ii) Explain the components of kernel I/O structure with a diagram. (6) (APRIL/MAY 2021)
14 Suppose that a disk drive has 1000 cylinders, numbered from 0 to 999. The drive is currently serving
a request at cylinder 160. The queue of pending requests, in FIFO order is 86, 913, 240, 645, 130, 948,
750, 325. Starting from the current head position, what is the total distance (in cylinders) that the
disk arm moves to satisfy all the pending requests for each of the following disk scheduling
algorithms. ( a) FCFS b) SSTF c) SCAN d)LOOK e) CSCAN f)CLOOK
Explain the pros and cons of all disks scheduling algorithms. (APRIL/MAY 2021)
15 Suppose that the disk drive has 5,000 cylinders, numbered from 0 to 4999. The drive is currently
serving a request at cylinder 143. The queue of pending requests in FIFO Order is
86,1470,913,1774,948,1509,1022,1750,130. Starting from the head position what is the total distance
(in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following
disk scheduling algorithms? FCFS, SSTF, SCAN, LOOK, C-SCAN, C-LOOK.
Explain the pros and cons of all disks scheduling algorithms. (May 2019)
UNIT V CASE STUDY
Linux System - Design Principles, Kernel Modules, Process Management, Scheduling, Memory
Management, Input-Output Management, File System, Inter-process Communication; Mobile OS
- iOS and Android - Architecture and SDK Framework, Media Layer, Services Layer, Core OS
Layer, File System.
PART-A
1 What is Linux?
It is a multiuser, preemptively multitasking system with a full set of UNIX-compatibletools.
Linux resembles other traditional, non-microkernel UNIX implementations.
2 List the responsibilities of kernel. (April/May 2015)
The kernel is responsible for maintaining all the important abstractions of the operating
system, including virtual memory and processes.
3 What are the components of Linux system?(April 2016) ( Apr 2022)
Kernel - Kernel is the core part of Linux. System Library - System libraries are special functions
or programs using which application programs or system utilities accesses Kernel's
features.System Utility - System Utility programs are responsible to do
specialized, individual level tasks.
4 Define Linux distribution. ( Dec 2021)
Linux distribution includes, all the standard components of linux system and a set of
administrative tools to simplify the initial installation and subsequent upgrading oflinux
and to manage installation and removal of other packages on the system.
5 Kernel modules are convenient. Why?
The Linux kernel has the ability to load and unload arbitrary sections of kernel code on
demand.
 These loadable kernel modules run in privileged kernel mode and as a consequence
have full access to all the hardware capabilities of the machine on which they run.
 Linux‘s source code is free, so anybody wanting to write kernel code is able to
compile a modified kernel and to reboot into that new functionality.
6 List the components of kernel modules.
Module management system, Module loader and un loader, Driver registration system,
Conflict resolution mechanism
St. Joseph’s College of Engineering Page 23 of 26
CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
7 List and discuss about process environments null terminated vectors?
A process‘s environment is inherited from its parent and is composed of two null-
terminated vectors: the argument vector and the environment vector. The argument vector
simply lists the command-line arguments used to invoke the running program; it
conventionally starts with the name of the program itself. The environment vector is a list of
―NAME=VALUE‖ pairs that associates named environment variables with arbitrary textual
values
8 What is Process Context?
The process identity and environment properties are usually set up when a process is created
and not changed until that process exits. A process may choose to change some aspects of its
identity if it needs to do so, or it may alter its environment. In contrast, process context is the
state of the running program at any one time; it changes constantly. Process context includes
the following parts: Scheduling context, Accounting, File table, Signal-handler table,
Virtual memory context, File-system context.
9 What is journaling?
The ext3 file system supports a popular feature called journaling, where modifications to the
file system are written sequentially to a journal. A set of operations that performs a specific
task is a transaction. Once a transaction is written to journal, it is considered to be committed.
Meanwhile, the journal entries relating to the transaction are replayed across the actual file-
system structures. As the changes are made, a pointer is updated to indicate which actions
have completed and which are incomplete. When transaction
is completed, it is removed from the journal.
10 What are the different physical memory separation done by Linux system?
Due to specific hardware constraints, Linux separates physical memory into four different
zones, or regions: ZONE DMA ,ZONE DMA32, ZONE NORMAL, ZONE HIGHMEM .These
zones are architecture specific.
11 What are the different slab state in Linux ?
In Linux, a slab may be in one of three possible states: Full- All objects in the slab are marked as
used. Empty-All objects in the slab are marked as free. Partial-The slab consists of both used
and free objects.
12 What are the Locking Mechanisms provided by Linux kernel.
The Linux kernel provides spinlocks and semaphores for locking in the kernel. On SMP machines,
the fundamental locking mechanism is a spinlock, and the kernel is designedso that spinlocks
are held for only short durations. On single-processor machines, spinlocks are not appropriate
for use and are replaced by enabling and disabling kernel preemption. That is, rather than
holding a spinlock, the task disables kernel preemption. When the task would otherwise release
the spinlock, it enables kernel preemption.
Linux uses an interesting approach to disable and enable kernel pre-emption.
It provides two simple kernel interfaces preempt disable() and preempt enable().
13 What is the use of fork( ) and exec( ) ? (APRIL/MAY 2021)
The fork is used to create a new process by duplicating the calling process. The new process is the
child process. The fork() returns the PID of the child process. If the value is non-zero, then it is
parent process’s id, and if this is 0, then this is child process’s id.
The exec() system call is used to replace the current process image with the new process image. It
loads the program into the current space, and runs it from the entry point.

St. Joseph’s College of Engineering Page 24 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
14 What is the role of driver registration in Linux.(May 2019) ( Apr 2022)
The driver registration system allows modules to tell the rest of the kernel that a new driver
has become available. Once a module is loaded, it remains no more than an isolated region of
memory until it lets the rest of the kernel know what new functionality it provides. The
kernel maintains dynamic tables of all known drivers and provides a set of routines to allow
drivers to be added to or removed from these tables at any time. The kernel makes sure that it
calls a module‘s startup routine when that module is loaded and calls the module‘s cleanup
routine before that module is unloaded. These routines are responsible for registering the
module‘s functionality. A module may register many types of functionality. Registration
tables contains the following items:
Device drivers
File systems
Network protocols
Binary format
15 Name the four main object types of Virtual File System. (APRIL/MAY 2021)
The VFS defines four main object types:
 An inode object represents an individual file.
 A file object represents an open file.
 A superblock object represents an entire file system.
 A dentry object represents an individual directory entry. For each of these fourobject
types, the VFS defines a set of operations.
API for some of the file object‗s operations includes:int
open(. . .) — Open a file.
ssize t read(. . .) — Read from a file.
ssize t write(. . .) — Write to a file.
int mmap(. . .) — Memory-map a file.
16 List out the methods used to recover from the deadlock.(May 2019)
 Process termination
 Abort all deadlocked process
 Abort one process at a time until the deadlock cycle is eliminated
 Resource pre-emption
 Selecting a victim
 Rollback
 Starvation
17 Enlist the advantages of using kernel modules in Linux.
• Loading and unloading a module is much more flexible and faster than
recompiling a kernel and rebooting.
• It is possible to try different options each time when we load a module. Most
drivers that handle hardware will take options for I/O addresses, IRQ or DMA
numbers, plus more esoteric options like full or half duplex.
• Makes it easier to maintain multiple machines on a single kernel base.
18 List the advantages and disadvantages of writing an operating system in high level
language such as c.(April 2018)
The code can be written faster, is more compact, and is easier to understand and debug. In
addition, improvements in compiler technology will improve the generated code for the
entire operating system by simple recompilation. Finally, an operating system is far easier to
port — to move to some other hardware — if it is written in a higher-level language.

St. Joseph’s College of Engineering Page 25 of 26


CS1402- Operating Systems Department of CSE, IT, AI-DS &AI-ML 2022-2023
19 What is the difference between API and SDK? ( Dec 2021)
API is an interface that allows software programs to interact with each other, whereas An
SDK or devkit functions in much the same way, providing a set of tools, libraries, relevant
documentation, code samples, processes, and or guides that allow developers to create
software applications on a specific platform.
20 Mention any two features of Linux file systems.
• Files ystems share a core of common concepts and high-level operations
• Allowed long filenames (up to 255 chars)
• Applications interact with this VFS
• Kernel translates abstract-to-actual
UNIT-V / PART-B
1 Explain in detail about Linux Architecture a n d Linux Design principles with neat
sketch.
2
Write short note on LINUX Kernel and virtualization with neat sketch. (April 2017)

3 Explain traditional Unix process model and Linux‘s threading model in process
management? (Dec 2021)
4
Write notes on Linux process scheduling algorithms and its kernel synchronization.

5
Discuss the Process and Memory management in Linux.(May 2019)( Apr 2022)

6 i. How Linux process communicate and synchronize with other process?


ii. Explain Linux I/O systems.
7 Explain the architecture of iOS in detail. Discuss the media and service layers clearly. (May 2019) (
Apr 2022)
8
Brief Similarities and differences between iOS and android operating systems. (Dec 2021)

9 i)Discuss about the components of Android mobile OS architecture with SDK Framework. (7)
ii) Explain about how scheduling is handled in Linux system. (6) (APRIL/MAY 2021)
10 i)With a neat diagram explain the components of a Linux system. (7)
ii) Describe about inter process communication in Linux system.(6) (APRIL/MAY 2021)

St. Joseph’s College of Engineering Page 26 of 26

You might also like