0% found this document useful (0 votes)
2 views4 pages

Overview of Operating Systems Explained

The document provides an overview of various operating systems, including Windows, macOS, Linux, Unix, Android, and iOS, highlighting their features and use cases. It also explains key concepts such as processes, threads, multiprogramming, multitasking, and CPU scheduling algorithms, as well as synchronization mechanisms and deadlock handling techniques. Additionally, it covers memory management strategies like fixed and dynamic partitioning, and memory allocation algorithms.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Overview of Operating Systems Explained

The document provides an overview of various operating systems, including Windows, macOS, Linux, Unix, Android, and iOS, highlighting their features and use cases. It also explains key concepts such as processes, threads, multiprogramming, multitasking, and CPU scheduling algorithms, as well as synchronization mechanisms and deadlock handling techniques. Additionally, it covers memory management strategies like fixed and dynamic partitioning, and memory allocation algorithms.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

high level of stability, security, and flexibility.

Numerous distributions of Linux,


such as Ubuntu, Fedora, and CentOS, cater to different user needs.

4. Unix: Unix is a powerful multi-user operating system that served as the


foundation for many other operating systems, including Linux and macOS. It
provides a stable and secure environment and is famous for server
applications.

5. Android: Developed by Google, Android is an open-source operating system


primarily designed for mobile devices such as smartphones and tablets. It
offers a rich ecosystem of applications and customization options.

6. iOS: Developed by Apple, iOS is the operating system used on iPhones,


iPads, and iPods. It provides a seamless and secure user experience,
focusing on performance and integration with other Apple devices.

Operating System in One Video 7. Real-Time Operating Systems (RTOS): RTOS is designed for systems that
require deterministic and real-time response. It is commonly used in
embedded systems, control systems, and IoT devices.

1. What is an Operating System & Types of OS 2. Difference between Multiprogramming, Multiprocess,


An operating system (OS) is software that acts as an interface between computer Multitasking, and Multithreading
hardware and user applications. It manages the resources and provides services
1. Multiprocess:
for the efficient and secure execution of programs. The primary functions of an
Multiprocess refers to the execution of multiple processes on a system with
operating system include process management, memory management, file
multiple CPUs or CPU cores. Each process is an instance of a running
system management, device management, and user interface.
program, and multiple processes can execute concurrently. In multiprocess
There are several types of operating systems, including: systems, each process has its own memory space and resources.
1. Windows: Developed by Microsoft, Windows is a widely used operating Multiprocessing aims to increase system throughput and provide faster
system for personal computers. It offers a user-friendly interface, supports a execution by distributing the workload across multiple processors.
vast range of software applications, and is compatible with various hardware 2. Multithreading:
configurations. Multithreading involves executing multiple threads within a single process. A
2. macOS: Developed by Apple, macOS is the operating system used on Apple thread is a lightweight unit of execution that can run concurrently with other
Mac computers. It provides a sleek and intuitive user interface, seamless threads within the same process. Threads share the same memory space
integration with other Apple devices, and a robust ecosystem of software and resources, such as file handles and network connections. Multithreading
applications. allows for parallel execution within a process, enabling better utilization of
system resources and potentially improving performance by dividing tasks
3. Linux: Linux is an open-source operating system that is highly customizable
into smaller units of work that can be executed concurrently.
and widely used in server environments and embedded systems. It offers a
3. Multiprogramming:
Multiprogramming is a technique where multiple programs are loaded into

Operating System in One Video 1 Operating System in One Video 2

memory simultaneously, and the CPU switches between them to execute In summary, a program is a set of instructions, a process is an instance of a
instructions. The purpose of multiprogramming is to maximize CPU utilization program in execution with its own resources and memory space, and a thread is
and keep the CPU busy by quickly switching between different programs a unit of execution within a process that allows for the concurrent execution of
when one is waiting for I/O or other operations. Each program has its own tasks. Processes provide isolation and protection between different instances of a
separate memory space. program, while threads within a process share resource and enable parallel
execution of tasks.
4. Multitasking:
Multitasking is a technique that allows multiple tasks or processes to run
concurrently on a single CPU. The CPU time is divided among the tasks,
4. Various Process States
giving the illusion of parallel execution. The operating system switches
between tasks rapidly, giving each task a time slice or quantum to execute.
Multitasking is commonly used in modern operating systems to provide
responsiveness and the ability to run multiple applications simultaneously.

