Arunachala HiTech
CS 3451 Introduction to Operating System
UNIT 1
PART A
1. List the Services of operating system function.
o Program development
o Program execution
o User Interface
o I/O Operations
o File system Manipulation
o Communication
o Error Detection
o Resource allocation
o Accounting
o Security
2. Define system call.
System Call provides the interface between running program and
the OS. User can request any services from OS through System Call.
Categories of system call:-
File management
Process Management
Inter process Communication
I/O Device Management
Information Processing & Maintenance
3. What are the objectives of operating systems?
An OS is a program that controls the execution of application
programs and acts as an interface between applications and the computer
hardware.
Objectives of OS:
Convenience: An OS makes a computer more convenient to use.
Efficiency: An OS allows the computer system resources to be used in an
efficient manner.
4. What is an operating system?
An operating system is a program that manages the computer
hardware. it act as an intermediate between a user‘s of a computer and the
computer hardware. It controls and coordinates the use of the hardware
among the various application programs for the various users.
Arunachala HiTech
5. Mention the purpose of system calls.
System calls allow user-level processes to request services of the
operating system. If a file system requires the creation or
deletion of files.
Reading and writing from files also require a system call.
Creation and management of new processes.
Network connections also require system calls. This includes
sending and receiving packets.
Access to hardware devices such as a printer, scanner etc. requires
a system call.
PART B
1. Discuss in detail about the varies memory hierarchies with neat block
diagram.
2. Explain system calls, system programs and OS generation.
3. Explain the services of OS.
4. Explain the Structure of OS.
5. Explain the evolution of OS.
UNIT 2
PART A
1. Define Process?
A Process can be thought of as a program in execution. A process will need
certain resources such as CPU time, memory, files & I/O devices to
accomplish its task.
2. Draw & briefly explain the process states?[U] or Name and draw five
different process states with proper definition.
New- The process is being created.
Running – Instructions are being executed
Waiting – The process is waiting for some event to occur
Ready – The process is waiting to be assigned a processor
Terminated - the process has finished execution
3. What is a thread?
Arunachala HiTech
A thread otherwise called a lightweight process (LWP) is a basic unit of
CPU uti lization, it comprises of a thread id, a program counter, a register
set and a stack. It shares with otherthreads belonging to the same process its
code section, data section, and opera ting system resources such as open
files and signals.
4. What are the characterizations of deadlock? Or four conditions of deadlock
1. Mutual exclusion: only one process at a time can use a resource.
2. Hold and wait: a process holding at least one resource is waiting to
acquire additional resources held by other processes.
3. No preemption: a resource can be released only voluntarily by the
process holding it, after that process has completed its task.
4. Circular wait: there exists a set {P0, P1, …, P0} of waiting processes
such that P0 is waiting for a resource that is held by P1, P1 is waiting for a
resource that is held by P2, …, Pn–1 is waiting for a resource that is held
by Pn, and P0 is waiting for a resource that is held by P0.Deadlock can arise
if four conditions hold simultaneously.
5. Differentiate a Thread from a Process.
Threads Processes
Will by default share memory Will by default not share
Will share file descriptors memory
Will share file system context Most file descriptors not shared
Will share signal handling Don't share file system context
Don't share signal handling
6. What is critical section problem?
Consider a system consists of 'n' processes. Each process has segment of
code called a critical section, in which the process may be changing
common variables, updating a table, writing a file. When one process is
executing in its critical section, no other process can be allowed to execute
in its critical section.
7. Define mutual exclusion.
Mutual exclusion refers to the requirement of ensuring that no two
process or threads are in their critical section at the same time. i.e. If
process Pi is executing in its critical section, then no other processes can be
executing in their critical sections.
8. 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.
Arunachala HiTech
9. What is a resource-allocation graph?
Resource allocation graph is directed graph which is used to describe
deadlocks. 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.
10.What are the methods for handling deadlocks?
The deadlock problem can be dealt with in one of the three ways:
1. Use a protocol to prevent or avoid deadlocks, ensuring that the system
will never enter a deadlock state.
2. Allow the system to enter the deadlock state, detect it and then recover.
3. Ignore the problem all together, and pretend that deadlocks never occur
in the system.
PART B
(CPU Scheduling problem, deadlock-Bankers algorithm)
1. Consider the following set of processes, with the length of the CPU-
burst time in given ms:
Process Burst Time Arrival Time
P1 8 0.00
P2 4 1.001
P3 9 2.001
P4 5 3.001
P5 3 4.001
Draw four Gantt charts illustrating the execution of these processes using
FCFC,SJF, Priority and RR (Quantum=2) scheduling. Also calculate
waiting time and turnaround time for each scheduling algorithms
2. What is deadlock? What are the necessary conditions for deadlock to
occur? Explain the deadlock prevention method of handling deadlock.
Consider the following information about resources in a system.
(i) There are two classes of allocatable resource labeled R1 and R2
(ii) There are two instances of each resource
(iii) There are four processes labeled p1 through p4
(iv) There are some resource instances already allocated to processes as
follows:
Arunachala HiTech
One instance of R1 held by p2,another held by p3
One instance of R2 held of P1, another held by p4
(v) Some processes have required additional resources, as follows:
P1 wants one instance of R1
P3 wants one instance of R2
1. Draw the resource allocation graph for this system
2. What is the state (runnable, waiting) of each process ? For each process
that is waiting indicate what it is waiting for.
(vi)Is this system deadlocked? If so, state which processes are involved. If
not, give an execution sequence that eventually ends, showing resource
acquisition and release at each step.
2.(i) Explain banker algorithm for deadlock avoidance with suitable example.
(7)
(ii) A system has four processes and five resources. The current
allocation and maximum need are as follows
Consider value of x as 1,2,3.
What is the smallest value of x in which the above system become a safe state?
UNIT 3
PART A
1. Define swapping.
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.
2. Define demand paging.
A demand paging system is quite similar to a paging system with
swapping where processes reside in secondary memory and pages are loaded
only on demand, not in advance. When a context switch occurs, the operating
Arunachala HiTech
system does not copy any of the old program‘s pages out to the disk or any of
the new program‘s pages into the main memory.
3. What is thrashing? and how to resolve this problem?
In a virtual storage system (an operating system that manages its logical storage
or memory in units called pages), thrashing is a condition in which excessive
paging operations are taking place. A system that is thrashing can be perceived
as either a very slow system or one that has come to a halt. One of the
recommended ways to eliminate thrashing is to add more memory to main
memory. Another way of resolving the issue of thrashing is by adjusting the size
of the swap file.
4. Why page are sizes always powers of 2?
Recall that 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 bits and Y
offset bits, rather than perform arithmetic on the address to calculate the page
number and offset. Because each bit 25 26 position represents a power of 2,
splitting an address between bits results in a page size that is a power of 2.
5. Difference between internal and external fragmentation
Internal fragmentation is the area occupied by a process but cannot be used by
the process. This space is unusable by the system until the process release the
space.
External fragmentation exists when total free memory is enough for the new
process but it's not contiguous and can't satisfy the request. Storage is
fragmented into small holes.
6. What is virtual memory? Mention its advantages.
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.
The main visible advantage of this scheme is that programs can be larger than
physical memory.
PART B
(paging, page replacement algorithm)
1. With a neat diagram. discuss about a mechanism of paging scheme.
2. Explain in detail about page replacement algorithm with suitable
example.
3. Consider the following page reference string:
Arunachala HiTech
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 algorithms. Assume there are
four frames and initially all the frames are empty
UNIT 4
PART A
1. What is virtual memory? Mention its advantages.
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.
The main visible advantage of this scheme is that programs can be larger than
physical memory.
2. What are the various file operations?
The six basic file operations are:
Creating a file
Writing a file
Reading a file
Repositioning within a file
Deleting a file
Truncating a file
3. What are the different accessing methods of a file?
The different types of accessing a file are:
Sequential access: Information in the file is accessed
sequentially
Direct access: Information in the file can be accessed without any
particular order. Other access methods: Creating index for the file,
indexed sequential access method (ISAM),etc.
4. What is Directory?
The device directory or simply known as directory records information-such
as name, location, size, and type for all files on that particular partition. The
directory can be viewed as a symbol table that translates file names into their
directory entries.
5. Define buffering.
Arunachala HiTech
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
To cope with a speed mismatch between the producer and consumer of a
data stream
To adapt between devices that have different data transfer sizes
To support copy semantics for application I/O
6. Define caching.
A cache is a region of fast memory that holds copies of data. Access to the
cached copy is more efficient than access to the original. Caching and buffering are
distinct functions, but sometimes a region of memory can be used for both
purposes.
7. 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.
8. What is a file?
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.
9. What is a file system?
File system is a hierarchy of directories that is used to organize files on a
computer or storage media.
10.What is file system mounting?
File system mounting is defined as the process of attaching an additional file
system to the currently accessible file system of a computer.
11.What is file transparency?
Users can access file from any network or computer without knowing where
they are physically stores on the network is known as file transparency.
12.How OS manage free space?
File system is responsible to allocate free blocks to the files. Therefore, it has
to keep track of all the free blocks present in the disk. The two approaches are
Bit Vector
Linked List
Arunachala HiTech
PART B
(disk scheduling algorithm problem, file system, free space allocation,
directories)
1. Suppose that a disk drive has 200 cylinder, numbered 0 to 199. The work queue
is: 23,89,132,42,187. Determine the total distance for the following disk
scheduling algorithms
SCAN (ii) LOOK (iii) C-SCAN (iv) C-LOOK
Work Queue : 23,89,132,42,187
There are 200 cylinder numbered from 0 – 199
The disk head stars at number 100.
2. Describe in details about file system implementation and file allocation method.
3. What do you mean by directory structure? Also discuss Tree-Structure
Directories and Acyclic-Graph Directories.
4. Suppose that a disk drive has 5000 cylinders, numbered 0 through 4999. The
drive is 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.
UNIT 5
PART A
1. What is virtualization?
Virtualization, in computing, refers to the act of creating a virtual
(rather than actual) version of something, including but not limited to a
virtual computer hardware platform, operating system (OS), storage device,
or computer network resources.
2. Components of Virtual machine?
Trap & Emulate- VMM gives control to execute the action
attempted by guest and give back the control to virtual machine
Binary Transaction – translate binary instruction to binary code
3. What is emulation?
Arunachala HiTech
Emulation are useful when the host system has one system architecture
and guest system was compiled for a different architecture.
4. Define Kernel.
Kernel is a software code that resides in the central core of an Operating
System. It has complete control over the system.
PART B
(AndroidOS,iOS, Virtualization)
1. With frame work explain the working function of android operating
system architecture. Compare the feature of IoS and android.
2. Explain in detail about virtualization