Nothing Special   »   [go: up one dir, main page]

5 Operating System - 8096097

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

BSNL – JTO - LICE OPERATING SYSTEM

OPERATING SYSTEM
 Computer runs with Hardware and Software
 Software is classified into system software and Application software
 System software is sub divided into operating system. Compiler, linker etc.
 Operating System: An operating system is a program that manages the computer hardware.
It also provides a basis for application programs and acts as an interface between the user
and the computer hardware.
 Various Operating System :
 Single User Operating System
Eg : MS DOS
 Single User Multitask Operating System (or)
Batch Processing System
Eg : WINDOWS 9X
 Multi User Operating System (Time Sharing Systems and Interactive Systems)
Eg : UNIX
 Network Operating System (or) Distributed Systems
Eg : WIN NT, NOVELL NETWARE
 Multi Processor OS (or) Real Time Systems
Eg : Computers which are used in Military, Satellites, Airforce, Whether forecasting etc
 Cloud Computing
 Architecture specifies overall design how the data flow between the task
 In single user OS we use Monolythic architecture
 In Multiuser OS we use layered architecture
 DISTRIBUTED SYSTEMS :
 A distributed system is a collection of physically separate, possibly heterogeneous
computer systems that are networked to provide the users with access to the various
resources that the system maintains.
 The protocols that create a distributed system can greatly affect that systems utility and
popularity
 BATCH OPERATING SYSTEM
 The Monitor or Batch Operating System is simply a computer program. It relies on the
ability of the processor to fetch instructions from various portions of main memory to
alternately seize and relinguish control.
 Batch Processing is execution of a series of programs (“jobs”) on a computer without
manual intervention.
 Jobs are set up so they can be run to completion without manual intervention, so all
input data is opresented throguh scripts or command line parameters.
 This is contrast to “online” or interactive programs which prompt the user for such
input.
 A program takes a set of data filter as input, process the data, and produces a set of
output data files.

SAIMEDHA 1
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 This operating environment termed as “batch processing” because the input data are
collected into batches of files and are processed in batches by the program.
 Time sharing Operating System (TSOS) :
 In time sharing OS, processor time is shared among multiple users.
 Multiple users access the system through terminals, with the OS interleaving the
execution of each user program in a short burst or quantum of computation.
 TSOS was the first operating system that supported virtual addressing of the main
storage.
 Time sharing is sharing a computing resource among many users by means of
multiprogramming and multitasking
 It is a mode of operation that allows multiple independent users to share the resources
of a multiuser computer system, including the CPU, bus and memory.
 Real Time Operating System :
 A real time operating system (RTOS) is an operating system intended to serve real-time
application requests.
 A key characteristic of an RTOS is the level of its consistency concerning the amount
of time it takes to accept and complete on an applications task ; the variability of jitter.
 A hard RTOS has less jetter than a soft RTOS. The chief design goal is not high
throughput, but rather a guarantee of a soft or hard performance category.
 An RTOS that can usually or generally meet a deadline in a soft real-time operating
system if it can meet a dead line deterministically it is a hard RTOS
 An RTOS has an advanced algorithm for scheduling key factor in a RTOS are minimal
interrupt latency and minimal thread switching latency.
 Operating System Services :
 User Interface  Program Execution
 File-system manipulation  I/O operations
 Communications  Error detection & Response
 Resource Allocation  Accounting
 Protection and security  System Access
 There are two fundamental approaches for users to interface with the operating system
1) Command Interpreter 2) Graphical User Interface
Eg : MS- DOS and UNIX Eg : Windows, Linix etc.
 A portion of the operating system is in main memory. This includes the kernel or nucleus,
which contains the most frequently used functions in the operating system and at a given
time, other portions of the operating system currently in use.
 System Calls : The system call is the means by which a process requests a specific
kernel service. There are several hundred system calls, which can be roughly grouped into
6 categories:
File system, Process, Scheduling, Socket (Networking), Inter Process Communication and
Miscellaneous.
 Micro Kernel :
 It provides minimal process and memory management and communication facility
 The main function is to provide a communication facility between the client program
and various services that are also running in user space.
SAIMEDHA 2
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 The benefit of microkernel is case of extending the operating system.


 The first generation microkernels, like, Mach are fat and provide lots of services or
multiple ways to do the same thing
 The second generation micro kernels more follow the “pure” microkernel ideal : kernel;
with a very small foot print. Eg : 14 & QNX
 Operating System Components :
 Processes
 Memory Management
 Information protection and Security
 Scheduling and Resource Management
 System Structure
 The procedure of starting a computer by loading the kernel is known as booting the
system.
 In most computer systems, a small piece of code known as the boot strap program or
boot strap loader locates the kernel, loads it into main memory, and starts its execution.
 Process Management
  A process is a program in execution
  Systems consist of a collection of processes : Operating system processes execute
system code, and user processes execute user code. All these processes may execute
concurrently.
A process is more than the program code, which is sometimes known as the text
section
 A process generally also include the process stack, data section and heap.
 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 proces is waiting for some event to occur
 Ready : The process is waiting to be assigned to a processor
 Terminated : The process has finished execution
 PROCESS CONTROL BLOCK (PCB) :
 Each process is represented in the operating system by a process control block (PCB)
also called a task control block.
 It contains many pieces of information associated with a specific process.

 A process is a program that performs a single thread of execution.


 SCHEDULING :
 Scheduling is the method by which threads, processes or data flows are given access to
system resources (Eg : Processor time, communication bandwidth)
 The need for a scheduling algorithm arises from the requirement for most modern s
ystems to perform multitasking and multiplexing.

SAIMEDHA 3
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 PROCESS SCHEDULING : The process scheduler selects an available process for


program execution on the CPU
The main aim of processor scheduling is to assign processes to be executed by the
processor or processor over time, in a way that meets system objectives, such as response
time, throughout, and processor efficiency.
 It is used to maximize CPU utilization
 If there are more processes, the rest will have to wait until the CPU is free and can be
rescheduled]
 Types of Scheduling :
 Long - Term Scheduling : It determines which programs are admitted to the system for
processing. Thus it controls the degree of multiprogramming.
l The long-term scheduler, or job scheduler, select processes from the pool and loads
them into memory for execution.
 Medium - Term Scheduling : It is a part of the swapping function. The swapping - in
decision is based on the need to manage the degree of multi programming.
 Short - Term Scheduling : It is also known as CPU scheduling or Dispatcher executes
most frequently and makes the fine - grained decision of which process to execute next.
The short - term scheduler is invoked whenever an event occurs that may lead to the
blocking of the current process or that may provide an opportunity to preempt a currently
running process in favour of another.
Eg : * Clock Interrputs * Operating System calls * I/O Interrupts * Signals (Eg
semaphores)
 I/O Scheduling : The decision as to which process’s pending I/O request shall be handled
by an available I/O device
 An I/O process is one that spends more of its time doing I/O than it spends doing
computations.
 A CPU - bound process, generates I/O requests infrequently using more of its time
doing computations.
 Scheduling Queues
 As process enter the system, they are put into a job queue, which consist of all process
in the system
 The processes that are residing in main memory and are ready and waiting to execute
are kept on a list called the ready queue
 This queue is generally stored as a linked list.
 A ready -queue header contains pointers to the first and final PCBs in the list.
 The list of processes waiting for a particular I/O device is called a device queue
 A new process is initially put in the ready queue. It waits there until it is selected for
execution. or is dispatched.
 The process could create a new sub process and wait for the sub processes termination.
 The process could be removed forcibly from the CPU as a result of an interrupt, and be
put back in the ready queue.
 The selection process is carried out by the appropriate scheduler.

SAIMEDHA 4
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 Switching the CPU to another process requires performing a state save of the current
process and a state restore of a different process. This task is known as a Context Switch.
 When a context switch occurs, the kernel saves the context of the old process in its
PCB and loads the saved context of the new process scheduled to run.
 PROCESS CREATION :
 A process may create several new processes, via a create-process system call, during