3. Process vs Threads vs Programs


Program:
A program is a set of instructions written in a programming language that
performs a specific task or set of tasks. It is typically stored in a file on disk
and represents an executable entity. Programs can be compiled or
interpreted, and they serve as a blueprint for the execution of tasks on a
computer system.

Process:
A process is an instance of a program in execution. When a program is
loaded into memory and executed, it becomes a process. A process is an
independent entity with its own memory space, resources, and execution
context. It has its own program counter, stack, and variables. Processes are
managed by the operating system, and each process runs in its own
protected memory space. Processes can be concurrent and communicate
with each other through inter-process communication mechanisms.

Thread:
A thread is a unit of execution within a process. It represents a sequence of
5. CPU scheduling Algorithms
instructions that can be scheduled and executed independently. Threads
share the same memory space and resources within a process. Multiple CPU scheduling algorithms are used by the operating system to determine the
threads within a process can run concurrently, allowing for parallel execution order in which processes are executed on the CPU.
of tasks. Threads within the same process can communicate and share data 1. First-Come, First-Served (FCFS):
more easily compared to inter-process communication. However, each In the FCFS scheduling algorithm, the process that arrives first is executed
thread has its own program counter and stack. first. It follows a non-preemptive approach, meaning that once a process

Operating System in One Video 3 Operating System in One Video 4


starts running, it continues until it completes or voluntarily gives up the CPU. The critical section represents a portion of code or a block where a process or
FCFS is simple to understand but may lead to poor utilization of the CPU if thread accesses a shared resource, such as a variable, file, or database. It's a
long processes arrive before shorter ones. section that needs to be executed in an atomic or mutually exclusive manner.

2. Shortest Job Next (SJN) or Shortest Job First (SJF): To maintain data integrity and avoid conflicts, only one process or thread should
SJN or SJF scheduling selects the process with the shortest total execution be allowed to enter the critical section at a time. This ensures that no two
time next. It can be either non-preemptive or preemptive. In the non- processes interfere with each other and modify shared resources simultaneously,
preemptive variant, the process continues executing until it completes, preventing inconsistencies or incorrect results.
whereas in the preemptive variant, if a new process with a shorter burst time
arrives, the currently running process may be preempted. SJN/SJF aims to
minimize the average waiting time and is suitable when burst times are 7. Process synchronisation
known in advance. Process synchronization is like a traffic signal that helps regulate the flow of
vehicles at an intersection. In the context of computing, it refers to techniques
3. Round Robin (RR):
and mechanisms used to coordinate the execution of processes or threads so
Round Robin is a preemptive scheduling algorithm that assigns a fixed time
that they can work together harmoniously.
quantum (e.g., 10 milliseconds) to each process in a circular manner. Once a
process exhausts its time quantum, it is moved to the back of the ready Imagine multiple processes or threads working on different tasks simultaneously.
queue, allowing the next process in line to execute. RR provides fair Process synchronization ensures that they cooperate and communicate
execution to all processes but may suffer from high context-switching effectively to avoid conflicts and ensure proper order of execution. It helps
overhead and may not be efficient for long-running processes. prevent issues like race conditions, data inconsistencies, or deadlocks that can
arise when multiple processes or threads access shared resources
4. Priority Scheduling:
simultaneously.
Priority scheduling assigns a priority value to each process, and the CPU is
allocated to the process with the highest priority. It can be either preemptive Here are the key requirements of synchronization mechanisms:
or non-preemptive. In preemptive priority scheduling, if a higher-priority 1. Mutual Exclusion: The synchronization mechanism should enforce mutual
process arrives, the currently running process may be preempted. In non- exclusion, which means that only one process or thread can access a shared
preemptive priority scheduling, the process continues executing until it resource or enter a critical section at a time. It ensures that concurrent
completes or voluntarily gives up the CPU. Priority scheduling can suffer from access to shared resources does not result in conflicts or inconsistencies.
starvation if a lower-priority process never gets a chance to execute.
2. Progress: The synchronization mechanism should allow processes or
5. Multilevel Queue Scheduling: threads to make progress by ensuring that at least one process/thread can
Multilevel queue scheduling divides the ready queue into multiple priority enter the critical section when it desires to do so. It avoids situations where
queues, each with its own scheduling algorithm. Processes are initially all processes/threads are blocked indefinitely, leading to a deadlock.
placed in the highest-priority queue and can move between queues based on
predefined criteria. This approach allows for the differentiation of processes 3. Bounded Waiting: The synchronization mechanism should provide a
based on their priority or characteristics, such as foreground or background guarantee that a process/thread waiting to enter a critical section will
tasks. Each queue can use a different scheduling algorithm, such as FCFS, eventually be allowed to do so. It prevents a process/thread from being
SJF, or RR, suitable for the processes within that queue. starved or waiting indefinitely to access a shared resource

