Operating System Unit 1,2,3
Operating System Unit 1,2,3
LePic
Operating system
Most Important questions Unit-1
7 marks
What is os? Explain different types of OS.
LePic
(i) Multiprocessor operating system
(ii) Real time system
(iii) Time sharing system
Operating system is an interface that is placed between the user and the hardware
components that makes the communication between the user and the hardware
possible.
LePic
It also acts as a resource manager.
Types of Operating System:
Batch OS
Time Sharing
Real Time OS
Multiprocessing OS
Distributed OS
Network/MultiUser OS
2
Batch OS
It is a non-interactive os.
This type of operating system does not interact with the computer directly. There is an operator
which takes similar jobs having the same requirement and groups them into batches. It is the
LePic
responsibility of the operator to sort jobs with similar needs.
SPOOLING is used in this os.
The users prepares the job/task/program on an offline device and submit it to the computer
operator and the operator then divides the programs into batches of similar type.
The purpose is to complete the similar process at once.
Advantages:
-Multiple users can share the batch systems.
-The idle time for the batch system is very less.
-It is easy to manage large work repeatedly in batch systems.
Disadvantages:
-The computer operators should be well known with batch systems.
-Batch systems are hard to debug.
-It is sometimes costly. 2
-The other jobs will have to wait for an unknown time if any job fails
SPOOLING
Simultaneous Peripheral Operations On-Line.
jitni der m output jaega utni der m dusra input processing ke lie aa jaega.
LePic
2
Time Sharing OS
Time of the CPU is divided among various processes.
Also called as multitasking os.
Its primary goal is to improve interactive reaction time.
The CPU changes between numerous jobs to complete them, but the shifts are frequent. As a
result, the user can expect a quick answer. To give each user a little amount of time, the
operating system utilizes CPU scheduling and multiprogramming.
2
Features:
It can do a large number of tasks quickly.
It is no longer necessary to wait for the previous task to complete before using the processor.
Interaction among users and computers is improved.
At the same time, multiple online users can utilise the same computer.
End users believe they have complete control over the computer system..
Advantages:
It has a quick response time.
CPU idle time is reduced.
Each task is assigned a certain time limit..
User-friendly and simple to use.
Disadvantages:
It uses a lot of resources.
Hardware with high quality is required.
It has difficulty with consistency.
A security and integrity problem with user programs and data.
Data communication problem probability
2
Real Time OS
A RTOS or real-time operating system is a special-purpose OS for computers that must
accomplish tasks within severe time limitations.
This deadline indicates that the task must be performed within the specified time frame.
Correctness of results is also a critical element of real-time systems, and they must not only
produce the right results, but they must also do it within the given time limit and deadline
Advantages:
Because real-time working structures are extremely small, they require significantly less memory
Because the programs are tiny, RTOS can be used in embedded systems such as transportation.
These systems are completely error-free.
In these systems, memory allocation is best regulated
Disadvantages:
Real-time operating systems are difficult to design and implement due to their complex layout
principles.
Real-time operating systems are quite complex and can eat up a lot of CPU time.
2
Multi-processing OS
Multiprocessing helps in performing parallel computing.
There are several processors in a system, and each of them can run multiple processes
simultaneously.
The system’s throughput will be significantly increased as a result of this. Parallel computing is
performed by multiprocessing.
The presence of more than one processor in the system allows it to run multiple processes at the
same time, increasing the system’s throughput.
Multiple CPUs are linked together so that a job can be divided and executed more quickly. When a
job is completed, the results from all CPUs are compiled to provide the final output. Jobs were
required to share main memory, and they may often share other system resources
2
Types of Multi-processing OS
Asymmetric Multiprocessing os Symmetric Multiprocessing os
The processors in an asymmetric system The processors in an symmetric system do
have a master-slave relationship. not have a master-slave relationship.
CPU n1 serves as a supervisor, controlling All the processors are treated equally.
the subsequent CPUs. Each processor in The communication between the different
such a system is assigned a specific task, processors is done by shared memory
and the actions of the other processors are
overseen by a master processor.
2
LePic
Advantages:
Increased reliability: Processing tasks can be spread among numerous processors in the
multiprocessing system. This promotes reliability because if one processor fails, the task can be
passed on to another.
Increased throughout: More work could be done in less time as the number of processors
increases.
The economy of scale: Multiprocessor systems are less expensive than single-processor
computers because they share peripherals, additional storage devices, and power sources.
Disadvantages:
Multiprocessing operating systems are more complex and advanced since they manage many 2
CPUs at the same time.
Distributed OS
A distributed operating system (DOS) is an essential sort of operating system.
Many central processors are used in distributed systems to support various real-time
applications & users.
As a result, jobs for data processing are split across the processors.
It uses a single communication channel in order to connect
LePic
several computers. These systems each have their own
processor and memory.
Also, these CPUs may communicate across various high-
speed buses and telephone lines
Fragments: The data is divided into smaller parts called
fragments.
These fragments are stored over different systems.
The fragments can be vertical or horizontal.
Replica: This means duplicacy.
The same data is shared over different systems so that there
is backup in case of any failure.
Transparency: User thinks that all the data is present on his
device.
2
Features:
Fault Tolerance
Fault tolerance refers to the ability of a user to continue working even if software or hardware
malfunctions
Transparency
It is the distributed operating system’s most crucial feature. A distributed operating system’s
main goal is to hide the fact that all the resources are shared. Also, transparency indicates that the
LePic
consumer isn’t aware that the resources he’s using are shared
Flexibility
The modular properties of a DOS increase its flexibility and allow it to provide a wider range of
high-level service
Resource Sharing
The ability to share resources is its most important feature. They can also exchange resources in
a safe and secure way. Printers, data, files, web pages, storage, and other shared resources are
examples.
Scalability
It means that as more nodes are added to the system, the system’s efficiency must not change.
Furthermore, the overall performance of a 100-node system should be comparable to that of a
1000-node system. 2
Advantages:
Since all information is replicated across all sites, the risk of data corruption is reduced; if one
site fails, then the user can access the data from another working site.
Because the entire system is independent of one another, if one site crashes, the complete
system does not come to a halt.
It improves the speed with which data is sent from one site to another.
LePic
Because it may be accessible from both local and remote sites, it is an open system.
It aids in the speeding up of data processing
Disadvantages:
Communication delay will increase when a system becomes more broadly spread. As a result,
developers and teams must pick between consistency, availability, and latency.
These systems aren’t generally available due to their perceived high cost.
The system must determine which jobs must be carried out, when they must be carried out, and
where they must be carried out. The restrictions of a scheduler might result in underutilised
hardware as well as unpredictable runtimes
2
Multiuser OS
In a multiuser operating system, multiple numbers of users can access different resources of a
computer at the same time.
The access is provided using a network that consists of various personal computers attached to a
mainframe computer system.
LePic
A multi-user operating system allows the permission of multiple users for accessing a single
machine at a time.
The various personal computers can send and receive information to the mainframe computer
system.
Thus, the mainframe computer acts as the server and other personal computers act as clients for
that server
2
Explain the following terms in detail:
(i) Multiprocessor operating system
(ii) Real time system
(iii) Time sharing system
LePic
2
Functions of Operating System
process
management
Security Memory
management management
File Device
management management
2
Process Management
Program under execution is called “process”.
LePic
process management includes :
creating the process
allocation of resources
controlling the progress of process
interporcess communication
deadlock handling.
2
Memory Management
To achieve a degree of multiprogramming and proper utilization of memory,
memory management is important.
LePic
In a multiprogramming computer, the Operating System resides in a part of
memory, and the rest is used by multiple processes. The task of subdividing
the memory among different processes is called Memory Management.
LePic
When we use computers we will have various devices connected to our
system like mouse, keyboard, scanner, printer, and pen drives.
2
File Management
File management is one of the basic but important features provided by the
operating system.
File management in the operating system is nothing but software that handles
or manages the files (binary, text, pdf, docs, audio, video, etc.) present in
LePic
computer software.
We can also use the file system in the operating system to get
details of any file(s) present on our system. The details can be:
location of the file (the logical location where the file is stored in
the computer system)
the owner of the file (who can read or write on the particular file)
when was the file created (time of file creation and modification
time)
a type of file (format of the file for example text, pdfs, docs, etc.)
state of completion of the file, etc.
2
Security Management
The security management function of an operating system
helps in implementing mechanisms that secure and protect the
computer system internally as well as externally.
LePic
This includes protection of files and important data by means
of password,authentication,lock,pin etc
2
Explain in detail about the Layered, Monolithic and Microkernel Systems.
LePic
2
1.Monolithic Architecture
Such operating systems do not have well-defined structures and are small, simple, and limited
all the components of os are connected.
earliest and most common architecture.
direct communication between the components of the os.
User
MODE
Kernel
MODE
2
Advantages of Simple/Monolithic Structure:
It delivers better application performance because of the few interfaces between the
application program and the hardware.
It is easy for kernel developers to develop such an operating system.
LePic
The structure is very complicated, as no clear boundaries exist between modules.
It does not enforce data hiding in the operating system.
2
2.Microkernel Architecture
Only the required components are kept in the kernel space rest all the components are kept in
the user space.
This results in a smaller kernel called the micro-kernel
Advantages of this structure are that all new services need to be added to user space and does
not require the kernel to be modified. Thus it is more secure and reliable as if a service fails, then
rest of the operating system remains untouched
User
MODE
Kernel
MODE
2
Advantages:
Disadvantages :
LePic
Increased level of inter module communication degrades system performance.
2
3.LayeredArchitecture
An OS can be broken into pieces and retain much more control over the system. In this structure,
the OS is broken into a number of layers (levels).
The bottom layer (layer 0) is the hardware, and the topmost layer (layer N) is the user interface.
These layers are so designed that each layer uses the functions of the lower-level layers.
This simplifies the debugging process, if lower-level layers are debugged and an error occurs
during debugging, then the error must be on that layer only, as the lower-level layers have
already been debugged.
2
Advantages:
Layering makes it easier to enhance the operating system, as the implementation of a layer can
be changed easily without affecting the other layers.
It is very easy to perform debugging and system verification
LePic
Disadvantages :
2
Most Important questions Unit-1
2 marks
LePic
Explain the principal advantages of multiprogramming.
What is system call? Give examples
What are the goals of operating system?
what is deadlock?
What are the components of OS?
What is reentrant kernel?
2 marks
Q-Define Operating system and mention its major functions.
Ans:-Operating system is an interface that is placed between the user and the hardware components that makes the
communication between the user and the hardware possible.
It also acts as a resource manager.
Functions of operating system are: process management, memory management, file management, device management,
security management.
LePic
Q-Briefly define the term Real Time Operating System.
Ans:- The operating system in which there are time constraints for the completion for the completion of the task is called real
time os.
If there there is any time delay then the desired output is not achieved.
these are of 2 types: hard real time, soft real time.
LePic
efficiency: work should be done in a way that the resources are fully ulilized.
portability: the work can be done on any other system as well.
security: the data should be protected.
scalability: we can add features according to our need.
robustness: handle the errors easily.
interactivity: interact with the user through various ways such as notification,errors,etc
Q-what is deadlock?
Deadlock is a situation in computing where two or more processes are unable to proceed because
because each is waiting for the other to release resources.
Q-What are the components of OS?
The components of os are:
process manager
memory manager
file manager
inter-process communication manager
LePic
device manager
LePic
critical section problem must satisfy.
Explain in detail about the Mutual Exclusion and Critical Section Problem
Explain producer consumer problem and its solution using semaphore.
Explain dinning philosopher problem and its solution using
semaphore(MMI).
Q-Explain in detail about the Inter Process Communication models
Interprocess communication is the mechanism provided by the operating system that allows processes to communicate with
each other. This communication could involve a process letting another process know that some event has occurred or
transferring of data from one process to another.
LePic
1.shared memory
Shared memory is the memory that can be simultaneously accessed by multiple
processes. This is done so that the processes can communicate with each other.
Advantage:
Memory communication is faster on the shared memory model as compared to
the message passing model on the same machine.
Disadvantage:
All the processes that use the shared memory model need to make sure that
they are not writing to the same memory location.
Shared memory model may create problems such as synchronization and
memory protection that need to be addressed.
2.message passing
Multiple processes can read and write data to the message queue without being
connected to each other. Messages are stored on the queue until their recipient
retrieves them. Message queues are quite useful for interprocess communication
and are used by most operating systems.
Advantage:
LePic
The message passing model is much easier to implement than the shared
memory model.
Disadvantage:
The message passing model has slower communication than the shared
memory model because the connection setup takes time.
Q-What is critical section problem? Give the conditions that a solutions to a critical
section problem must satisfy?
Critical section is a segment of code that try to access the shares resources. The critical section is used to solve the problem
of race condition.
the critical section problem is :when the shared resources are access by the concurrent processes there can be an
unexpected error/unwanted output
LePic
The conditions that a solution to critical section problem must
satisfy are:
1.Mutual exclusion: it means that the critical section is accessed by one process at
a time
More than one processes are not allowed to access the critical section together as
this will cause the desired output to be modified
2.Progress: The critical should be used by any process i.e the critical section
should not be idle.
If there is no process using the critical section, then the process in the waiting state
should be allowed to do so.
3.bounded waiting: There should be no process that is waiting till infinity time even if there is
availability of the critical section.
If any process is not given the access to the critical section even if the critical section is free is
called starvation.
LePic
Explain producer consumer problem and its solution using semaphore.
LePic
LePic
Explain dinning philosopher problem and its solution using semaphore(MMI).
LePic
Most Important questions Unit-2
2 Marks
Q-Define the term busy waiting.
Busy Waiting is defined as a process synchronization technique where the process waits and continuously keeps on
checking for the condition to be satisfied before going ahead with its execution. Busy Waiting is also known as busy
LePic
looping or spinning.
Q-Define semaphore and its types.
A semaphore is a tool used in computer science and programming to control access to a shared resource. It is a
integer variable that is denoted by”S”.A semaphore works like that token. It helps manage the use of resources, like
memory or files, by allowing only a certain number of processes (or programs) to access the resource at the same
time. This prevents conflicts and ensures smooth operation.
Types:
General semaphor: takes any non-negative value
Binary semaphor: takes only 0 and 1 as value.
Q-Explain starvation problem and its solution
If any process is not given the access to the critical section even if the critical section is free is called starvation.
The way we combat starvation in the operating system is through a process called aging, which is a technique that
increases the priority level of low priority based programs over a set period
Q-What do you mean by Concurrent Processes?
The process that occur simultaneously ie at the same time are called concurrent processes. This occurs when there are
several process threads running in parallel. These threads communicate with the other threads/processes through a
concept of shared memory or through message passing
Q-What is race condition?
LePic
The condition which arises when multiple processes access the shared resources simultaneously
leading to undesirable outcomes is called race condition.
example-producer consumer problem.
Most Important questions Unit-3
7 marks
Numericals(100%)
LePic
CPU
scheduling
Numerical