the course of execution.
 The creating process is called a parent process, and the new processes are called the
children of that process.
 Each of these new processes may in turn create other processes, forming a tree of
processes.
 When the OS creates a process at the explicit request of another process, the action is
referred to as process spawning.
 When a process creater a new process, two possibilities exist in terms of execution :
1) The parent continues to execute concurrently with its children.
2) The parent waits until some or all of its children have terminated.
 There are also two possibilities in terms of the address space of the new process :
1) The child process is a duplicate of the parent process (it has the same program and
data as the parent)
2) The child process has a new program loaded into it.
 If a process terminates (either normally or abnormally), then all its children must also be
terminated. This phenomenon, referred to as cascading termination.
 A process is indpendent if it cannot affect or be affected by the other processes executing
in the system.
 A process is co operating if it can effect or be affected by the other processes executing in
the system.
There are several reasons for providing an environment that allows process cooperation.
* Information sharing * Computation speedup * Modularity * Convenience
 Inter Process Communication :
 IPC also referred as inter-thread communication and inter-application communication
 Co operating processes require an inter process communication (IPC) mechanism that
will allow them to exchange data and information.
 IPC methods are divided into methods for message passing. Synchronous , shared
memory, and remote procedure calls (RPC)
 There are two fundamental models of intr process communication :
1) Shared memory 2) Message passing
 The method of IPC used may vary based on the bandwidth and latency of
communication between the threads and type of data being communicated.
 Under direct communication, each process that wants to communicate must explicity
name the recipient or sender of the communication.
 With indirect communication, the messages are sent to and received from mailboxes, or
ports.

SAIMEDHA 5
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

Memory tables are used to keep track of both main (real) and secondary (virtual)
memory.
 I/O tables are used by the operatin system to manage the I/O devices and channels of the
computer system.
 The operating system may also maintain file tables. It provide information about the
existences of files, and their location.
 Operating system maintain process tables to manage processes.
 SOCKETS :
 A socket is defined as an end point for communication.
 A pair of processes communicating over a network employ a pair of sockets - one for
each process.
 A socket is identified by an IP address concatenated with a port number.
 Socket use a client - server architecture.
 THREAD :A thread is a basic unit of CPU utilization
 Threads are lightweight process and a unit of execution
 A thread of execution is the smallest unit of processing that can be scheduled by OS
 An executing instance of a program is called a process.
 A thread is a subset of process.
 Multi threading :
 Multi threading refers to the ability of an operating system to support multiple threads of
execution within in a single process.
 Threads also play a vital role in remote procedure call (RPC) systems. That RPCs allow
interprocess communication by providing a communication mechanism similar to ordinary
function or procedure calls.
 For one process multiple threads are created and those are called as sibling.
 Categories of Thread :

 A multithreaded process achieves concurrency without the overhead of using multiple


process.
 BENEFITS OF MULTITHREADED PROGRAMMING :
* Responsiveness * Resource sharing * Economy
* Utilization of multiprocessor architecture
 THREAD STATES :
An existing windows thread is in one of six states.
* Ready * Stand by * Running * Waiting * Transition *
Terminated

 As a default, the micro kernel uses the policy of soft affinity in assigning threads to
processors : The dispatcher tries to assign a ready thread to the same processor it last ran
on.

SAIMEDHA 6
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 It h elps reuse data still in that processor’s memory caches from the previous execution of
the thread.
 It is possible for an application to restrict its thread execution to contain processors (hard
affinity)
 Support for threads may be provided either at the user level, for user threads, or by the
kernel for kernel threads. There must exist a relatiohship between user threads and kernel
threads.
There are 3 common ways of establishing this relationship
1) Many - to - One Model 2) One-to-one model 3) Many - to - Many Model
 THREAD LIBRARIES :
 A thread library provides the programmer on API for creating and managing threads.
 There are two primary ways of implementing a thread library
 The first approach is to provide a library entirely in user space with no kernel support.
 All code and data structures for the library exist in user space.
 The second approach is to implement a kernel-level library supported directly by the
operating system. In this case, code and data structures for the library exist in kernel
space.
 Thread cancellation is the task of terminating a thread before it has completed.
 A thread that is to be cancelled is often referred to as the target thread. Cancellation of a
target thread may occur in two different scenarious :
i) Asynchronous cancellation ii) Deferred cancellation
 Symmetric multiprocessing is a method of organizing a multiprocessor system such that
any process (or thread) can run on any processor, this includes kernel code and processes.
 Race Condition : A race condition occurs when multiple processes or threads read and
write data items so that the final result depends on the order of execution of instructions in
the multiple processes.
 In non-preemptive scheduling, once the CPU has been allocated to a process, the process
keeps the CPU until it releases the CPU either by terminating or by switching to the
waiting state. Other wise it is pre-emptive scheduling
 The interval from the time of submission of a process to the time of completion is called
turn-around time.
 The time the process waits in the ready queue is called waiting time
 The interval from the time of submission to the first time the process responds is called
response time

 Process Synchronization
 Making co-operating processes to execute in an orderly way is called process
synchronization.
 Each process has a segment of code, called the critical section, in which the process may
be changing common variables.

SAIMEDHA 7
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 Page Fault :
 The main functions of paging are performed when a program tries to access pages that
are not currently mapped to physical memory (RAM). This situations known as page
fault.
 The set of pages that a process is currently using is called its working set
 If the entire working set is in memory, the process will run without causing many faults
until it move into another execution.
 Semaphore :
 A semaphore is a variable or abstract data type that provides a simple but useful
abstraction for controlling access by multiple processes to a common resource in a
parallel programming environment.
 Semaphores are a useful tool in the prevention of race conditions
 Semaphore is a synchronization tool. There are two types of semaphores.
1. Semaphores which allow on arbitrary resource count are called counting semaphores
2. Semaphores which are restricted to the values 0 and 1 (or locked / unlocked, un
available / available) are called binary semaphores.
 CPU - I/O BURST CYCLE :
 The success of CPU scheduling dependson an observed property of processes : Process
execution consists of a cycle of CPU execution and I/O wait.
 Processes alternate between these two states.
 Process execution begins with a CPU burst. That is followed by an I/O burst, which is
followed by another CPU burst, then another I/O burst, and so on.
 A CPU - bound program might have a few long CPU burts. This distribution can be
important in the selection of an appropriate CPU - scheduling algorithm
 SPOOLING :
 Acronym for simultaneous peripheral operations on- line
 Spooling refers to putting jobs in a buffer a special area in memory or on a disk where a
device can access then when it is ready
 Spooling is useful because devices access data at different rates.
 The buffer provides a waiting station where data can rest while the slower device
catches up.
 BUFFER :
 A buffer is a region of memory used to temporarily hold data while it is being moved
from one place to another.
 Buffers are typically used when there is a difference between the rate at which data is
received and the rate at which it can be processed.
 Buffers can be implemented in either hardware or software but mostly in software.
 DEADLOCK :
 Deadlock can be defined as the permanent blocking of a set of processes that either
compete for system resource or communicate with each other.
 A set of process is deadlocked when each process in the set is blocked awaiting an
event (typically the freeing up of some requested resource) that can only be triggered
by another blocked process in the set.
 Deadlock is permanent because none of the events is ever triggered.

SAIMEDHA 8
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 All deadlocks involve conflicting needs for resources by two or more processes.
The conditions for Deadlock :
1) Mutual Exclusion : Only one process may use a resource at a time. No process may
access a resource unit that has been allocated to another process.
2) Hold and Wait : A process may hold allocated resource while awaiting assignment of
other resources.
3) No Preemption : No resource can be forcibly removed from a process holding it.
4) Circular Wait : A closed chain of processes exists, such that each process holds at
least one resource needed by the next process in chain.

 DEADLOCK PREVENTION :
 Deadlock Prevention provides a set of methods for ensuring that at least one of the