6. Critical section Problem 8. Process Synchronisation Mechanisms

Operating System in One Video 5 Operating System in One Video 6

Here are some of the mechanisms that fulfill the above process synchronization two processes cannot use the same resource at the same time.
requirements:
Hold and Wait
1. Locks/Mutexes: Locks or mutexes (mutual exclusions) provide a simple and A process waits for some resources while holding another resource at the
effective way to achieve mutual exclusion. They allow only one process or same time.
thread to acquire the lock at a time, ensuring exclusive access to a shared
No preemption
resource or critical section. Locks can be implemented using hardware
The process once scheduled will be executed till the completion. No other
instructions or software constructs.
process can be scheduled by the scheduler meanwhile.
2. Semaphores: Semaphores are synchronization objects that can be used to
Circular Wait
control access to shared resources. They can be implemented as binary
All the processes must be waiting for the resources in a cyclic manner so that
semaphores (mutexes) or counting semaphores. Counting semaphores allow
the last process is waiting for the resource which is being held by the first
a specified number of processes or threads to access a shared resource
process.
simultaneously. Semaphores provide mechanisms for mutual exclusion,
signaling, and coordination.

3. Read-Write Locks: Read-write locks provide synchronization mechanisms 10. Deadlock Handling Techniques
for scenarios where multiple readers can simultaneously access a shared 1. Deadlock Prevention: Deadlock prevention techniques aim to eliminate one
resource without conflicts, but exclusive access is required for writers. Read or more of the necessary conditions for deadlock to occur. These conditions
locks can be acquired simultaneously by multiple readers, while write locks include mutual exclusion, hold and wait, no preemption, and circular wait. By
are exclusive. Read-write locks allow for better concurrency when reading is ensuring that one or more of these conditions are not satisfied, deadlocks
more frequent than writing. can be prevented from happening in the first place. However, prevention
techniques may impose restrictions on resource allocation and may not be
always feasible or efficient.
9. Deadlock
2. Deadlock Avoidance: Deadlock avoidance techniques use resource
A Deadlock is a situation where
allocation algorithms and resource request protocols to avoid situations that
each of the computer processes
may lead to deadlocks. These techniques involve the use of resource
waits for a resource that is being
allocation graphs, bankers' algorithm, or other dynamic allocation strategies.
assigned to another process. In
The idea is to have a system that can predict whether granting a resource
this situation, none of the
request will lead to a potential deadlock. If a request might cause a deadlock,
process gets executed since the
it is delayed until granting it will not cause any issues.
resource it needs, is held by
some other process that is also 3. Deadlock Detection: Deadlock detection techniques involve periodically
waiting for some other resource examining the resource allocation state to determine if a deadlock has
to be released. occurred. This can be achieved through algorithms such as the resource-
allocation graph or the Banker's algorithm. When a deadlock is detected, the
Necessary Conditions for
system can take appropriate actions to resolve it, such as terminating
Deadlocks:
processes, resource preemption, or rolling back the system to a safe state.
Mutual Exclusion 4. Deadlock Recovery: Deadlock recovery techniques are used to recover
A resource can only be shared in a mutually exclusive manner. It implies that from a deadlock once it has been detected. This involves terminating one or

