CS6401 OPERATING SYSTEMS
UNIT ‐ I
2 MARK QUESTIONS:
1. What is an interrupt?
The CPU hardware has a wire called the ―interrupt-request line‖. The basic interrupt mechanism
works as follows;
1. Device controller raises an interrupt by asserting a signal on the interrupt request line.
2. The CPU catches the interrupt and dispatches to the interrupt handler and
3. The handler clears the interrupt by servicing the device. Two interrupt request lines:
1. Nonmaskable interrupt: which is reserved for events such as unrecoverable memory errors
2. Maskable interrupt: Used by device controllers to request service
2. What is a system call?
Programming interface to the services provided by the OS Typically written in a high-level
language (C or C++) Mostly accessed by programs via a high-level Application Programming
Interface (API) rather than direct system call use Three most common APIs are Win32 API for
Windows, POSIX API for POSIX-based systems ( virtually all versions of UNIX, Linux, and
Mac OS X), and Java API for the Java virtual machine (JVM)
3. What is an interrupt vector?
Interrupt transfers control to the interrupt service routine generally, through the interrupt vector,
which contains the addresses of all the service routines.
4. Define bootstrap program
code stored in ROM that is able to locate the kernel, load it into memory, and start its execution.
5. Define operating system
An operating system (OS) is system software that manages computer
hardware and software resources and provides common services for computer programs.
All computer programs, excluding firmware, require an operating system to function.It is
responsible for process management,file management,memory management,storage
management.
6. Draw the storage device hierarchy
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
7. What are the types of operation in operating system ?
OS as a service provider via system calls & commands
Program execution
I/O operations
File-system manipulation
Error detection
Communications
Resource allocation
Accounting
Protection
8. What is a privileged instruction?
Privileged instructions can be issued only in monitor mode.
Interrupt/faul
monitor user
set user mode
9. What are the difference between timesharing and multiprogramming system?
Multiprogramming needed for efficiency.Single user cannot keep CPU and I/O devices busy
at all times.Multiprogramming organizes jobs (code and data) so CPU always has one to
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
execute.A subset of total jobs in system is kept in memory.One job selected and run via job
scheduling.When it has to wait (for I/O for example), OS switches to another job
Timesharing (multitasking) is logical extension in which CPU switches jobs so
frequently that users can interact with each job while it is running, creating interactive
computing
Difference between Multiprogramming System and Time Sharing System:Main difference
between multiprogramming and time sharing is that multiprogramming is the effective utilization
of CPU time, by allowing several programs to use the CPU at the same time but time sharing is
the sharing of a computing facility by several users that want to use the same facility at the same
time. Each user on a time sharing system gets her own terminal and gets the feeling that she is
using the CPU alone. Actually, time sharing systems use the concept of multiprogramming to
share the CPU time between multiple users at the same time.
10) Why API is better than systemcall?
An application programming interface (API) is (as the name suggests) an interface for your
application to use code that does not belong to your application (usually a library). Usually, an
API is comprised of a set of function/method calls that can be made to the library by your
application.
All system calls together constitute an API that the operating system (kernel) provides to
applications that run on that platform. So in short, system calls are also part of an API (for
example, the POSIX API constitutes mostly of system calls made to the kernel).
11.Can multiple user level threads achieve better performance on a multiprocessor system
than a single processor system? Justify your answer.
Single-processor system has only one actual processor, while Multiprocessor system has
more than one, both types of systems can have more than one core per processor.
Multiple processors per system have long been used in systems that need a lot of processing
power, like high traffic servers and when lots of computational power is needed. However these
systems have been expensive and not needed by normal home or office users. These multicore
processors behave the same way as if you had multipleprocessors. One core can only do one task
at a time. Multitasking is done by sharing the time of the processor between processes (program),
one process runs for a short time, then another, then another or maybe the first one again. The
switching is done so fast that the user wont know the difference. Multiple cores can run multiple
processes at once for real. It depends on your software how well you computer can use the
advantage of having multiple processors/cores, dividing the task to different processes.
12.Mention the circumferences that would a user be better off using a time-sharing system
rather than a PC or a single user workstation ?
When there are few other users, the task is large, and the hardware is fast, timesharing makes
sense. The full power of the system can be brought to bear on the user’s problem. The problem
can be solved faster than on a personal computer. Another case occurs when lots of other users
need resources at the same time. A personal computer is best when the job is small enough to be
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
executed reasonably on it and when performance is sufficient to execute the program to the
user’s satisfaction.
13.What are the purpose of system program?
System programs provide a convenient environment for program development and execution.
They can be divided into:
1. File manipulation
2. Status information
3. File modification
4. Programming language support
5. Program loading and execution
6. Communications
7. Application programs
14.What are system components?
Process Management
Main Memory Management
File Management
I/O System Management
Secondary Management Networking
Protection System
Command-Interpreter System
15.What is cache memory?
Use of high-speed memory to hold recently-accessed data. Requires a cache management policy.
Caching introduces another level in storage hierarchy. This requires data that is simultaneously
stored in more than one level to be consistent.
16. What do you mean by Dual-Mode Operation?
Sharing system resources requires operating system to ensure that an incorrect program cannot
cause other programs to execute incorrectly.Provide hardware support to differentiate between at
least two modes of operations. User mode – execution done on behalf of a user.Monitor mode
(also kernel mode or system mode) – execution done on behalf of operating system.Mode bit
added to computer hardware to indicate the current mode: monitor (0) or user (1). When an
interrupt or fault occurs hardware switches to monitor mode.Privileged instructions can be issued
only in monitor mode.
17. What are the advantages and disadvantages of virtual machines?
The virtual-machine concept provides complete protection of system resources since each virtual
machine is isolated from all other virtual machines. This isolation, however, permits no direct
sharing of resources.A virtual-machine system is a perfect vehicle for operating-systems research
and development. System development is done on the virtual machine, instead of on a physical
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
machine and so does not disrupt normal system operation.The virtual machine concept is
difficult to implement due to the effort required to provide an exact duplicate to the underlying
machine.
18. What are the Two types of communication models?
(a) Message passing model
(b) Shared memory model
19.How the instruction will be executed?
An instruction cycle (sometimes called fetch-and-execute cycle, fetch-decode-execute cycle, or
FDX) is the basic operation cycle of a computer. It is the process by which a computer retrieves
a program instruction from its memory, determines what actions the instruction requires, and
carries out those actions. This cycle is repeated continuously by the central processing unit
(CPU), from bootup to when the computer is shut down
20. What is Microkernel System Structure?
Strip down the kernel: minimal process, memory, management and communication facilities.
Moves as much from the kernel into “user” space.
Communication between services running in user space takes place between user modules using
message passing. Messages go thru microkernel.
All new services to OS are added to user space and do not require modification to kernel
Benefits:
easier to extend a microkernel
easier to port the operating system to new architectures
more reliable (less code is running in kernel mode)
more secure
PART -B
16 MARK QUESTIONS:
1. Explain multiprocessor system
2. Explain about system call in detail.
3. Explain about system program.
4. Explain in detail the operating system structure and services.
5. Write about OS generation.
6. Write about direct Memory access.
7. Write about systemBoot.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
UNIT‐ II
2 MARK QUESTIONS:
1. Define Process
A process can be thought of as a program in execution.
A process is the unit of the unit of work in a modern time-sharing system.
A process generally includes the process stack, which contains temporary data (such as
method parameters, return addresses, and local variables), and a data section, which contains
global variables.
2. What are the Process State ?
As a process executes, it changes 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: The process is being created.
Running: Instructions are being executed.
Waiting: The process is waiting for some event to occur (such as an I/O completion or
reception of a signal).
Ready: The process is waiting to be assigned to a processor.
Terminated: The process has finished execution.
3. What Is PCB? What kind of information it holds?
Each process is represented in the operating system by a process control block
(PCB)-also called a task control block.
A PCB defines a process to the operating system.
It contains the entire information about a process.
Some of the information a PCB contans are:
Process state: The state may be new, ready, running, waiting, halted, and SO on.
Program counter: The counter indicates the address of the next instruction to be executed for
this process.
CPU registers: The registers vary in number and type, depending on the computer architecture.
CPU-scheduling information: This information includes a process priority, pointers to
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
scheduling queues, and any other scheduling parameters.
Memory-management information: This information may include such information as the
value of the base and limitregisters, the page tables, or the segment tables, depending on the
memory system used by the operating system.
Accounting information: This information includes the amount of CPU and real time used, time
limits, account numbers, job or process numbers, and so on.
Status information: The information includes the list of I/O devices allocated to this process, a
list of open files, and so on.
5. What are the types of Schedulers?
The selection process is carried out by the appropriate scheduler. There are three different
types of schedulers.They are:
1. Long-term Scheduler or Job Scheduler
2. Short-term Scheduler or CPU Scheduler
3. Medium term Scheduler
The long-term scheduler, or job scheduler, selects processes from this pool and loads them into
memory for execution. It is invoked very infrequently. It controls the degree of
multiprogramming.
The short-term scheduler, or CPU scheduler, selects from among the processes that are ready
to execute, and allocates the CPU to one of them. It is invoked very frequently.
Some operating systems, such as time-sharing systems, may introduce an additional,
intermediate level of scheduling.
The key idea is medium-term scheduler, removes processes from memory and thus reduces
the degree of multiprogramming.
6. What is Context Switch?
Switching the CPU to another process requires saving the state of the old process and
loading the saved state for the new process.
This task is known as a context switch.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
Context-switch time is pure overhead, because the system does no useful work while
switching.
Its speed varies from machine to machine, depending on the memory speed, the number of
registers that must be copied, and the existence of special instructions.
7. What is Co-operative Process?
The concurrent processes executing in the operating system may be either independent
processes or cooperating processes.
A process is independent if it cannot affect or be affected by the other processes
executing in the system.
A process is cooperating if it can affect or be affected by the other processes executing in the
system.
Benefits of Cooperating Processes
1. Information sharing
2. Computation speedup
3. Modularity
4. Convenience
8. Define IPC.
Operating systems provide the means for cooperating processes to communicate
with each other via an interprocess communication (PC) facility.
IPC provides a mechanism to allow processes to communicate and to synchronize their
actions.IPC is best provided by a message passing system.
There are several methods for logically implementing a link and the operations:
1. Direct or indirect communication
2. Symmetric or asymmetric communication
3. Automatic or explicit buffering
4. Send by copy or send by reference
5. Fixed-sized or variable-sized messages
9. What is Remote procedure Calls?
The messages exchanged for RPC are well structured.They are addressed to an RPC daemon
listening to a port on the remote system.Stubs – client-side proxy for the actual procedure on
the server.The client-side stub locates the server and marshalls the parameters.Parameter
Marshalling involves packaging the parameters into a form that can be transmitted over the
network.The stub then transmits a message to the server using message passing.A similar stub
on the server side receives this message and invokes the procedure on the server.The return
values are passed back to the client using the same technique.
10. Define threads.
A thread is the basic unit of CPU utilization.
It is sometimes called as a lightweight process.
It consists of a thread ID ,a program counter, a register set and a stack.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
It shares with other threads belonging to the same process its code section , data
section, and resources such as open files and signals.
A traditional or heavy weight process has a single thread of control.
If the process has multiple threads of control, it can do more than one task at a time.
11. Differ user thread and kernel thread.
User threads
Supported above the kernel and implemented by a thread library at the user level.
Thread creation , management and scheduling are done in user space.
Fast to create and manage
When a user thread performs a blocking system call ,it will cause the entire process to
block even if other threads are available to run within the application.
Example: POSIX Pthreads,Mach C-threads and Solaris 2 UI-threads.
Kernel threads
Supported directly by the OS.
Thread creation , management and scheduling are done in kernel space.
Slow to create and manage
When a kernel thread performs a blocking system call ,the kernel schedules another
thread in the application for execution.
Example: Windows NT, Windows 2000 , Solaris 2,BeOS and Tru64
UNIX support kernel threads.
12. What are the Benefits of multithreaded programming
Responsiveness
Resource Sharing
Economy
Utilization of MP Architectures
13. What is semaphores?
Synchronization tool that does not require busy waiting. Semaphore S – integer variable
Two standard operations modify S: wait() and signal()
Originally called P() and V()
Less complicated
Can only be accessed via two indivisible (atomic) operations
wait (S) {
while S <= 0
; // no-op
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
S--;
}
signal (S) {
S++;
15. What is monitors?
A high-level abstraction that provides a convenient and effective mechanism for process
synchronization
Only one process may be active within the monitor at a time monitor monitor-name
{
// shared variable declarations
procedure P1 (…) { …. }
…
procedure Pn (…) {……} Initialization code ( ….) { … }
…
}}
16. What is preemptive Scheduling?
preemptive – if a new process arrives with CPU burst length less than remaining time of current
executing process, preempt. This scheme is know as the
Shortest-Remaining-Time-First (SRTF)
CPU scheduling decisions may take place when a process
Switches from running to ready state
Switches from waiting to ready
These two states preemptive.
17. What is Non Preemptive Scheduling?
nonpreemptive – once CPU given to the process it cannot be preempted until completes its CPU
burst.CPU scheduling decisions may take place when a process: Switches from running to
waiting state.Terminates/These two states Non preemptive.
18. What are the scheduling Criteria?
1) CPU utilization – keep the CPU as busy as possible
2) Throughput – # of processes that complete their execution per time unit
3) Turnaround time – amount of time to execute a particular process
4) Waiting time – amount of time a process has been waiting in the ready queue
5) Response time – amount of time it takes from when a request was submitted until the first
response is produced, not output (for time-sharing environment)
19. What are the scheduling algorithm?
First-Come, First-Served (FCFS) Scheduling
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
Shortest-Job-First (SJR) Scheduling
Priority Scheduling
Round Robin (RR)
20. Define Dead Locks.
A set of blocked processes each holding a resource and waiting to acquire a resource held
by another process in the set.
Example
System has 2 tape drives.
P1 and P2 each hold one tape drive and each needs another one.
Example
semaphores A and B, initialized to 1
P0 P1
wait (A); wait(B)
wait (B); wait(A)
Bridge Crossing Example
Traffic only in one direction.
Each section of a bridge can be viewed as a resource.
If a deadlock occurs, it can be resolved if one car backs up (preempt resources and
rollback).
Several cars may have to be backed up if a deadlock occurs.
Starvation is possible.
16 MARK QUESTIONS:
1. Explain the interprocess communication
2. Explain about remote procedure calls
3. Explain about Multi threading models
4. Consider the following set of processes with the length of the CPU burst time given in
milliseconds
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
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,anon preemptive priority (a smaller priority number implies a higher priority)and RR
(quantum=1)scheduling.
b. What is the turnaround time of each process for each of the scheduling algorithms
in part a?
c. What is the waiting time of each process for each of the scheduling algorithms in part a?
d. Which of the schedules in part a results in the minimal average waiting time?
6.Explain about various scheduling algorithms
7.Explain in detail about the critical section problem 8.Explain in detail about semaphores and
monitors
9.Expain about deadlock prevention and deadlock avoidance algorithms
10. Consider the following snapshot of a system
Availabl
Allocation Max e
A B C D ABC D A B C D
P0 0 0 1 2 0 0 1 2 1 5 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6
Answer the following question using banker’s algorithm a)What is the content of the matrix
Need?
b)Is the system in a safe state?
c)If a request from process p1 arrives for (0,4,2,0) can the request be granted immediately?
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
UNIT‐ III
2 MARK QUESTIONS:
1. Difference between logical and physical address space.
Logical address – generated by the CPU; also referred to as “virtual address“
Physical address – address seen by the memory unit.
Logical and physical addresses are the same in ―compile-time and load-time address-binding
schemes.
Logical (virtual) and physical addresses differ in ―execution-time address-
binding scheme‖
2. What is Dynamic Loading?
Through this, the routine is not loaded until it is called.
o Better memory-space utilization; unused routine is never loaded
o Useful when large amounts of code are needed to handle infrequently occurring cases
o No special support from the operating system is required implemented through program design
3. What is Overlays?
Enable a process larger than the amount of memory allocated to it.
At a given time, the needed instructions & data are to be kept within a memory.
4. Define Swapping
A process can be swapped temporarily out of memory to a backing store (SWAP OUT)and
then brought back into memory for continued execution (SWAP IN).
Backing store – fast disk large enough to accommodate copies of all memory images
for all users & it must provide direct access to these
memory images
Roll out, roll in – swapping variant used for priority-based scheduling algorithms; lower-
priority process is swapped out so higher-priority process can be loaded and executed
5. What is Paging?
It is a memory management scheme that permits the physical address space of a process to be
non contiguous.It avoids the considerable problem of fitting the varying size memory chunks on
to the backing store.
i) Basic Method:
o Divide logical memory into blocks of same size called “pages”. o Divide physical memory
into fixed-sized blocks called “frames” o Page size is a power of 2, between 512 bytes and
16MB.
6. Define segmentation.
o Memory-management scheme that supports user view of memory
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
o A program is a collection of segments. A segment is a logical unit such as: Main program,
Procedure, Function, Method, Object, Local variables, global variables, Common block, Stack,
Symbol table, arrays
6.What is Hit ratio?
o Hit ratio: Percentage of times that a particular page is found in the TLB.
For example hit ratio is 80% means that the desired page
number in the TLB is 80% of the time.
7. What is TLB?
TLB (Translation Look-aside Buffer)
It is a fast lookup hardware cache.
It contains the recently or frequently used page table entries.
It has two parts: Key (tag) & Value.
More expensive.
Paging Hardware with TLB
o When a logical address is generated by CPU, its page number is presented to
TLB.
o TLB hit: If the page number is found, its frame number is immediately available & is used to
access memory
8. What is Virtual Memory?
o It is a technique that allows the execution of processes that may not be
completely in main memory.
o Advantages:
Allows the program that can be larger than the physical memory.
Separation of user logical memory from physical memory
Allows processes to easily share files & address space.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
Allows for more efficient process creation.
o Virtual memory can be implemented using
Demand paging
Demand segmentation
9. What is demand paging?
It is similar to a paging system with swapping.
o Demand Paging - Bring a page into memory only when it is needed
o To execute a process, swap that entire process into memory. Rather than
swapping the entire process into memory however, we use ―Lazy Swapper‖
o Lazy Swapper - Never swaps a page into memory unless that page will be needed.
o Advantages
Less I/O needed
Less memory needed
Faster response
More users
11.How to calculate Effective access time in Demand Paging?
Let p be the probability of a page fault 0 p 1
o Effective Access Time (EAT)
EAT = (1 – p) x ma + p x page fault time.
Where m memory access, p robability of page fault (0≤ p ≤ 1)
o The memory access time denoted ma is in the range 10 to 200 ns.
o If there are no page faults then EAT = ma.
o To compute effective access time, we must know how much time is needed
to service a page fault.
12.What is memory mapping approach?
o Sequential read of a file on disk uses open() , read() and write()
o Every time a file is accessed it requires a system call and disk access.
o Alternative method: “Memory – mapped files”
Allowing a part of virtual address space to be logically associated with file.
Mapping a disk block to a page in memory.
13.What are the page replacement algorithm?
o If no frames are free, we could find one that is not currently being used &
free it.
o We can free a frame by writing its contents to swap space & changing the page table to
indicate that the page is no longer in memory.
o Then we can use that freed frame to hold the page for which the process faulted.
Basic Page Replacement
1. Find the location of the desired page on disk
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
2. Find a free frame
- If there is a free frame , then use it.
- If there is no free frame, use a page replacement algorithm to select a
victim frame
- Write the victim page to the disk, change the page & frame tables accordingly.
3. Read the desired page into the (new) free frame. Update the page and frame tables.
4. Restart the process
14.Compare LRU and Optimal Replacement Algorithm
Optimal page replacement algorithm
o Replace the page that will not be used for the longest period of time.
Example:
Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1
No.of available frames = 3
No. of page faults = 9
Drawback:
o It is difficult to implement as it requires future knowledge of the reference string.
(c) LRU(Least Recently Used) page replacement algorithm
o Replace the page that has not been used for the longest period of time.
Example:
Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1
No.of available frames = 3
No. of page faults = 12
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
15.Compare the Global and Local Descriptor table?
The local-address space of a process is divided into two partitions. The first partition consists
of up to 8 KB segments that are private to that process. The second partition consists of up to
8KB segments that are shared among all the processes.Information about the first partition is
kept in the local descriptor table(LDT), information about the second partition is kept in
the global descriptor table (GDT). Each entry in the LDT and GDT consist of 8 bytes, with
detailed information about a particular segment including the base location and length of the
segment.The logical address is a pair (selector, offset) where the selector is a16-bit number:
s g p
13 1 2
Where s designates the segment number, g indicates whether the segment is in the GDT or
LDT, and p deals with protection. The offset is a 32-bit number specifying the location of the
byte within the segment in question. The base and limit information about the segment in
question are used to generate a linear-address.
16.What is Thrashing?
o High paging activity is called thrashing.
o If a process does not have ―enough‖ pages, the page-fault rate is very high.
This leads to:
low CPU utilization
operating system thinks that it needs to increase the degree of
multiprogramming
another process is added to the system
o When the CPU utilization is low, the OS increases the degree
of multiprogramming.
o If global replacement is used then as processes enter the main memory they tend to steal
frames belonging to other processes.
o Eventually all processes will not have enough frames and hence the page fault rate
becomes very high.
o Thus swapping in and swapping out of pages only takes place.
o This is the cause of thrashing.
17. Consider a logical address space of eight pages of 1024 words each mapped onto a
physical memory of 32 frames.
a)How many bits are in the logical address? b)How many bits are in the physical address?
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
a)size of logical address space is No. of pages * Page size = 8 * 1024 = 2^3 * 2 ^10 = 2^13 No.
of bits for logical address is 13
b)Size of Physical address space is 2^5 * 2^10 = 2^15 No. of bits for physical address is 15
18. Difference between internal and external fragmentation.
External Fragmentation – This takes place when enough total memory space exists to
satisfy a request, but it is not contiguous i.e, storage is fragmented into a large number of small
holes scattered throughout the main memory.
Internal Fragmentation – Allocated memory may be slightly larger than requested memory.
Example: hole = 184 bytes
Process size = 182 bytes.
We are left with a hole of 2 bytes.
Solutions:
1. Coalescing : Merge the adjacent holes together.
2. Compaction: Move all processes towards one end of memory, hole towards other
end of memory, producing one large hole of available memory. This scheme is expensive as it
can be done if relocation is dynamic and done at execution time.
3. Permit the logical address space of a process to be non-contiguous. This is
achieved through two memory management schemes namely paging and segmentation.
19.What do you mean by COW?
Copy-on-Write (COW) allows both parent and child processes to initially share the same
pages in memory. These shared pages are marked as Copy-on- Write pages, meaning that if
either process modifies a shared page, a copy of the shared page is created.
20. Global vs. Local Replacement
o Global replacement – each process selects a replacement frame from the set of all frames; one
process can take a frame from another.
o Local replacement – each process selects from only its own set of allocated frames.
16 MARK QUESTIONS:
1. Explain in detail Contiguous Memory Allocation.
2. Explain in detail about segmentation.
3. Explain in detail about paging.
4. Explain in detail about segmentation with paging.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
5. Describe the following allocation algorithms:
a. First fit
b. Best fit
c. Worst fit
6. Explain demand paging.
7. Explain page replacement algorithms.
8. Consider the following page‐reference string: 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 two,
three frames?
Remember that all frames are initially empty, so your first unique pages will all cost one fault
each.
LRU replacement
FIFO replacement
Optimal replacement
9. Explain in detail about Thrashing.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
UNIT‐ IV
2 MARK QUESTIONS:
1. What is seek time?
The seek time is the time for the disk arm to move the heads to the cylinder containing the
desired sector.
2.what is Rotational latency?
The rotational latency is the additional time waiting for the disk to rotate the desired sector
to the disk head.
3.What is Physical formatting of the disk?
Before a disk can store data, the sector is divided into various partitions. This process is called
low-level formatting or physical formatting. It fills the disk with a special data structure for each
sector.
The data structure for a sector consists of
Header,
Data area (usually 512 bytes in size), and
Trailer.
4.What is logical formatting of the disk?
The operating system stores the initial file-system data structures onto the disk. These data
structures may include maps of free and allocated space and an initial empty directory.
5.What is boot block?
For a computer to start running-for instance, when it is powered up or rebooted-it needs to have
an initial program to run. This initial program is called bootstrap program & it should be simple.
It initializes all aspects of the system, from CPU registers to device controllers and the contents
of main memory, and then starts the operating system.
To do its job, the bootstrap program
1. Finds the operating system kernel on disk,
2. Loads that kernel into memory, and
Jumps to an initial address to begin the operating-system execution
6.What is bad blocks?
The disk with defected sector is called as bad block.
Depending on the disk and controller in use, these blocks are handled in a variety of ways;
Method 1: “Handled manually‖
If blocks go bad during normal operation, a special program must be run manually to search for
the bad blocks and to lock them away as before. Data that resided on the bad blocks usually are
lost.
Method 2: “sector sparing or forwarding”
The controller maintains a list of bad blocks on the disk. Then the controller can be told
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
to replace each bad sector logically with one of the spare sectors. This scheme is known as sector
sparing or forwarding.
Method 3: “sector slipping”
For an example, suppose that logical block 17 becomes defective, and the first available spare
follows sector 202. Then, sector slipping would remap all the sectors from 17 to 202, moving
them all down one spot. That is, sector 202 would be copied into the spare, then sector 201 into
202, and then 200 into 201, and so on, until sector 18 is copied into sector 19. Slipping the
sectors in this way frees up the space of sector 18, so sector 17 can be mapped to it.
7.What are the file attributes?
Name: The symbolic file name is the only information kept in human readable form.
Identifier: This unique tag, usually a number identifies the file within the file system. It is
the non-human readable name for the file.
Type: This information is needed for those systems that support different types.
Location: This information is a pointer to a device and to the location of the file on that device.
Size: The current size of the file (in bytes, words or blocks)and possibly the maximum allowed
size are included in this attribute.
Protection: Access-control information determines who can do reading, writing, executing
and so on.
Time, date and user identification: This information may be kept for creation, last
modification and last use. These data can be useful for protection, security and usage monitoring.
8.What are the File operations?
Creating a file
Writing a file
Reading a file
Repositioning within a file
Deleting a file
Truncating a file
9.What are the methods for Accessing the file?
1. Sequential Access
2. Direct Access
3. Other Access methods
10.Define single level directory.
The simplest directory structure is the single- level directory.
All files are contained in the same directory.
Disadvantage: When the number of files increases or when the system has
more than one user, since all files are in the same directory, they must have unique names.
cat bo a tes Dat ma co he recor
t a ll nt x ds
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
11.Define Two‐level directory.
In the two level directory structures, each user has her own user file directory (UFD).
When a user job starts or a user logs in, the system’s master file directory (MFD) is
searched. The MFD is indexed by user name or account number, and each entry points to the
UFD for that user.When a user refers to a particular file, only his own UFD is searched.
Thus, different users may have files with the same name.Although the two – level directory
structure solves the name-collision problem
Disadvantage:
Users cannot create their own sub-directories.
12. What is FAT.
An important variation on the linked allocation method is the use of a file allocation
table(FAT).This simple but efficient method of disk- space allocation is used by the MS- DOS
and OS/2 operating systems.A section of disk at beginning of each partition is set aside to
contain the table.The table has entry for each disk block, and is indexed by block number.
The FAT is much as is a linked list.The directory entry contains the block number the first block
of the file.The table entry indexed by that block number contains the block number of the next
block in the file.This chain continues until the last block which has a special end – of – file
value as the table entry.Unused blocks are indicated by a 0 table value.Allocating a new block
file is a simple matter of finding the first 0 – valued table entry, and replacing the previous end
of file value with the address of the new block. The 0 is replaced with the end – of – file
value, an illustrative example is the FAT structure for a file consisting of disk blocks 217,618,
and 339.
13.What is layered file system.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
The I/O control consists of device drivers and interrupt handlers to transfer
information between the main memory and the disk system .
The basic file system needs only to issue generic commands to the appropriate device driver
to read and write physical blocks on the disk. Each physical block is identified by its numeric
disk address (for example, drive –1, cylinder 73, track 2, sector 10)
Application programs
Logical file system
File-organization module
Basic file system
I/O contol devices
14.What is FCB.
A file control block (FCB) contains information about the file , including
ownership, permissions, and location of the file contents. The logical file system is also
responsible for protection and security.
15.What is bit vector?
Since disk space is limited, we need to reuse the space from deleted files for new files, 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 – those not allocated to some file or
directory.
To create a file, we search the free-space list for the required amount of space, and
allocate that space to the new file.
This space is then removed from the free-space list.
When a file is deleted, its disk space is added to the free-space list.
1. Bit Vector
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
The free-space list is implemented as a bit map or bit vector. 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.
For example, consider a disk where block2,3,4,5,8,9,10,11,12,13,17,18,25,26
and 27 are free, and the rest of the block are allocated. The free space bit map would be
001111001111110001100000011100000 …
The main advantage of this approach is its relatively simplicity and efficiency in
finding the first free block, or n consecutive free blocks on the disk.
16.What is polling?
Polling is the process where the computer or controlling device waits for an external device to
check for its readiness or state, often with low-level hardware. For example, when a printer is
connected via a parallel port, the computer waits until the printer has received the next character.
These processes can be as minute as only reading one bit.
17. What are the Advantages of Bootstrap?
1. ROM needs no initialization.
2. It is at a fixed location that the processor can start executing when powered up or reset.
It cannot be infected by a computer virus. Since, ROM is read only.
18. What are the types of files?
executable, Object, Source code, Batch, Text, word processor, Library, Archive, print or view
multimedia
19. What do you mean by Mounting?
Just as a file must be opened before it is used, a file system must be mounted before it can be
available to processes on the system.The mount procedure is straightforward. The operating
system is given the name of the device, and the location within the file structure at which
to attach the File system (or mount point).A mount point is an empty directory at which the
mounted file system will be attached.For instance, on a UNIX system, a file system
containing user’s home directories might be mounted as /home; then to access the directory
structure within that file system , one could precede the directory names with /home, as in
/home/jane. Mounting that file system under /user would result in the
pathname/users/jane
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
20.Define RAID.
Redundant arrays of inexpensive disks (RAID) can prevent the loss of a disk from resulting
in the loss of data.
Remote file system has more failure modes. By nature of the complexity of networking system
and the required interactions between remote machines, many more problems can interfere with
the proper operation of remote file systems.
16 MARK QUESTIONS:
1. Explain in detail about disc scheduling algorithm.
2. Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently
serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of
pending requests, in FIFO order, is
86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130.
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. C‐SCAN
f. C‐LOOK
3. Explain in detail about disc management.
4. Explain in detail about directory structure.
5. Explain in detail about file system structure and implementation.
6. Explain in detail about allocation methods of disc.
7. Explain in detail about free space management.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
UNIT‐ V
2 MARK QUESTIONS:
1. Write about Linux Kernel system.
Kernel - Kernel is the core part of Linux. It is responsible for all major activities of this operating
system. It is consists of various modules and it interacts directly with the underlying hardware.
Kernel provides the required abstraction to hide low level hardware details to system or
application programs.
2. Draw the components of the Linux system.
Kernel - Kernel is the core part of Linux. It is responsible for all major activities of this
operating system. It is consists of various modules and it interacts directly with the underlying
hardware. Kernel provides the required abstraction to hide low level hardware details to system
or application programs.
System Library - System libraries are special functions or programs using which application
programs or system utilities accesses Kernel's features. These libraries implements most of the
functionalities of the operating system and do not requires kernel module's code access rights.
System Utility - System Utility programs are responsible to do specialized, individual level tasks
3. What is domain name system?
Domain Names are a hierarchical naming system for hosts, services and resources.DNS
Servers are used to translate the Domain Name, or “friendly name”, of a host to an IP Address.
You must remember that all information sent on the Internet is routed by IP Addresses only.
When a browser is opened a user may type in ‘www.linux.org’ into the address bar. Frames
routed around the Internet do not have the name ‘www.linux.org’ encapsulated into the frame. IP
Addresses are used instead and in a frame for a request to ‘www.linux.org’, you would see the
address of 209.92.24.80.If an address is unknown the system can perform a few steps to
determine the IP Address of the Domain Name:
Check local name – if the local host name is the name being sought, then a connection is made to
the local host.
Checks hosts file – the host file (\etc\hosts) is a text file containing IP Addresses and the
associated Domain Name.
Checks DNS Server – the primary and secondary DNS server is contacted which are configured
in the TCP/IP settings.
4. What is virtualization?
Virtualization refers to the act of creating a virtual (rather than actual) version of something,
including a virtual computer hardware platform, operating system (OS), storage device, or
computer network resources.
5. Draw the architecture of Xen project.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
6. What is VMware on Linux?
VMware Workstation is developed and sold by VMware, Inc., a division of EMC
Corporation. VMware Workstation is a hypervisor that runs on x86 or x86-64 computers; it
enables users to set up one or more virtual machines (VMs) on a single physical machine, and
use them simultaneously along with the actual machine. Each virtual machine can execute its
own operating system, including versions of Microsoft Windows, Linux, BSD, and MS-DOS.
VMware Workstation supports bridging existing host network adapters and share physical disk
drives and USB devices with a virtual machine. In addition, it can simulate disk drives
7. What is Linux multifunction server?
A Linux server is a high-powered variant of the Linux open sourceoperating system that's
designed to handle the more demanding needs of business applications such as network and
system administration, database management and Web services.
Linux servers are frequently selected over other server operating systems for their stability,
security and flexibility advantages. Leading Linux server operating systems include
CentOS, Debian, Ubuntu Server, Slackware and Gentoo.
8. Define Fork .
System call fork() is used to create processes. It takes no arguments and returns a process ID.
The purpose of fork() is to create a new process, which becomes the child process of the caller.
After a new child process is created, both processes will execute the next instruction following
the fork() system call. Therefore, we have to distinguish the parent from the child. This can be
done by testing the returned value of fork():
If fork() returns a negative value, the creation of a child process was unsuccessful.
fork() returns a zero to the newly created child process.
fork() returns a positive value, the process ID of the child process, to the parent. The returned
process ID is of type pid_t defined in sys/types.h. Normally, the process ID is an integer.
Moreover, a process can use function getpid() to retrieve the process ID assigned to this process.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
9. What are the service provided by linux?
Initialization (init),Logins from terminals (getty) Logging and Auditing (syslog) Periodic
command execution (cron & at) Graphical user interface ,Network logins (telnet, rlogin & ssh)
,Network File System (NFS & CIFS)
10. What are the security groups in Linux?
Permissions are the “rights” to act on a file or directory. The basic rights are read, write,
and execute.Read - a readable permission allows the contents of the file to be viewed. A read
permission on a directory allows you to list the contents of a directory.Write - a write permission
on a file allows you to modify the contents of that file. For a directory, the write permission
allows you to edit the contents of a directory (e.g. add/delete files).Execute - for a file, the
executable permission allows you to run the file and execute a program or script. For a directory,
the execute permission allows you to change to a different directory and make it your current
working directory. Users usually have a default group, but they may belong to several additional
groups.
11. Listout the Benefits of Virtualization.
Instead of deploying several physical servers for each service, only one server can be used.
Virtualization let multiple OSs and applications to run on a server at a time. Consolidate
hardware to get vastly higher productivity from fewer servers.
If the preferred operating system is deployed as an image, so we needed to go through the
installation process only once for the entire infrastructure.
Improve business continuity: Virtual operating system images allow us for instant
recovery in case of a system failure. The crashed system
can be restored back by coping the virtual image.
Increased uptime: Most server virtualization platforms offer a number of advanced
features that just aren't found on physical servers which increases servers’ uptime. Some
of features are live migration, storage migration, fault tolerance, high availability, and
distributed resource scheduling.
Reduce capital and operating costs: Server consolidation can be done by running multiple
virtual machines (VM) on a single physical server. Fewer servers means lower capital
and operating costs.
DEPARTMENT OF INFORMATION TECHNOLOGY
CS6401 OPERATING SYSTEMS
16 MARK QUESTIONS:
1. Explain system administration requirement for Linux system administrator.
2. Explain setting up a Linux multifunction server.
3. Explain Domain name systems.
4. Explain the basic concepts of Virtualization.
5. Explain in detail about setting up Xen.
6. Explain in detail about VM Ware on Linux Host and Adding Guest OS.
7. Explain in detail about network structure and security in Linux.
DEPARTMENT OF INFORMATION TECHNOLOGY