necessary conditions cannot hold. These methods prevent deadlocks by constraining how
requests for resources can be made.
 The strategy of deadlock prevention is simply put, to design a system in such a way that
the possibility of deadlock is excluded.
 We can view deadlock prevention methods as falling into two classes.
1) An indirect method of deadlock prevention is to prevent the occurrence of one of the
three necessary conditions.
1) Mutual Exclusion 2) Hold and wait 3) No preemption
 A direct method of deadlock prevention is to prevent the occurrence of a circular wait.
 DEADLOCK AVOIDANCE :
 Deadlock avoidance, allows the three necessary conditions but makes judicious choices
to assure that the deadlock point is never reached.
 Deadlock avoidance requires that the operating system be given advance additional
information concerning which resources a process will requesting and use during its
lifetime.
 Banker’s algorithm is used for deadlock avoidance.
There are two approaches to deadlock avoidance :
 Do not start a process if its demands might lead to deadlock
 Do not grant an incremental resource request to a process if this allocation might lead
to deadlock.
 Methods for Handling Deadlocks :
We can deal with the deadlock problem in one of three ways.
 We can use a protocol to prevent or avoid deadlocks ensuring that the system will never
enter a deadlock state.
 We can allow the system to enter a deadlock state, detect it and recover.
 We can ignore the problem altogether and pretend that deadlock never occur in the
system.
 Resource Allocation Denial :
 The strategy of resource allocation denial, referred to as the banker’s algorithm, was
first proposed in [DIJK 65]
 At any time a process may have zero or more resources allocated to it.

SAIMEDHA 9
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 The state of the system reflects the current allocation of resource to processes, thus,
state consists of the two vectors, resource and available and two matrices, claim and
allocation.
 A safe state is one in which there is at least one sequence of resource allocations to
processes that does not result in a deadlock.
 An unsafe state is a state that is not safe.
 DEADLOCK DETECTION :
 Deadlock detection strategies do not limit resource acess or restrict process actions.
 With deadlock detection, requested resources are graned to processes whenever
possible.
 Periodically, the OS performs an algorithm that allows it to detect the circular wait
condition.
 RECOVERY FROM DEADLOCK :
Once deadlock has been detected, some strategy is needed for recovery.
There are two options for breaking a deadlock.
1) Simply to abort one or more processes to break the circular wait.
2) Preempt some resources from one or more of the deadlocked processes.
 ADDRESS BINDING
 The program resides on a disk as a binary executable file.
 The processes on the disk that are waiting to be brought into memory for execution
form the input queue.
 Address may be represented in different ways during loading the program into main
memory.
 Address in the source program are generally symbolic. A compiler will typically bind
these symbolic address to relocate address
The binding of instructions and data to memory addresses can be done at any step along
the way :
1) Compile Time
2) Hood Time
3) Execution Time
 An address generated by the CPU is commonly referred to as a logical address.
 An address seen by the memory unit-that is, the one loaded into the memory, address
register of the memory is commonly referred to as a Physical address.
 The run-time mapping from virtual to physical address is done by 4 hardware device called
Memory-management unit (MMU)
 With Dynamic Loading a routine is not loaded until it is called.
 This method is particularly useful when large amounts of code are needed to handle
infrequently such as error routines.
 Dynamic loading does not require special support from the OS.
 MEMORY MANAGEMENT : One of the most important and complex tasks of an
operating system is memory management.
Memory management involves treating main memory as a resource to be allocated to
shared among a number of active processes.
SAIMEDHA 10
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

The basic tools of memory management are paging and segmentation.


 Memory Management Techniques :
Fixed Partitioning : Main memory is devided into a process may be loaded into a partition
of equal or greater size.
 Dynamic Partitioning : Partitions are created dynamically, so that each process is loaded
into a partition of exactly the same size as that process.
 Simple Paging : Main memory is divided into a number of equal-size frames. Each
process is divided into a number of equal - size pages of the same length as frames. A
process is loaded by to ading all of its pages into available, not necessarily contiguous,
frames.
 Simple segmentation : Each process is divided into a number of segments. A process is
loaded by loading all of its segments into dynamic partitions that need not be contiguous.
 Virtual - Memory Paging : As with simple paging, except that it is not necessary to load
all f the pages of a process. Non resident pages that are needed are brought in later
automatically.
 SWAPPING :
 A process must be in memory to be executed. A process can be supported temporarily
out of memory to a backing store and then brought back into memory for continued
execution.
 Swapping requires a backing store.
 A variant of the swapping policy is used for priority - based scheduling algorithms.
 Dynamic storage Allocation Problem : Which concerns how to satisfy a request of size n
from a list of free holes.
 The first-fit, Best-fit and worst - fit strategies are the ones most commonly used to select a
free hole from the set of available holes.
 Both first-fit and Best-fit strategies for memory allocation suffer from external
fragmentation
 Solution to the problem of external fragmentation is compaction
 Virtual memory segmentation : As with simple segmentation, except that it is not
necessary to load all of the segments of a process. Non resident segments that are needed
are brought in later automatically.
 Internal Fragmentation : The phenomenon, in which there is wasted space internal to a
partition due to the fact that the block of data loaded is smaller than the partition, is
referred to as internal fragmentation.
 External fragmentation : It is indicating that the memory that is external ot all partitions
becomes increasingly fragmented. One technique for overcoming external fragmentation is
compaction.

SAIMEDHA 11
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 Fixed Partitioning : A fixed partitioning scheme limits the number of active processes and
may use space inefficiently if there is a poor match between available partition sixes and
process sizes.
 Dynamic Partitioning : A dynamic partitioning scheme is more complex to maintain and
includes the overhead of compaction.
 Buddy System : In a buddy system, memory blocks are available of size
where smallest size block that is allocated
Largest size block that is allocated
 A logical address is a reference to a memory location independent of the current
assignment of data to memory.
 A relativeaddress is a particular example of logical address, in whch the address is
expressed as a location relative to some known point.
 A physical address or absolute address, is an actual locating in main memory.
 PAGING : -
 The main memory is partitioned into equal fixed-size chunks that are relatively small
and each process is also divided into small fixed-size chunks of the same size.
 Then the chunks of a process, known as Pages, could be assigned to available chunks of
memory, known, as frames, or page frames.
 Every address generated by CPU is divided into two parts : Page number (P) and a
Page offset (d)
 Operating system maintains a Page table for each process. The page table shows the
frame location for each
 SEGMENTATION :
 A user program can be sub divided using segmentation in which the program and its
associated data are divided into a number of segments. Each segment has a name and a
length.
 Segmentation eliminates internal fragmentation but it suffers from external
fragmentation.
 Each segment table entry would have to give the starting address in main memory of
the corresponding segment.
 When a process enters the running state, the address of its segment table is loaded into
a special register used by the memory-management hardware.
 LINKING : The function of a linker is to take as input a collection of object modules and
procedure a load module, consisting of an integrated set of programs and data modules, to
be passed to the loader.
 Linkage Editor : The nature of this address linkage will depend on the type of load
module to be created and when the linkage occurs.
 Virtual Memory : Virtual memory allows for very effective multiprogramming and
relieves the user of the unnecessary tight constrains of main memory.
 With virtual memory, all address references are logical reference that are translated at
run time to real address.

SAIMEDHA 12
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

  This allows a process to be located anywhere in main memory and for that location to
change over time.
 Virtual memory allows a process to be broken up into pieces. Virtual memory can
allow pages to be shared during process creation with the fork ( ) system call, thus
speeding up process creation.
 Two basic approximates to providing virtual memory are paging and segmentation.
 It also possible to combine segmentation and paging in a single memory-management
scheme.
 A Virtual memory management scheme requires both hardware and software support.
 THRASHING : The high paging activity is called thrashing. A process is thrashing if it is
spending more time paging than executing.
 Locality Model is used to prevent thrashing
 Principle of locality states that program and data references within a process tend to