Operating System in One Video 7 Operating System in One Video 8


more processes involved in the deadlock to break the circular wait and Memory management techniques, such as compaction or memory allocation
release the resources held by those processes. The terminated processes algorithms like first-fit, best-fit, or worst-fit, are employed to optimize
can be restarted later to continue their execution. memory utilization and minimize fragmentation in dynamic partitioning
systems.
5. Deadlock Ignorance: Some systems choose to ignore the problem of
deadlocks entirely. This approach assumes that deadlocks will rarely occur
and focuses on other system aspects. However, it is generally not
12. Partition and Memory allocation
recommended unless deadlocks are extremely rare or have minimal impact
on system functionality. Operating systems like Windows and Linux mainly 1. First Fit: The first-fit algorithm allocates the first available memory block that
focus on performance. However, the performance of the system decreases if is large enough to accommodate the process. It starts searching from the
it uses a deadlock handling mechanism all the time if a deadlock happens 1 beginning of the memory and selects the first suitable block encountered.
out of 100 times then it is completely unnecessary to use the deadlock This algorithm is simple and provides fast allocation, but it may result in
handling mechanism all the time. relatively larger leftover fragments.

2. Best Fit: The best-fit algorithm searches for the smallest available memory
block that is large enough to accommodate the process. It aims to minimize
11. Memory Management leftover fragments by choosing the most optimal block. This algorithm can
Fixed partitioning and dynamic partitioning are two approaches used in memory lead to better overall memory utilization, but it may involve more time-
management systems to allocate and manage memory resources. Let's discuss consuming searches.
each approach:
3. Worst Fit: The worst-fit algorithm allocates the largest available memory
1. Fixed Partitioning: block to the process. This approach intentionally keeps larger fragments to
In fixed partitioning, memory is divided into fixed-sized partitions or blocks, accommodate potential future larger processes. While it may seem
and each partition is assigned to a specific process or task. The system counterintuitive, it can help reduce fragmentation caused by small processes
allocates a predetermined amount of memory to each partition, which and improve overall memory utilization.
remains fixed throughout the execution.
Fixed partitioning is relatively simple to implement and provides fast memory
13. Paging
allocation. However, it can lead to inefficient memory utilization due to
internal fragmentation, especially when processes have varying memory In Operating Systems, Paging is a storage mechanism used to retrieve
requirements. processes from the secondary storage into the main memory in the form of
pages.
2. Dynamic Partitioning:
Dynamic partitioning, also known as variable partitioning, addresses the The main idea behind the paging is to divide each process in the form of pages.
limitation of fixed partitioning by allowing memory to be allocated and The main memory will also be divided in the form of frames.
deallocated dynamically based on the size requirements of processes. One page of the process is to be stored in one of the frames of the memory. The
Dynamic partitioning provides better memory utilization compared to fixed pages can be stored at the different locations of the memory but the priority is
partitioning, as memory can be allocated based on actual requirements. always to find the contiguous frames or holes.
However, managing fragmentation and efficiently allocating and deallocating Pages of the process are brought into the main memory only when they are
memory can be more complex. required otherwise they reside in the secondary storage.

Operating System in One Video 9 Operating System in One Video 10

15. Page replacement algorithms


1. First-In-First-Out Page Replacement Algorithm

In FIFO page replacement, the operating system maintains a queue or list of


pages in the order they were brought into memory. When a page fault
happens (i.e., the required page is not in memory), the page at the front of
the queue, which was the earliest one to be brought in, is selected for
replacement. The new page is then brought into memory, and the page at the
front of the queue is removed.

2. Optimal Page replacement


