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

Operating System Unit 1,2,3

Uploaded by

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

Operating System Unit 1,2,3

Uploaded by

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

Most important questions

LePic
Operating system
Most Important questions Unit-1
7 marks
What is os? Explain different types of OS.

Explain the following terms in detail:

LePic
(i) Multiprocessor operating system
(ii) Real time system
(iii) Time sharing system

what is OS?Explain in detail about the Operating System services/functions

Explain in detail about the Layered, Monolithic and Microkernel Systems.

Explain batch OS with example.


Q1- What is os? Explain different types of OS

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

Types of real-time os:


1. Hard Real Time os:
All key tasks in Hard RTOS must be accomplished within the defined time frame or within the supplied deadline.
Failure to achieve the deadline would result in catastrophic failures, such as equipment damage or even human life
loss

2.Soft Real Time os


Soft RTOS allows for a few delays through the operating system. There may be a deadline assigned to a job with this
type of RTOS, but a minor delay is allowed.

3.Firm Real -Time os


Firm RTOS is also concerned about meeting deadlines. However, while not having a deadline may not have a 2
significant impact, it may have unintended consequences, such as a significant reduction in the product’s quality.
Applications
The radar device employs real-time running architecture.
Missile guidance employs real-time running structures.
Online inventory trade employs real-time running frameworks.
The cell phone switching device employs real-time running mechanisms.
Air site visitors manipulate structures using real-time running structures.
Medical Imaging Systems take advantage of real-time running structures.

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

what is OS?Explain in detail about the Operating System services/functions

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.

It also includes process scheduling

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.

The main aim of memory management is to


achieve efficient utilization of memory.

It does the following things


check free space in memory
decide the allocation policy to allocate
memory to programs.
deallocate the executed programs
2
management of primary memory.
Device Management
The process of implementation, operation, and maintenance of a device by an
operating system is called device management.

LePic
When we use computers we will have various devices connected to our
system like mouse, keyboard, scanner, printer, and pen drives.

An operating system is responsible for


successfully establishing the connection
between these devices and the system. The
operating system uses the concept of drivers
to establish a connection between these
devices with the system.

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

This also includes protecting the data when connected on a


network.

The main aim of security management is to prevent


unauthorized access of the user data

2
Explain in detail about the Layered, Monolithic and Microkernel Systems.

Explain batch OS with example.

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.

Disadvantages of Simple/Monolithic Structure

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:

It makes the operating system portable to various platforms.


As microkernels are small so these can be tested effectively.

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 :

In this structure, the application’s performance is degraded as compared to simple


structure.
It requires careful planning for designing the layers, as the higher layers use the
functionalities of only the lower layers.

2
Most Important questions Unit-1
2 marks

Define Operating system and mention its major functions.


Briefly define the term Real Time Operating System.

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.

Q-Explain the principal advantages of multiprogramming.


High CPU utilization
Shorter response time
Shorter waiting time
Increased throughput
Ability to assign priority to different processes
Can be accessed by multiple users simultaneously
Short-term jobs are completed quickly
Q- What is system call? Give examples
Ans:-System call is an interface placed between the user program and the os functionalities.
the different types of system call are: process system call, file system call, device system call, memory system call.etc

Q-What are the goals of operating system?


The goals of os are:
convenience: make the work easier for user and the machine.

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

Q-What is reentrant kernel?


the kernel that allows more than one process to be executed in the kernel mode at a given point of time and that
too without causing consistency problem is called reentrant kernel.
Most Important questions Unit-2
7 marks

Explain in detail about the Inter Process Communication models.


What is critical section problem? Give the conditions that a solutions to a

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.

There are two models of IPC:

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

You might also like