cluster.
 The page number (n) field is longer than the frame number field (m) [ n > m ]
 A number of design issues relate to OS support for memory management
1) Fetch Policy :
 The fetch policy determines when a page should be brought into main memory.
 The two common alternatives are
i) Demand Paging : A page is brought into main memory only when a reference is made
to a location on that page.
ii) Prepaging : Pages other than the demand by a page fault are brought in
2) Placement Policy 3) Replacement Policy
4) Resident set management 5) Cleaning Policy 6)
Load Control
 A Lazy Swapper never swaps a page into memory unless that page will be needed.
 A swapper manipulates entire processes, whereas a pager is concerned with the
individual pages of a process. Thus we use pager, rather than swapper, in connection
with demand paging.
 When the bit is set to “valid”, the associated page is both legal and in memory.
 If the bit is set to “invalid”, the page either is not valid (i.e, not in the logical address space
of the process) or is valid but is currently on the disk.
 Access to a page marked invalid causes a Page-fault trap.
 Reentrat code (or Pure Code) is non-self-modifying code ; it never changes during
execution. Thus, two or more processes can execute the same code at the same time.
 HASHED PAGE TABLE :
 A common approach for handling address spaces larger than 32 bits is to use a hashed
page table, with the hash value being the virtual page number.
 Each entry in the hash table contains a linked list of elements that hash to the same
location (to handle collisions).
 Each element consists of three fields :
1) the virtual page number
2) the value of the mapped page frame and
SAIMEDHA 13
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

3) a pointer to the next element in the linked list.


 A approach for handling address space of 64-bit is to use a clustered page tables :
 INVERTED PAGE TABLES :
 An invented page table has one entry for each real page (or frame) of memory.
 Each entry consists of the virtual address of the page stored in that real memory
location, with information about the proces that owns that page.
 Copy - on-Write which works by allowing the parent and child processes initially to share
the same pages.
 Zero-fill-on demand pages have been zeroes - out before being allocated, thus erasing the
previous contents.
 STORAGE MANAGEMENT :
 Since main memory is usually too small to accommodate all the data and programs
permanently, the computer system must provide secondary storage to back up main
memory.
 Modern computer systems use disks as the primary on-line storage medium for
information.
 The file system provides the mechanism for on-line storage of and access to both data
and programs residing on the disks.
 FILE SYSTEM :
 The file system permits uses to create data collections, called files, with desirable
properties such as
1) Long - term existance 2) Sharable between processes
3) Structure
 Any file system provides not only a means to store data organized as files, but a
collection of functions that can be performed on files
1) Create 2) Delete 3) open 4) close 5) Read 6) Write
 File Structure :
Four terms are in common use when discussing files :
1) Field 2) File 3) Record 4) Database
 File Management Systems :
 A file management system is that set of system software that provides services to users
and applications in the use of files.
 The only way that a user or application may access files is through the file
management system.
 The lowest level, 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
drivers to read and write physical blocks on the disk.
 The file-organization module knows about files and their logical blocks as well as
physical blocks.

SAIMEDHA 14
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

 The file-organization module also includes the free-space manager, which tracks
unallocated blocks and provides these blocks to the file-organization module when
requested.
 The logical file system manages metadata information. It also responsible for protection
and security
 A file-control block (FCB) contains information about the file, including ownership,
permissions, and location of the file contents.
 A boot control Block (per volume) can contain information needed by the system to boot
an OS from that volume.
 In UFS ( Unix file system). It is called the boot block ; in NTFS, it is the partition boot
sector.
 PARTITION AND MOUNTING :
 A disk can be sliced into multiple positions or a volume can span multiple partitions on
multiple disks.
 Each partition can be either “raw”, containing no file sy system, or “cooked”,
containing a file system.
 Raw disk is used where no file system is appropriate.
 The root partition, which contains the OS Kernel and sometimes other system files, is
mounted at boot time.
 Allocation Methods : Three major methods of allocating disk space are in wide use :
1) Contiguous 2) Linked 3) Indexed
 Bit Vector :
 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.

PRACTICE SET - I

01. Page fault occurs when


1) Page is corrupted by application software 2) The page is in main memory
3) The page is not in main memory 4) One tries to divide a number by 0
02. If the property of locality of reference is well pronounced in a program
1) The number of page faults will be more
2) The number of page faults will be less
3) The number of page faults will remain same 4) Execution will be faster
03. A memory page containing heavily used variable that was initialized very early and is in
constant, is removed when ___ page replacement algorithm was used
1) LRU 2) FIFO 3) LFU 4) None
04. Preemptive scheduling is the strategy of temporirily suspending a running process
1) Before the CPU time slice expires 2) To allow starving process to run
3) When it requests I/O 4) None
05. ___ Disk scheduling policy is to select the disk I/O request that requires the least
movement of the disk arm from its current position.

SAIMEDHA 15
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

1) FIFO 2) Random 3) SSTF 4) SCAN


06. C-SCAN means
1) Complete SCAN 2) Concurrent SCAN
3) Circular SCAN 4) Coherent SCAN
07. A closed chain of processes exists, such that each process holds at least one resource
needed by next process in the chain” is stated by ___ condition
1) Mutual Exclusion 2) Hold and Wait 3) No Preemption 4) Circular wait
08. ‘No resource can be forcibly removed from a purpose holding it”. is stated by ____
condition of deadlock
1) Mutual Exclusion 2) Hold and wait 3) No preemption 4) Circularwait
09. A partitioned data set is most used for
1) a program or source library 2) Storing program data
3) Storing back up information 4) Storing ISAM files
10. The first-fit, best-fit and the worst - fir algorithm can be used for
1) Contiguous allocation of memory 2) Linked allocation of memory
3) indexed allocation of memory 4) all of the above
11. In a multiprogramming environment
1) the processor executes more than one process at a time
2) the programs are developed by more than one person
3) more than one process is resident in memory
4) a single user can execute many programs in the same time
12. Which of the following page replacement algorithm suffers from Belady’s anamoly
1) Optimal replacement 2) LRU
3) FIFO 4) both optimal replacement and FIFO
13. In a two pass assembler the object code generating is done during the
1) second pass 2) first pass
3) zeroth pass 4) not done by the assembler
14. In a two pass assembler adding literals to literals so literal table and address resolution of
focal symbols are done during
1) first pass and second pass respectively 2) both second pass
3) second pass and first respectively 4) both first pass
15. Translator for low level programming language were termed as
1) Assembler 2) Compiler 3) Linker 4) Loader
16. Load address for the first word of the program is called
1) Linker address origin 2) load address origin 3) Phase library 4) absolute library
17. Symbolic names can be associated with
1) Information 2) data or instruction 3) operand 4) mnemonic
operation
18. The “blocking factor” of a file is
1) The number of blocks accessible to a file 2) The number of blocks allocated to a
file
3) The number of logical records in one physical record
4) None of the above
19. An operating system contains 3 user processes each requiring 2 units of resource R. The
minimum number of units of R such that no deadlocks will ever arise is
1) 4 2) 3. 3) 5. 4) 6.

SAIMEDHA 16
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