In this algorithm, pages are replaced which would not be used for the longest
duration of time in the future.
In theory, optimal page replacement provides the best possible performance
14. Virtual Memory by minimizing the number of page faults. However, in practice, it is not
Virtual memory is a concept that lets a computer use more memory than it feasible to implement the optimal page replacement algorithm in most real-
actually has. It creates an imaginary memory space by combining physical world scenarios. The main reason for this is that the algorithm requires
memory (RAM) and secondary storage (like a hard disk). When a program needs knowledge of future page references, which is generally impossible to
more memory than is available in RAM, it temporarily moves some data to the determine in advance.
secondary storage. This allows the computer to run larger programs and handle
multiple tasks at once. Virtual memory also provides memory protection, ensuring
that programs can't access each other's memory directly.
Instead of loading one big process in the main memory, the Operating System
loads the different parts of more than one process in the main memory.
By doing this, the degree of multiprogramming will be increased and therefore,
the CPU utilization will also be increased.

Operating System in One Video 11 Operating System in One Video 12


3. Least Recently Used
In this algorithm, the page will be replaced which is least recently used.

LRU works on the principle that pages that have been recently accessed are
more likely to be accessed again in the near future. By replacing the least
recently used pages, it aims to retain the frequently accessed pages in
memory, reducing the number of page faults and improving overall system
performance.
17. Segmentation
Segmentation divides processes into smaller subparts known as modules. The
divided segments need not be placed in contiguous memory. Since there is no
contiguous memory allocation, internal fragmentation does not take place. The
length of the segments of the program and memory is decided by the purpose of
the segment in the user program.

Segmentation came into existence


because of the problems with the paging
technique. In the case of the paging
technique, a function or piece of code is
divided into pages without considering that
16. Thrashing
the relative parts of code can also get
Thrashing refers to a situation in computer systems where the system spends a divided. Hence, for the process in
significant amount of time and resources continuously swapping pages between execution, the CPU must load more than
physical memory (RAM) and secondary storage (such as a hard disk) due to one page into the frames so that the
excessive paging activity. In thrashing, the system is busy moving pages in and complete related code is there for
out of memory rather than executing useful work, leading to severe degradation execution. Paging took more pages for a
in performance. process to be loaded into the main
memory.

Operating System in One Video 13 Operating System in One Video 14

Hence, segmentation was introduced in which the code is divided into modules consider the position of the disk head or the proximity of the requests,
so that related code can be combined in one single block. resulting in potential delays if there are long seek times between requests.

2. SSTF (Shortest Seek Time First): This algorithm selects the request with
the shortest seek time from the current position of the disk head. It minimizes
18. Disk Management
the average seek time and reduces the overall disk access time. However, it
may lead to starvation of requests located farther away from the current
position.

3. SCAN: Also known as the elevator algorithm, SCAN moves the disk head in
one direction (e.g., from the outermost track to the innermost or vice versa)
and services requests along the way. Once it reaches the end, it changes
direction and continues the same process. This algorithm provides a fair
distribution of service and prevents starvation, but it may result in longer
response times for requests at the far ends of the disk.

4. C-SCAN (Circular SCAN): Similar to SCAN, C-SCAN moves the disk head
in one direction, but instead of reversing direction, it jumps to the other end of
the disk and starts again. This ensures a more consistent response time for
all requests, but it may cause delays for requests that arrive after the head
has passed their location.

5. LOOK: LOOK is a variant of SCAN that only goes as far as the last request
Seek Time in its current direction. Once there are no more requests in that direction, it
reverses direction. This reduces unnecessary traversal of the entire disk and
Seek time is the time taken in locating the disk arm to a specified track where the
improves response times for requests.
read/write request will be satisfied.
6. C-LOOK (Circular LOOK): Similar to C-SCAN, C-LOOK jumps to the other
Rotational Latency
end of the disk without servicing requests along the way. This reduces seek
It is the time taken by the desired sector to rotate itself to the position from where time and improves disk throughput.
it can access the R/W heads.
For images: [Link]

19. Disk scheduling algorithms


Disk scheduling is a key component of disk management that determines the
order in which disk I/O (input/output) requests are processed and serviced by the
disk controller. It aims to minimize the seek time and rotational latency and
maximize the overall disk performance.

1. FCFS (First-Come, First-Served): This is the simplest disk scheduling


algorithm that processes requests in the order they arrive. It does not

Operating System in One Video 15 Operating System in One Video 16

You might also like