Operating System
Operating System
system
An Operating System (OS) is an interface between a computer user and
computer hardware. An operating system is a software which performs all the
basic tasks like file management, memory management, process management,
handling input and output, and controlling peripheral devices such as disk drives
and printers.
You can say that your laptops, computer systems, tablets, etc. are your
personal computers, and the operating systems such as Windows 7,
Windows 10, Android, etc. are your personal computer operating systems.
And you can use your personal computer operating system for your
personal purposes, for example, chatting with your friends using some
social media sites, reading some articles from the internet, making some
projects through Microsoft PowerPoint or any other program, designing
your website, programming something, watching some videos and
movies, listening to some songs, and many more.
Examples of Personal Computer Operating Systems:
Android
Windows
iOS
Mac OS X
Linux Mint
Ubuntu
Fedora
Others, such as Windows (by Microsoft) and Mac OS X (by Apple), are used
on laptops or desktop computers.
To be honest, the Linux operating system is the most secure, fast, and
best for professionals, hackers, and administrators. People prefer the
"Windows" operating system as their primary operating system because it
is so simple to use. However, if you understand Linux, believe me when I
say that you will never switch to another operating system, whether it is
for a desktop or a laptop.
Parallel Systems
It designed to speed up the execution of programs by dividing the
programs into multiple fragments and processing these fragments
at the same time. Flynn has classified computer systems into four
types based on parallelism in the instructions and in the data
streams.
1. Single Instruction stream, single data stream
2. Single Instruction stream, multiple data stream
3. Multiple Instruction stream, single data stream
4. Multiple Instruction stream, multiple data stream
Advantages of Parallel Systems:
High Performance: Parallel systems can execute
computationally intensive tasks more quickly compared to
single processor systems.
Cost Effective: Parallel systems can be more cost-effective
compared to distributed systems, as they do not require
additional hardware for communication.
Disadvantages of Parallel Systems:
Limited Scalability: Parallel systems have limited scalability
as the number of processors or cores in a single computer
is finite.
Complexity: Parallel systems are more complex to program
and debug compared to single processor systems.
Synchronization Overhead: Synchronization between
processors in a parallel system can add overhead and
impact performance.
Distributed operating system
These types of operating system is a recent advancement
in the world of computer technology and are being widely
accepted all over the world and, that too, at a great pace.
Various autonomous interconnected computers
communicate with each other using a shared
communication network. Independent systems possess
their own memory unit and CPU. These are referred to
as loosely coupled systems or distributed systems . These
systems’ processors differ in size and function. The major
benefit of working with these types of the operating system
is that it is always possible that one user can access the
files or software which are not actually present on his
system but some other system connected within this
network i.e., remote access is enabled within the devices
connected in that network.
Advantages of Distributed Operating System
Failure of one will not affect the other network
communication, as all systems are independent of each
other.
Electronic mail increases the data exchange speed.
Since resources are being shared, computation is highly
fast and durable.
Load on host computer reduces.
These systems are easily scalable as many systems can be
easily added to the network.
Delay in data processing reduces.
Segmentation
In FIFO, the page that was brought into the memory first will be
the first one to be replaced when a page fault occurs and a new
page needs to be loaded. The operating system keeps track of all
pages that are currently loaded in memory and adds new pages
to the end of the queue as they are loaded. When a page fault
occurs, the operating system simply replaces the oldest page in
the queue.
In LRU, the operating system keeps track of when each page was
last accessed and replaces the page that has not been used for
the longest time. This approach assumes that a page that has not
been used for a long time is less likely to be used in the near
future.
In LIFO, the operating system keeps a stack of the pages that are
currently loaded in memory, and adds new pages to the top of the
stack as they are loaded. When a page fault occurs and a new
page needs to be loaded, the operating system simply replaces
the page at the top of the stack, which is the page that was
brought into memory most recently.
What is Thrashing?
Thrashing is the term used to describe a state in which
excessive paging activity takes place in computer systems,
especially in operating systems that use virtual memory,
severely impairing system performance. Thrashing occurs
when a system’s high memory demand and low physical
memory capacity cause it to spend a large amount of time
rotating pages between main memory (RAM) and secondary
storage, which is typically a hard disc.
It is caused due to insufficient physical memory, overloading
and poor memory management. The operating system may
use a variety of techniques to lessen thrashing, including
lowering the number of running processes, adjusting paging
parameters, and improving memory allocation algorithms.
Increasing the system’s physical memory (RAM) capacity can
also lessen thrashing by lowering the frequency of page
swaps between RAM and the disc.
Allocation of Frames in OS
The main memory of the operating system is divided into various frames.
The process is stored in these frames, and once the process is saved as a
frame, the CPU may run it. As a result, the operating system must set
aside enough frames for each process. As a result, the operating system
uses various algorithms in order to assign the frame.
Demand paging is used to implement virtual memory, an essential
operating system feature. It requires the development of a page
replacement mechanism and a frame allocation system. If you have
multiple processes, the frame allocation techniques are utilized to define
how many frames to allot to each one. A number of factors constrain the
strategies for allocating frames:
1. You cannot assign more frames than the total number of frames
available.
2. A specific number of frames should be assigned to each process.
This limitation is due to two factors. The first is that when the
number of frames assigned drops, the page fault ratio grows,
decreasing the process's execution performance. Second, there
should be sufficient frames to hold all the multiple pages that any
instruction may reference.
There are mainly five ways of frame allocation algorithms in the OS. These
are as follows:
Disadvantage
The only drawback of this algorithm is that it doesn't allocate frames based on
priority. Priority frame allocation solves this problem
Advantages
Disadvantages
The process itself may not solely control the page fault ratio of a process.
The paging behavior of other processes also influences the number of
pages in memory for a process.
Advantages
Disadvantages