20. Locality of reference implies that the page reference being made by a process
1) will always be to the page used in the previous page reference
2) is likely to be the one of the pages usede in the last few page references
3) will always be to one of the pages existing in memory
4) will always lead to a page fault
21. Which of the following is not a key piece of information, stored in single page table entry,
assuming pure paging and virtual memory
1) Frame number
2) A bit indicating whether the page is in physical memory or on the disk
3) A reference for the disk block that stores the page 4) None of the above
22. Which amongst the following is not a valid page replacement policy ?
1) LRU policy (Least Recently Used) 2) FIFO policy (First in first out)
3) RU policy (Recurrently used) 4) Optimal page replacement policy
23. Jobs which are admitted to the system for processing is called
1) long-term scheduling 2) short - term scheduling
3) medium-term scheduling 4) queuing
24. Virtual memory is
1) simple to implement
2) used in all major commercial operating system 3) less efficient in utilization of memory
4) useful when fast I/O devices are not available
25. Page stealing
1) is a sign of efficient system 2) is taking page frames other working
sets
3) should be the tuning goal
4) is taking larger disk spaces for pages paged out
26. The memory allocation scheme subject to “external” fragmentation is
1) segmentation 2) swapping
3) pure demand paging 4) multiple fixed contiguous partitions
27. Page fault occurs when
1) the page is corrupted by application software 2) the page is in main memory
3) the page is not in main memory 4) one tries to divide a number by 0
28. Overlay is
1) a part of an operating system 2) a specific memory location
3) a single contiguous memory that was used in the olden days for running large programs
by swapping
4) overloading the system with many user files
29. Determine the number of page faults when reference to pages occur in order -1, 2, 4, 5,
2,1,2,4. Assume that the main memory can accommadate 3 pages and the main memory
already has t he pages 1 and 2, with page 1 having been brought earlier than page 2.
(Assume LRU algorithm is used)
1) 3 2) 5 3) 4 4) none of the above
30. Concurrent processes are processes that
1) do not overlap in time2) overlap in time
3) are executed by a processor at the same time 4) none of the above
31. Supervisor call
1) is a call made by the supervisor of the system 2) is a call with control functions

SAIMEDHA 17
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

3) are privileged calls that are used to perform resource management functions, which are
controlled by the operating system
4) is a call made by someone working in root directory
32. Fence register is used for
1) CPU protection 2) memory protection
3) file protection 4) all of the above
33. Which of the following is a service not supported by the operating system ?
1) Protection 2) Accounting 3) Compilation 4) I/O operation
34. The first fit, best- fit and the worst - fit algorithms can be used for
1) contiguous allocation of memory 2) linked allocation of memory
3) indexed allocation of memory 4) all of the above
35. Which of the following is single-user operating system ?
1) MS - DOS 2) UNIX 3) OS/2 4) None of these
36. Which of the following are true ?
1) A re-entrant procedure can be called any number of times
2) A re-entrant procedure can be called even before the procedure has not returned from its
previous call
3) Re-entrant procedures cannot be called recursively 4) None of these
37. A state is safe if the system can allocate resources to each process (up to its maximum) in
some order and still avoid deadlock.
1) Deadlocked state is unsafe 2) Unsafe state may not be lead to a deadlock
situation
3) Unsafe state must lead to a deadlock situation 4) None of these
38. The size of the virtual memory depends on the size of the
1) data bus 2) main memory 3) address bus 4) none of the above
39. In which of the following scheduling policies does context switching never take place ?
1) Round- robin 2) Shortest job first
3) Pre-emptive 4) None of these
40. In which of the following directory systems, is it possible to have multiple complete paths
for a file, starting from the root directory ?
1) Single - level directory 2) Two-level directory
3) Tree structured directory 4) Acyclic graph directory
41. Suppose that a process is in “BLOCKED” state waiting for some I/O service. When the
service is completed, it goes to the
1) RUNNING state 2) READY state 3) SUSPENDED state 4) TERMINATED state
42. In a system that does not support swapping
1) the compiler normally binds symbolic addresses (variables) to relocatable addresses
2) the compiler normally binds symbolic addresses to physical addresses
3) user programs can implement dynamic loading without any special support from the
operating system or the hardware
4) None of these
43. To obtain better memory utilization, dynamic loading is used. With dynamic loading, a
routine is not loaded until it is called. For implementing dynamic loading
1) special support from hardware is essential
2) special support from operating system is essential
3) special support from both hardware and operating system are essential

SAIMEDHA 18
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

4) user programs can implement dynamic loading without any special support from the
operating system or the hardware
44. Which of the following is true ?
1) The linkage editor is used to edit programs which have to be later linked together
2) The linkage editor links object modules during compiling or assembling
3) The linkage editor links object modules and resolves external references between them
before loading
4) The linkage editor resolves external references between the object modules during
execution time
45. Which of the following application is well suited for batch processing
1) Process control 2) Video game control 3) Preparing pay bills of employees 4) None
of these
46. Locality of reference implies that the page reference being made by a process
1) will always be to the page used in the previous page reference
2) is likely to be one of the pages used in the last few page references
3) will always be one of the pages existing in memory 4) will always leads to a page
fault
47. An operating system uses Shortest Remaining Time first (SRT) process scheduling
algorithm. Consider the arrival times and execution times for the following processes :

48. The essential content(s) in each entry of a page table is/are


1) virtual page number 2) page frame number
3) both virtual page number and page frame number
4) access right information
49. A multilevel page table is preferred in comparison to a single level page table for
translating virtual address to physical address because
1) it reduces the memory access time to read or write a memory location
2) it helps to reduce the size of page table needed to implement the virtual address space of
a process
3) it is required by the translation look aside buffer.
4) it helps to reduce the number of page faults in page replacement algorithms
50. Which of the following statments are true ?
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
1) I only 2) I and II only 3) II and III only 4) I, II and III
51. What is the correct matching for the following pairs?
A) Disk scheduling 1) Round robin
B) Batch Processing 2) SCAN
C) Time sharing 3) LIFO
D) Inrerrupt processing 4) FIFO
1) A-3, B-4, C-2 and D-1 2) A-4, B-3, C-2 and
D-1
3) A-2, B-4, C-1 and D-3 4) A-2, B-1, C-4 and
D -3
52. Dirty bit for a page in a page table

SAIMEDHA 19
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

1) helps avoid unnecessary writes on a paging device


2) helps maintain LRU information
3) allows only read on a page 4) none of the above
53. In a multiprogramming environemnt
1) the processor executes more than one process at a time
2) the programs are developed by more than one person
3) more than one process resides in the memory
4) a single user can execute many programs at the same time
54. Which of the following scheduling policy is well suited for a time-shared operating system
?
1) Shortest job first 2) Round robin
3) First - come - first - serve 4) Elevator
55. A memory page containing a heavily used variable that was initialized very early and is in
constant use is removed, when the page replacement algorithm used is
1) LRU 2) FIFO 3) LFU 4) none of the above

PRACTICE SET - I KEY


01) 3 02) 2 03) 2 04) 1 05) 3 06) 3 07) 4 08) 3 09) 2 10) 1
11) 3 12) 3 13) 1 14) 4 15) 1 16) 2 17) 2 18) 3 19) 1 20) 2
21) 3 22) 3 23) 1 24) 2 25) 2 26) 1 27) 3 28) 3 29) 3 30) 2
31) 3 32) 2 33) 3 34) 1 35) 1 36) 2 37) 1 38) 3 39) 2 40) 4
41) 2 42) 1 43) 4 44) 3 45) 3 46) 2 47) 48) 2 49) 2 50) 4
51) 3 52) 1 53) 3 54) 2 55) 2

PRACTICE SET - II
01. Virtual Memory is ___
1) An Extremely Large Main Memory 2) An Extremely Large Secondary
Memory
3) An illusion of Extremely Large Memory
4) A type of Memory used in super computers
02. The size of the virtual memory depends on
1) The size of data bus 2) The size of main memory
3) The size of address bus 4) None
03. Suppose that a process is in blocked state waiting for some I/O service. When the service
is completed, it goes to the ___state
1) Running 2) Ready 3) Suspended 4) Terminated
04. Real time systems are
1) Primarily used on mainframe computers
2) Used for Monitoring events as they occur
3) Used for program development 4) Used for real time interactive users
05. Memory management is
1) Not used in Modern Operating system

SAIMEDHA 20
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

2) Replaced with virtual memory on concurrent systems


