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

What is Operating System? Explain characteristics of OS? What is the demand paging?

-->
An Operating System (OS) is an interface between a Demand Paging is a popular method of virtual memory
computer user and computer hardware. An operating management. In demand paging, the pages of a process
system is a software which performs all the basic tasks like which are least used, get stored in the secondary memory.
file management, memory management, process A page is copied to the main memory when its demand is
management, handling input and output, and controlling made or page fault occurs. There are various page
peripheral devices such as disk drives and printers. An replacement algorithms which are used to determine the
operating system is software that enables applications to pages which will be replaced. We will discuss each one of
interact with a computer's hardware. them later in detail.
Work Management One of the important characteristics What are the principles of the following replacement
of the operating system is task management. It is also algorithms? a) FIFO. b) LRU.
considered an important OS function as it controls all the 1. First In First Out (FIFO): This is the simplest page
activities related to handling tasks systematically. replacement algorithm. In this algorithm, the operating
Resource Management: The hardware and software of a system keeps track of all pages in the memory in a queue,
computer are closely interconnected. Each of the two the oldest page is in the front of the queue. When a page
does not work without the other. As a result, the needs to be replaced page in the front of the queue is
operating system balances these two resources. OS selected for removal. Example 1: Consider page reference
examines all tasks systematically and verifies if all string 1, 3, 0, 3, 5, 6, 3 with 3 page frames.Find the
computer components are operational number of page faults.
Input and Output Control: The three main jobs of a 2. Optimal Page replacement: In this algorithm, pages are
computer are Input, Output, and Processing. The replaced which would not be used for the longest duration
operating system also controls a computer's input and of time in the future. Example-2: Consider the page
output activities. references 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page
Multitasking System: Multitasking is now a standard frame. Find number of page fault.
feature of current operating systems. They are capable of 3. Least Recently Used: In this algorithm, page will be
performing numerous jobs at once. For example, if a user replaced which is least recently used. Example-3: Consider
is working in Excel and wants to print a page, he does not the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3
need to interrupt his work.With just one command, the with 4 page frames. Find number of page faults.
page will be printed, and the user can access the drives Cooperating process: There are various processes in a
without having to close the tab. As a result, multitasking is computer system, which can be either independent or
one of the best characteristics of operating systems cooperating processes that operate in the operating
Define the virtual memory? What are its advantages? system. It is considered independent when any other
Virtual Memory is a storage scheme that provides user an processes operating on the system may not impact a
illusion of having a very big main memory. This is done by process. Process-independent processes don't share any
treating a part of secondary memory as the main memory. data with other processes
In this scheme, User can load the bigger size processes (2) Independent process:The process that does not affect
than the available main memory by having the illusion or is affected by the other process while its execution then
that the memory is available to load the process. Instead the process is called Independent Process. Example The
of loading one big process in the main memory, the process that does not share any shared variable, database,
Operating System loads the different parts of more than files, etc.
one process in the main memory. By doing this, the (3) Race condition: When more than one process is
degree of multiprogramming will be increased and executing the same code or accessing the same memory
therefore, the CPU utilization will also be increased. or any shared variable in that condition there is a
Advantages of Virtual Memory possibility that the output or the value of the shared
1. The degree of Multiprogramming will be increased. variable is wrong so for that all the processes doing the
2. User can run large application with less real RAM. race to say that my output is correct this condition known
3. There is no need to buy more memory RAMs. as a race condition.
requirements of solution the critical-section problem? Explain CPU Scheduling Algorithm?
--> In the entry section, the process requests for entry in --> CPU Scheduling is a process of determining which
the Critical Section. Any solution to the critical section process will own CPU for execution while another process
problem must satisfy three requirements: • Mutual is on hold. The main task of CPU scheduling is to make
Exclusion: If a process is executing in its critical section, sure that whenever the CPU remains idle, the OS at least
then no other process is allowed to execute in the critical select one of the processes available in the ready queue
section. • Progress: If no process is executing in the critical for execution. The selection process will be carried out by
section and other processes are waiting outside the the CPU scheduler. It selects one of the processes in
critical section, then only those processes that are not memory that are ready for execution.
executing in their remainder section can participate in Preemptive Scheduling In Preemptive Scheduling, the
deciding which will enter in the critical section next, and tasks are mostly assigned with their priorities. Sometimes
the selection can not be postponed indefinitely. • it is important to run a task with a higher priority before
Bounded Waiting: A bound must exist on the number of another lower priority task, even if the lower priority task
times that other processes are allowed to enter their is still running. The lower priority task holds for some time
critical sections after a process has made a request to and resumes when the higher priority task finishes its
enter its critical section and before that request is granted. execution.
Logical Address is generated by CPU while a program is Non-Preemptive Scheduling In this type of scheduling
running. The logical address is virtual address as it does method, the CPU has been allocated to a specific process.
not exist physically, therefore, it is also known as Virtual The process that keeps the CPU busy will release the CPU
Address. This address is used as a reference to access the either by switching context or terminating. It is the only
physical memory location by CPU. The term Logical method that can be used for various hardware platforms.
Address Space is used for the set of all logical addresses That’s because it doesn’t need special hardware (for
generated by a program’s perspective. The hardware example, a timer) like preemptive scheduling.
device called Memory-Management Unit is used for .What is deadlock? Explain how deadlock can be
mapping logical address to its corresponding physical avoided?
address. --> Deadlock is a situation where a set of processes are
Physical Address identifies a physical location of required blocked because each process is holding a resource and
data in a memory. The user never directly deals with the waiting for another resource acquired by some other
physical address but can access by its corresponding process. Consider an example when two trains are coming
logical address. The user program generates the logical toward each other on the same track and there is only one
address and thinks that the program is running in this track, none of the trains can move once they are in front
logical address but the program needs physical memory of each other. A similar situation occurs in operating
for its execution, therefore, the logical address must be systems when there are two or more processes that hold
mapped to the physical address by MMU before they are some resources and wait for resources held by other(s).
used. For example, in the below diagram, Process 1 is holding
Write a short note of Synchronization? Resource 1 and waiting for resource 2 which is acquired by
--> Process Synchronization is the coordination of process 2, and process 2 is waiting for resource 1.
execution of multiple processes in a multi-process system
to ensure that they access shared resources in a controlled
and predictable manner. It aims to resolve the problem of
race conditions and other synchronization issues in a
concurrent system. The main objective of process
synchronization is to ensure that multiple processes
access shared resources without interfering with each
other, and to prevent the possibility of inconsistent data
due to concurrent access. To achieve this, various
synchronization techniques such as semaphores,
monitors, and critical sections are used.
. Describe types of Multiprocessor? Explain components of RTOS?
--> operating systems, to improve the performance of Components of RTOS The Scheduler: This component of
more than one CPU can be used within one computer RTOS tells that in which order, the tasks can be executed
system called Multiprocessor operating system. Multiple which is generally based on the priority. Symmetric
CPUs are interconnected so that a job can be divided Multiprocessing (SMP): It is a number of multiple different
among them for faster execution. When a job finishes, tasks that can be handled by the RTOS so that parallel
results from all CPUs are collected and compiled to give processing can be done. Function Library: It is an
the final output. Jobs needed to share main memory and important element of RTOS that acts as an interface that
they may also share other system resources among helps you to connect kernel and application code. This
themselves. Multiple CPUs can also be used to run application allows you to send the requests to the Kernel
multiple jobs simultaneously. For Example: UNIX using a function library so that the application can give the
Operating system is one of the most widely used desired results
multiprocessing systems. What is a Shell Scripting?
Types of multiprocessing systems Shell script is a list of commands in a computer program
Symmetrical multiprocessing operating system: that is run by the Unix shell which is a command line
In a Symmetrical multiprocessing system, each processor interpreter. A shell script usually has comments that
executes the same copy of the operating system, takes its describe the steps. The different operations performed by
own decisions, and cooperates with other processes to shell scripts are program execution, file manipulation and
smooth the entire functioning of the system. The CPU text printing. A wrapper is also a kind of shell script that
scheduling policies are very simple. Any new job creates the program environment, runs the program etc.
submitted by a user can be assigned to any processor that Types of Shells There are two major types of shells in Unix.
is least burdened. It also results in a system in which all Bourne Shell :This is the default shell for version 7 Unix.
processors are equally burdened at any time. The character $ is the default prompt for the bourne shell.
Asymmetric multiprocessing operating system In an The different subcategories in this shell are Korn shell,
asymmetric multiprocessing system, there is a master Bourne Again shell, POSIX shell etc. C Shell :This is a Unix
slave relationship between the processors. Further, one shell and a command processor that is run in a text
processor may act as a master processor or supervisor window. The character % is the default prompt for the C
processor while others are treated as shown below. shell. File commands can also be read easily by the C shell,
A real-time operating system (RTOS) is a special-purpose which is known as a script.
operating system used in computers that has strict time Explain Linux Commands?
constraints for any job to be performed. It is employed Linux is a family of open-source Unix operating systems
mostly in those systems in which the results of the based on the Linux Kernel. They include Ubuntu, Fedora,
computations are used to influence a process while it is Debian, openSUSE, and Red Hat.
executing. Whenever an event external to the computer 1. sudo command Short for superuser do, sudo is one of
occurs, it is communicated to the computer with the help the most popular basic Linux commands that lets you
of some sensor used to monitor the event. The sensor perform tasks that require administrative or root
produces the signal that is interpreted by the operating permissions.
system as an interrupt. On receiving an interrupt, the 2. pwd command Use the pwd command to find the path
operating system invokes a specific process or a set of of your current working directory. Simply entering pwd
processes to serve the interrupt. This process is will return the full current path – a path of all the
completely uninterrupted unless a higher priority directories that starts with a forward slash (/).
interrupt occurs during its execution. Therefore, there 3. cd command To navigate through the Linux files and
must be a strict hierarchy of priority among the interrupts. directories, use the cd command. Depending on your
The interrupt with the highest priority must be allowed to current working directory, it requires either the full path
initiate the process , while lower priority interrupts should or the directory name.
be kept in a buffer that will be handled later. Interrupt 4. ls command The ls command lists files and directories
management is important in such an operating system. within a system. Running it without a flag or parameter
will show the current working directory’s content.
Explain in Details Kernel and types of Kernel? For e.g., the control panel provides the settings for audio,
The Kernel is the heart of your operating system. Kernel video, mouse, keyboard, network connections, date and
handles all operations on behalf of operating system. • A time, installed applications, etc. which the user can
Kernel is an intermediary between applications and change as per his/her need.
hardware. This means that applications can run without Cortana It is used to display the files and folders which
knowing or caring about the underlying hardware details. are on the computer. It is also known as Windows
It manages lowlevel tasks such as disk management, task Explorer. It gives the user the ability to browse data on the
management, and memory management. Whenever you hard drive, SSD, and other inserted removable disks. It
start a system, Kernel is the first program that is loaded allows the user to manage the content according to their
after the bootloader, and it remains in the memory until preference, such as a user can delete or rename a file and
the operating system is shut-down. search and transfer data.
Types of the Kernel What is Mobile Operating System? Explain types of
Monolithic Kernel: Monolithic kernels are the simplest Mobile Operating System?
and most common type of Kernel. They include the core --> A mobile operating system (OS) is software that allows
functionality of the operating system and support all smartphones, tablet PCs (personal computers) and other
devices connected to it. In this, the user and kernel devices to run applications and programs. A mobile OS
services are implemented in the same memory space. Due typically starts up when a device powers on, presenting a
to this, the size of the kernel increases, which in turn screen with icons or tiles that present information and
increases the size of the operating system provide application access.
Microkernel: Microkernels are a newer development and, 7. Explain Mapping techniques of Cache Memory?
as such, are not as common as monolithic kernels. They --> Cache Memory: The clock speed of the CPU is much
include only the essential services and devices required faster than the main memory, So, the CPU requires fast
for the system to function. This results in a smaller kernel memory. Such a fast and small memory is referred to as a
that is faster and uses less memory. Here, the user and ‘cache memory‘. The Cache Memory is the intermediate
kernel services are implemented in two different spaces. Memory between the CPU and the main memory.
Hybrid Kernel: Hybrid kernels combine monolithic and Mapping: The basic characteristics of cache memory are
microkernels. They include more services than its fast access time. So, it is very little or no time must be
microkernels but less than monolithic kernels. This allows wasted when searching for words in the cache. The
them to offer some of the benefits of both kernels transformation of data from main memory to cache
Nano Kernel: Nano kernels are the smallest type of memory is referred to as a ‘Mapping‘ process. There are 3
Kernel, consisting of only a few thousand lines of code. It types of mapping procedures are there for cache memory.
means that the code executing in the privileged mode of
the hardware is minimal. They are used primarily in
embedded systems or devices with limited resources. What is a Process Control Block (PCB)?
Exo Kernel: This Kernel has separate resource protection A process control block (PCB) is a data structure used by
and management. It is suitable for use when performing operating systems to store important information about
application-specific customization. Exo kernels are running processes. It contains information such as the
designed for use in mobile devices. They are a variation of unique identifier of the process (Process ID or PID),
microkernels that include additional features specifically current status, program counter, CPU registers, memory
for mobile devices, such as power management and allocation, open file descriptions and accounting
support for multiple processors.` information. The circuit is critical to context switching
because it allows the operating system to efficiently
Explain any two features of windows operating system manage and control multiple processes.
control panel? A process control board (PCB) stores various information
Control Panel A Control panel is a feature of the Windows about a process so that the operating system can manage
operating system that contains many tools that help in it properly.
configuring and managing the computer's resources.

You might also like