3) Not used on multi programming systems
4) Critical for even the simplest operating systems
06. In Preemptive mode, the currently running process may be -interrupted and moved to ___
state
1) Ready 2) Blocked 3) Suspended 4) Terminated
07. The pieces or chunks of program that are in variable length are called ____
1) Pages 2) Blocks 3) Segments 4) Functions
08. ____ in the actual location in main memory ?
1) Relative address 2) logical address 3) physical address 4)
none
09. Fixed partitioning suffers from ___ issue
1) internal fragmentation 2) external fragmentaiton
3) compaction 4) none
10. Fragmentation of the file system
1) Occurs only if the system is used improperly 2) Can always be prevented
3) Can be temporarily is moved by compaction
4) Is a characteristic of all file systems
11. Overlay is
1) A partofan Operating system 2) A single memory location
3) A single contiguous memory that is used in olden days for running large program by
swapping
4) overloading the system with many user files
12. In a paged memory, the page hit ratio is 0.35. The time required to access a page in
secondary memory is equal to 100ns. The time required to access a page in primary
memory is 10ns. The average time required to access a page is
1) 3.0ns 2) 68.0ns 3) 68.5ns 4) 78.5ns
13. In a two pass assembler defining symbols is done in
1) second pass 2) first pass 3) zeroth pass 4) none of the above
14. A program in execution is called
1) Process 2) Instruction 3) Procedure 4) Function
15. Interval between the time of submission and completion of the job is called
1) Waiting time 2) Turnaround time 3) Throughput 4) Response time
16. A scheduler which selects processes from secondary storage device is called
1) Short term scheduler 2) Long term scheduler
3) Medium term scheduler 4) Process scheduler
17. Which of the following approaches do not require knowledge of the system state ?
1) deadlock detection 2) deadlock prevention
3) deadlock avoidance 4) none of the above
18. Program generation activity aims at
1) Automatic generation of program
2) Organize execution of a program written in PL
3) Skips generation of program 4) Speedens generation of program
19. Which of these is a component of a process precedence sequence ?
1) Process time 2) Sequence operator
3) Concurrency operator 4) All of the above

SAIMEDHA 21
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

20. The expansion of nested macro calls follows


1) FIFO rule 2) LIFO rule 3) LILO rule 4) Prioriyt rule
21. In a two-pass assembler, the task of the Pass II is to
1) separate the symbol, mnemonic opcode and operand fields
2) build the symbol table 3) construct intermediate code
4) synthesize the target program
22. An assembly language is a
1) low level programming language 2) Middle level programming language
3) High level programming language 4) Internet based programming language
23. Action implementing instruction’s meaning are a actually carried out by
1) Instruction fetch 2) Instruction decode
3) Instruction execution 4) Instruction program
24. A set of techniques that allows to execute a program which is not entirely in memory is
called
1) demand paging 2) virtual memory
3) auxiliary memory 4) secondary memory
25. Relocation bits used by relocating loader are specified by
1) Relocating loader itself 2) Assembler or Translator
3) Macro processor 4) Both 1 and 2
26. The total time to prepare a disk drive mechanism for a block of data to be read from is its
1) latency 2) latency plus transmission time
3) latency plus seek time
4) latency plus seek time plus transmission time
27. Page fault frequency in an operating system is reduced when the
1) processes tend to the I/O-bound 2) size of pages is reduced
3) processes tend to the CPU -bound
4) locality of reference is applicable to the process
28. Which of the following are language processors ?
1) Assembler 2) Compiler 3) Interpreter 4) All of the above
29. Virtual memory can be implemented with
1) segmentation 2) Paging 3) None 4) all of the above
30. A public key encryption system
1) Allows only the correct receiver to decode the data
2) Allows only one to decode the transmission
3) Allows only the correct sender to decode the data
4) Does not encode the data before transmitting it.
31. Spatial locality refers to the problem that once a location is referenced
1) it will not be referenced again 2) it will be referenced again
3) a nearby location will be referenced soon 4) none of these
32. Which of the following is an example of a SPOOLED device ?
1) The terminal used to enter the input data for program being executed
2) The secondary memory device in a virtual memory system
3) A line printer used to print the output of a number of jobs
4) None of the above
33. The page replacement policy that sometimes leads to more page faults when the size of the
memory is increased is

SAIMEDHA 22
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

1) FIFO 2) LRU
3) no such policy exists 4) none of the above
34. The only state transition that is initiated by the user process itself is
1) block 2) dispatch 3) wakeup 4) none of the above
35. Working set (t,k) at an instant of time, t, is the set of
1) k future references that the operating system will make
2) future references that the operating system will make in the next ‘k’ time units
3) k references with high frequency
4) pages that have been referenced in the last k time units
36. In Round Robin CPU scheduling, as the time quantum is increased, the average turn
around time
1) increases 2) decreases
3) remains constant 4) varies irregularly
37. Which of the following is true ?
1) Overlays are used to increase the size of physical memory
2) Overlays are used to increase the logical address space
3) When overlays are used, the size of a process is not limited to the size of physical
memory
4) Overlays are used whenever the physical address space is smaller than the logical
address space
38. In partitioned memory allocation scheme, the
1) best fit algorithm is always better than the first fit algorithm
2) first fit algorithm is always better than the best fit algorithm
3) superiority of the first fit and best-fit algorithms depend on the sequence of memory
requests
4) none of the above
39. Cascading termination refers to termination of all child processes before the parent
terminates
1) normally 2) abnormally
3) normally or abonormally 4) none of the above
40. For implementing a multiprogramming operating system
1) special support from processor is essential
2) special support from processor is not essential
3) cache memory must be available 4) more than one processor must be
available

PRACTICE SET - II KEY


01) 3 02) 3 03) 2 04) 4 05) 2 06) 1 07) 3 08) 3 09) 1 10) 3
11) 3 12) 3 13) 2 14) 1 15) 2 16) 2 17) 4 18) 1 19) 4 20) 2
21) 4 22) 1 23) 3 24) 2 25) 2 26) 3 27) 4 28) 4 29) 2 30) 1
31) 3 32) 3 33) 1 34) 1 35) 2 36) 4 37) 2 38) 3 39) 3 40) 2

SAIMEDHA 23
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

PRACTICE SET - III


01. Fragmentation is
1) Dividing the Secondary memory into equal size fragments
2) Dividing the main memory into equal size of fragments
3) Fragments of memory words used in a page
4) fragments of memory used in a page
02. Dirty bit is used to show the
1) Page with corrupted the 2) Wrong page in memory
3) Page that is modified after being loaded into cache memory
4) None of the above
03. Banker’s algorithm is the strategy used for ___
1) Deadlock Detection 2) Deadlock Prevention
3) Deadlock Avoidance 4) Deadlock Recovery
04. ____ CPU scheduling determines which programs are admitted to the system for
processing.
1) Long term 2) Medium Term 3) I/O 4) Short Term
05. The page replacement policy that some times leads to more faults when the size of the
memory is increased is
1) FIFO 2) LRU 3) No such policy exists 4) None
06. critical region is
1) A part of the operating system which is not allowed to be accessed by any process
2) A set of instructions that across common shard resource which exclude one another in
time
3) The portion of them an memory which can be accessed only be one process at a time
4) none of the above
07. The output of Lexical analyzer is
1) a set regular expressions 2) syntax tree
3) set of tokens 4) string of characters
08. Output in an Assembler is
1) source code 2) assembly code
3) intermediate code 4) machine code
09. An assembler is
1) programming language dependent 2) syntax dependent
3) machine dependant 4) data dependant
10. Which of the following is not a fundamental process state
1) ready 2) terminated 3) executing 4) blocked
11. ‘LRU’ page replacement policy is
1) Last Replaced Unit 2) Last Restored Unit
3) Least Recently Used 4) Least Required Unit
12. Which of the following loader is executed when a system is first turned on or restarted
1) Boot loader 2) Compile and Go loader
3) Bootstrap loader 4) Relating loader
13. Poor response time is usually caused by
1) Process busy 2) High I/O rates
3) High paging rates 4) Any of the above

SAIMEDHA 24
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

14. “Throughput” of a system is


1) Number of programs processed by it per unit time
2) Number of times the program is invoked by the system
3) Number of requests made to a program by the system 4) None of the above
15. Nested Macro calls are expanded using the
1) FIFO rule (First in first out) 2) LIFO (Last in Fist out)
3) FILO rule (First in last out) 4) None of the above
16. A linker program
1) places the program in the memory for the purpose of execution
2) relocates the program to execute from the specific memory area allocated to it.
3) links the program with other programs needed for its execution
4) interfaces the program with the entities generating its input data.
17. Which scheduling policy is most suitable for a time-shared operating system
1) Shortest-job First 2) Elevator
3) Round-Robin 4) First-Come-First-Serve
18. A critical section is a program segment
1) which should run in a certain specified amount of time
2) which avoids deadlocks
3) Where shared resources are accessed.
4) which must be enclosed by a pair of semaphore operations, P and V.
19. TII stands for
1) Table of incomplete instructions 2) table of information instructions
3) translation of instructions information 4) translation of information instruction
20. The field that contains a segment index or an internal index is called
1) target datum 2) target offset 3) segment field 4) fix dat
21. A program in execution is called
1) process 2) function 3) CPU 4) Memory
22. SSTF stands for
1) Shortest-seek-time-first scheduling 2) small-small-time-first
3) simple-seek-time-first scheduling 4) small-simple-time-first
23. Before proceeding with its execution, each process must acquire all the resources it needs
is called
1) hold and wait 2) No pre-emption 3) circular wait 4) starvation
24. Resolution of externally defined symbols is performed by
1) Linker 2) Loader 3) Compiler 4) Editor
25. Relocatable programs
1) cannot be used with fixed partitions
2) can be loaded almost anywhere in memory
3) do not need a linker 4) can be loaded only at one specific
location
26. To avoid race condition, the maximum nmber of processes that may be simultaneously
inside the critical section is
1) zero 2) one 3) two 4) more than two
27. In which of the following page replacement policies Balady’s anomaly occurs ?
1) FIFO 2) LRU 3) LFU 4) NRU

SAIMEDHA 25
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

28. _____ is a technique of temporarily removing inactive programs from the memory of
computer system
1) Swapping 2) Spooling 3) Semaphore 4) Scheduler
29. ____ is a technique of improving the priority of process waiting in Queue for CPU
allocation
1) Starvation 2) Ageing 3) Revocation 4) Relocation
30. File record length
1) Should always be fixed 2) Should always be variable
3) Depends upon the size of file
4) Should be chosen to match the data characteristics
31. If the property of locality of reference is well pronounced in a program
1) the number of page faults will be more 2) the number of page faults will be less
3) the number of page faults will remain the same 4) none of these
32. At a particular time of computation, the value of counting semaphore is 7. Then 20 P
operations and ‘x’ V operations were completed on this semaphore. If the final value of the
semaphore is 5, x will be
1) 15 2) 22 3) 18 4) 13
33. Sector interleaving in disks is done by
1) the disk manufacturer 2) the disk controller cord
3) the operating system 4) none of the above
34. Memory protection is of no use in a
1) single user system 2) non-multiprogramming system
3) non-multitasking system 4) none of the above
35. Disk scheduling involves deciding
1) which disk should be accessed next
2) the order in which disk access requests must be serviced
3) the physical location where files should be accessed in the disk
4) none of the above

PRACTICE SET - III KEY


01) 2 02) 3 03) 3 04) 1 05) 1 06) 2 07) 3 08) 4 09) 3 10) 4
11) 3 12) 3 13) 4 14) 1 15) 2 16) 3 17) 3 18) 3 19) 1 20) 1
21) 1 22) 1 23) 1 24) 1 25) 2 26) 2 27) 1 28) 1 29) 2 30) 4
31) 2 32) 3 33) 3 34) 4 35) 2

SELF TEST
01. Scheduling is
1) Allowing jobs to use the processor 2) Unrelated to performance
consideration
3) Not required in uni processor systems 4) The same regardless of the purpose of
the system
02. Object code
1) is ready to execute

SAIMEDHA 26
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

2) is the output of compilers but not assemblers


3) must be loaded before execution 4) must be rewritten before execution
03. ___ is a collection of related fields.
1) file 2) database 3) record 4) none
04. The time is takes for the beginning of the sector to reach the head is known as ___
1) Access time 2) Seek time
3) Rotational Delay 4) Disk time
05. RAID stands for ____
1) Reduced Array of Independent Disks 2) Redundant Array of Integrated Disks
3) Redundant Array of Inexpensive Disks 4) Reduced Array of Inexpensive Disks
06. Dynamic partitioning suffers from ___ issue
1) Internal fragmentation 2) External fragmentation
3) Compaction 4) None
07. File record length
1) should always be fixed 2) should always be variable
3) depends upon the size of the file
4) should be chosen to match the data characteristics
08. Dikstra’s banking algorithm in an operating system solves the problem of
1) deadlock avoidance 2) deadlock recovery
3) Mutual Exclusion 4) Contextswitching
09. Necessary conditions fordeadlock are
1) non preemption and circular wait 2) mutual exclusion and partial location
3) both 1 and 2 4) none of the above
10. Which of the following is a service not supported by the operating system
1) Protection 2) Accounting 3) Compilation 4) I/O operation
11. The page replacement policy that some times leads to more page faults when the size of the
memory is increased is
1) FIFO 2) LRU
3) No such policy exists 4) None of the above
12. Memory protection is normally done by
1) The processor and the associated hardware 2) The operating system
3) The compiler 4) The user program
13. The scheduling in which CPU is allocated to the process with least CPU-burst time is
called
1) Priority Scheduling 2) Shortest job first Scheduling
3) Round Robin Scheduling 4) Multilevel Queue Scheduling
14. The term ‘page traffic’ describes
1) number of pages in memory at a given instant.
2) number of papers required to be brought in at a given page request
3) the movement of pages in and out of memory
4) number of pages of executing programs loaded in memory.
15. The ‘turn-around” time of a user job is the
1) time since its submission to the time its results become available
2) time duration for which the CPU is allotted to the job
3) total time taken to execute the job
4) time taken for the job to move from assembly phase to completion phase

SAIMEDHA 27
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

16. Memory utilization factor shall be computed as follows


1) memory in use/allocated memory
2) memory in use/total memory connected
3) memory allocated / free existing memory
4) memory committed / total memory available
17. Program ‘preemption’ is
1) forced de allocation of the CPU from a program which is executing on the CPU
2) release of CPU by the program after completing its task
3) forced allotment of CPU by a program to itself
4) a program terminating itself due to detection of an error.
18. ____ is the time required by a sector to reach below read/write head
1) Seek Time 2) Latency Time 3) Access Time 4) None
19. Fragmentation is
1) dividing the secondary meory into equal sized fragments
2) dividing the memory into equal - sized fragments
3) fragments of memory words used in a page
4) fragmentsof memory words unused in a page
20. Which of the following are real - time systems ?
1) An online railway reservation system 2) A process control system
3) Payroll processing system 4) None of these
21. Dijkstra’s banking algorithm in an operating system solves the problem of
1) deadlock avoidance 2) deadlock recovery
3) mutual exclusion 4) context switching
22. Critical region is
1) a part of the operating system which is not allowed to be accessed by any process
2) a set of instruction that access common shared resource which exclude one another in
time
3) the portion of the main memory which can accessed only by one process at a time
4) none of the above
23. Kernel is
1) considered as the critical part of the operating system
2) the software which monitors the operating system
3) the set of primitive functions upon which the rest of operating system functions are built
up
4) none of the above
24. With a single resource, deadlock occurs
1) if there are more than two processes competing for tht resource
2) If there are only two processes competing for that resource
3) if there is a single processes competing for that resource 4) none of the above
25. Necessary conditions for deadlock are
1) non-preemption and circular wait 2) Mutual exclusion and partial
allocation
3) both 1 and 2 4) none of the above
26. Pre-emptive scheduling is the strategy of temporarily suspending a running process
1) before the CPU time slice expires 2) to allow starving processes to run
3) when it requests I/O 4) none of the above

SAIMEDHA 28
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

27. Mutual exclusion problem occurs


1) between two disjoint processes that do not internet
2) among processes that share resources
3) among processes that do not use the same resource
4) none of the above
28. In paged memory systems, if the page size is increased, then the internal fragmentation
generally
1) becomes less 2) becomes more 3) remains constant 4) none of the
above
29. An operating system contains 3 user processes each requiring 2 units of resource R. The
minimum number of units of R such that no deadlock willever occur is
1) 3 2) 4 3) 5 4) 6
30. In a time-sharing operating system, when the time slot given to process is completed, the
process goes from the RUNNING state to the
1) BLOCKED state 2) READY state 3) SUSPENDED state 4) TERMINATED
state
31. Semaphores are used to solve the problem of
1) race condition 2) process synchornization
3) process condition 4) none of these
32. Dirty bit is used to show the
1) page with corrupted data 2) wrong page in the memory
3) page that is modified after being loaded into cache memory
4) page that is less frequently accessed
33. Thrashing
1) reduces page I/O 2) decreases the degree of
multiprogramming
3) implies excessive page I/O 4) Improves the system performance
34. In which one of the following page replacement policies. Belady’s anomaly may occur ?
1) FIFO 3) Optimal 3) LRU 4) MRU
35. When an interrupt occurs, an operating system
1) ignores the interrupt
2) always changes the state of the interrupted process after processing the interrupt
3) always resumes execution of the interrupted process after processing the interrupt
4) may change the state of the interrupted process to “blocked” and schedule another
process

SELF TEST KEY


01) 1 02) 3 03) 3 04) 3 05) 3 06) 2 07) 4 08) 1 09) 3 10) 3
11) 1 12) 2 13) 2 14) 3 15) 3 16) 2 17) 1 18) 2 19) 2 20) 2
21) 1 22) 2 23) 3 24) 4 25) 3 26) 1 27) 2 28) 2 29) 2 30) 2
31) 2 32) 3 33) 3 34) 1 35) 4

SAIMEDHA 29
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

PREVIOUS ECET BITS


2012
01. What is meant by a Process ?
1) A program written in high level language and stored on the disk
2) A program is execution
3) A job stored in the secondary memory
4) A job available in the main memory
02. A computer system cannot boot if the ____is not available on it
1) Loader 2) Linker 3) Interpreter 4) Operating System
03. What is the use of Job Control Language (JCL) statements ?
1) Allocate the CPU to a job
2) Read the input from one device to another device
3) Inform the OS, the start and end of a job in a batch
4) For managing the memory
04. Which strategy allows the processes that are logically runnable to be temporarily
suspended?\
1) Shortest Job First 2) First come First served
3) Non-preemptive scheduling 4) Round Robin
05. ___ algorithm executes the shortest job first that has entered the queue of jobs
1) FIFO 2) SJF 3) Round Robin 4) LIFO
06. Fragmentation of the file system can be temporarily avoided by
1) Thrashing 2) CPU scheduling 3) Compaction 4) I/O devices
scheduling
07. What is a page fault?
1) An error that occurs while a program accesses a page in the memory
2) An access to a page that is currently not available in the memory
3) A reference to a page of another program
4) An error which is page specific
08. Belady’s Anomaly is a behaviour of _____ page replacement algorithm.
1) Optimal 2) LRU 3) Circular FIFO 4) FIFO
09. What is the special software used to create a job queue?
1) Device driver 2) Spooler 3) Linker 4) Loader
10. Which of the following is an advantage of virtual memory?
1) Processes can be given priority
2) Programs larger than the physical memory size can be run
3) Faster access to memory on an average
4) Linker can assign addresses independent of where the program will be loaded in
physical memory
11. Which of the following is an advantage of memory interlacing
1) A large memory is obtained 2) A non-volatile memory is obtained
3) The cost of the memory is reduced
4) Effective speed of the memory is increased
2011
12. Which of the following are shared between a parent process and a child process?
1) External variables 2) Local variables 3) Pointer variables 4)
Pipes
SAIMEDHA 30
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

13. ____ removes a deadlock by aborting some processes so that other processes involved in
the deadlock can resume their operation
1) Deadlock resolution 2) Deadlock detection
3) Deadlock occurence 4) Deadlock avoidance
14. The sleeping barber problem is an example of
1) deadlock 2) starvation 3) semaphore 4) live lock
15. Interrupt disabling is not possible in a ___
1) uniprocessor architecture 2) multiprocessor architecture
3) multiprogramming architecture 4) uniprogramming architecture
16. A user process enters kernel mode by issuing a __when an exception is generated
1) program 2) routine 3) handler 4) system call
17. Round Robin is the preemptive version of
1) FIFO 2) LCFS 3) SJF 4) FCLS
18. ____ are used to keep track of both main and secondary memory
1) Process tables 2) File tables 3) Memory tables 4) I/O tables
2010
19. Allocate and free main memory is a type of system call for
1) Process control 2) File Management
3) Information Maintenance 4) Device Management
20. Attach or detach remote devices is the following type of system call
1) Process control 2) Device Management
3) File Management 4) Communications
21. The fork system call in UNIX
1) Creates new process 2) Invokes job scheduler
3) Invokes CPU scheduler 4) Executes new process
22. Mail box provides
1) Direct communication for IPC 2) Indirect communication for IPC
3) Process cooperation 4) Process scheduling
23. Disadvantages of the fixed partitioning of memory is
1) Internal fragmentation 2) Internal segmentation
3) External monitoring 4) External segmentation
24. Select the method which is not used for free space management
1) Linked list 2) Bit vector 3) Counting 4) Inverted list
25. The following algorithm is also called elevator algorithm
1) SSTF scheduling 2) SCAN scheduling
3) LOOK scheduling 4) FCFS scheduling
26. The following disk scheduling algorithm perform better for systems that place heavy load
on the disc
1) C-SCAN 2) SSTF 3) FCFS 4) LOOK
27. Which of the following page replacement algorithms exhibits belady’s anamoly
1) FIFO 2) LRU
3) LFU 4) Optimal page Replacement
28. To avoid race condition the number of processes that can be allowed to be simultaneously
inside the critical section is
1) 0 2) All 3) 1 4) 3
2009

SAIMEDHA 31
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234
BSNL – JTO - LICE OPERATING SYSTEM

29. One of the true problems with priority scheduling is


1) Aging 2) Decrease in throughout
3) Starvation 4) Content switch overhead
30. One a disk with 8 records per track where a file is stored starting at track 0, record 14 is
found on track
1) 0 2) 1 3) 2 4) 3
31. Which of the following page replacement algorithm is expensive to implement ?
1) FIFO 2) LRU 3) LFU 4) aging
32. In round robin scheduling usage of CPU can be less effective if
1) Short quantum 2) Long quantum
3) Small queue size 4) Long queue size
33. Given a record size of 120 and block size of 1200, what is the blocking factor?
1) 10 2) 15 3) 20 4) 25
34. Threads belonging to the same process share
1) Stack 2) Data section 3) Register set 4) Thread ID
35. Most deadlock in operating systems develop because of normal contention of
1) Dedicated resource 2) Processors
3) Main memory 4) Device drivers

PREVIOUS ECET BITS KEY


01) 2 02) 4 03) 3 04) 4 05) 2 06) 3 07) 2 08) 4 09) 2 10) 2
11) 4 12) 1 13) 2 14) 3 15) 1 16) 4 17) 1 18) 3 19) 1 20) 4
21) 1 22) 2 23) 1 24) 4 25) 2 26) 1 27) 1 28) 3 29) 3 30) 2
31) 1 32) 3 33) 1 34) 1 35) 1

SAIMEDHA 32
HYDERABAD-9494941234 TIRUPATI-9494861234 VIJAYAWADA-9494891234

You might also like