[go: up one dir, main page]

0% found this document useful (0 votes)
54 views30 pages

Unit 1 OS Notes - Part 1

Uploaded by

dedali8086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views30 pages

Unit 1 OS Notes - Part 1

Uploaded by

dedali8086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

What is an Operating System?

Operating System lies in the category of system software. It basically manages


all the resources of the computer. An operating system acts as an interface
between the software and different parts of the computer or the computer
hardware. The operating system is designed in such a way that it can manage
the overall resources and operations of the computer.

Operating System is a fully integrated set of specialized programs that handle


all the operations of the computer. It controls and monitors the execution of all
other programs that reside in the computer, which also includes application
programs and other system software of the computer. Examples of Operating
Systems are Windows, Linux, Mac OS, etc.
An Operating System (OS) is a collection of software that manages computer
hardware resources and provides common services for computer programs.
The operating system is the most important type of system software in a
computer system.

Features of the Operating System

1. User Interface:
A user interface (UI) is provided by an operating system to allow users to
interact with the hardware of the computer system. A user interface is only
considered good when it is simple looking, easy to use, and adaptable to user
needs. Also, the user interface must be fast and responsive, allowing users to
perform actions quickly and efficiently.

2. Memory Management:
An Operating System manages computer memory by allocating and
deallocating memory for different processes running on the computer. The
operating system also provides protection to memory by preventing
unauthorized access, virtual memory to expand the physical memory of the
computer, and algorithms for the allocation and deallocation of memory.

3. Process Management:
An Operating System plays the role of a manager by managing all the
processes which are running on the computer. It should be capable of
performing multitasks, allowing multiple processes to run simultaneously, and
providing process scheduling algorithms to ensure fair resource allocation to
processes. It should also have process synchronization and communication
capabilities to enable processes to communicate with each other.

4. Device Management:
An Operating System manages and controls hardware devices connected to
the computer system. It provides device drivers to manage device-specific
communication, plug and play to automatically detect and configure new
devices, and error detection and handling for device failures.

5. File Management:
An Operating System manages files and folders on the computer system. It
provides file allocation methods to efficiently store and retrieve files, file
naming conventions to enable easy location of files, and file access controls to
manage file permissions.

6. Security:
An Operating System provides security features to protect against
unauthorized access, file encryption to protect sensitive data, firewall, and
antivirus software to protect against network and software attacks, and
backup and recovery features to ensure data availability in case of data loss
or system failure.

7. Performance:
An Operating System provides features to ensure the efficient performance of
the computer system, including fast boot and shutdown times, low resource
consumption, minimal software bloat, and fast response times for user
interaction.

Characteristics of Operating System

Below are the detailed characteristics of Operating System:

1. Concurrency:
An Operating System should be able to handle multiple tasks or processes at
the same time, allowing users to multitask and improve system efficiency.

2. Hardware Abstraction:
An operating system should provide hardware abstraction, which means it
should provide a uniform interface to hardware devices, making it easier for
software applications to interact with hardware devices without having to know
the underlying hardware details.
3. Resource Allocation:
An operating system should allocate system resources fairly so that each
process gets access to the resources it needs to function correctly. It should
also allocate resources dynamically, based on the current system load and
user demand.

4. Virtualization:
An operating system create virtual resources i.e virtual memory and virtual
CPUs, in order to enhance the efficiency of system and also to enable multiple
processes to run at the same time.

5. Security:
An operating system provides security features like protection against
unauthorized access, file encryption of sensitive data, firewalls, and antivirus
softwares. It also provides features like backup and recovery to ensure data
availability in case of data loss or system failure.

6. Fault Tolerance:
An operating system is designed in such a way that it is able to handle
hardware and software failures and performs error detection and recovery
mechanisms in order to minimize system downtime and data loss.

7. Scalability:
An operating system is capable to scale from small embedded devices to
large servers and clusters, providing efficient resource management and
performance regardless of the system size.

8. Compatibility:
An operating system is compatible with a wide range of hardware and
software devices, allowing software applications to run on different hardware
platforms.

9. Customizability:
An operating system should be customizable, enabling users to tailor the
system to their needs and preferences, such as changing the UI, adding or
removing system features, or modifying system settings.

10. Ease of Use:


An operating system is user-friendly and very easy to use, providing a simple
and intuitive interface for users with no or less computer knowledge to interact
with the system and run applications.
Why Use an Operating System?
The operating system helps in improving the computer software as well as
hardware. Without OS, it became very difficult for any application to be user-
friendly. Operating System provides a user with an interface that makes any
application attractive and user-friendly. The operating System comes with a
large number of device drivers that makes OS services reachable to the
hardware environment. Each and every application present in the system
requires the Operating System. The operating system works as a
communication channel between system hardware and system software. The
operating system helps interact an application with the hardware part without
knowing about the actual hardware configuration. It is one of the most important
parts of the system and hence it is present in every device, whether large or
small device.

Functions of the Operating System


 Resource Management: The operating system manages and allocates
memory, CPU time, and other hardware resources among the various
programs and processes running on the computer.
 Process Management: The operating system is responsible for starting,
stopping, and managing processes and programs. It also controls the
scheduling of processes and allocates resources to them.
 Memory Management: The operating system manages the computer’s
primary memory and provides mechanisms for optimizing memory usage.
 Security: The operating system provides a secure environment for the user,
applications, and data by implementing security policies and mechanisms
such as access controls and encryption.
 Job Accounting: It keeps track of time and resources used by various jobs
or users.
 File Management: The operating system is responsible for organizing and
managing the file system, including the creation, deletion, and manipulation
of files and directories.
 Device Management: The operating system manages input/output devices
such as printers, keyboards, mice, and displays. It provides the necessary
drivers and interfaces to enable communication between the devices and the
computer.
 Networking: The operating system provides networking capabilities such as
establishing and managing network connections, handling network protocols,
and sharing resources such as printers and files over a network.
 User Interface: The operating system provides a user interface that enables
users to interact with the computer system. This can be a Graphical User
Interface (GUI), a Command-Line Interface (CLI), or a combination of both.
 Backup and Recovery: The operating system provides mechanisms for
backing up data and recovering it in case of system failures, errors, or
disasters.
 Virtualization: The operating system provides virtualization capabilities that
allow multiple operating systems or applications to run on a single physical
machine. This can enable efficient use of resources and flexibility in
managing workloads.
 Performance Monitoring: The operating system provides tools for
monitoring and optimizing system performance, including identifying
bottlenecks, optimizing resource usage, and analyzing system logs and
metrics.
 Time-Sharing: The operating system enables multiple users to share a
computer system and its resources simultaneously by providing time-sharing
mechanisms that allocate resources fairly and efficiently.
 System Calls: The operating system provides a set of system calls that
enable applications to interact with the operating system and access its
resources. System calls provide a standardized interface between
applications and the operating system, enabling portability and compatibility
across different hardware and software platforms.
 Error-detecting Aids: These contain methods that include the production of
dumps, traces, error messages, and other debugging and error-detecting
methods.
Objectives of Operating Systems
Let us now see some of the objectives of the operating system, which are
mentioned below.
 Convenient to use: One of the objectives is to make the computer system
more convenient to use in an efficient manner.
 User Friendly: To make the computer system more interactive with a more
convenient interface for the users.
 Easy Access: To provide easy access to users for using resources by
acting as an intermediary between the hardware and its users.
 Management of Resources: For managing the resources of a computer in
a better and faster way.
 Controls and Monitoring: By keeping track of who is using which resource,
granting resource requests, and mediating conflicting requests from different
programs and users.
 Fair Sharing of Resources: Providing efficient and fair sharing of resources
between the users and programs.

Examples of Operating Systems


 Windows (GUI-based, PC)
 GNU/Linux (Personal, Workstations, ISP, File, and print server, Three-tier
client/Server)
 macOS (Macintosh), used for Apple’s personal computers and workstations
(MacBook, iMac).
 Android (Google’s Operating System for
smartphones/tablets/smartwatches)
 iOS (Apple’s OS for iPhone, iPad, and iPod Touch)

Evolution of Operating System


The journey of operating systems started in 1940 with the beginning of the digital age. The earliest
computer was operated without an operating system, and the programs were manually written and
executed sequentially.

First Generation (Serial Processing)

 Time Period: The 1940s and 1950s marked the start of electronic computers. They were the new
trend, replacing old mechanical ones.
 Size and Cost: These early computers were huge! And they came with a big price tag too.
 Basic Functions: Despite their size and cost, they could only do simple tasks.
 No Operating System: Imagine a computer without an operating system! That’s how they were.
They just did tasks one by one.
 Serial Processing: This means they finish one task before starting the next. No multitasking here!

Limitations of First Generation

 Wasted Power: The main computer brain, the CPU, often just sat there doing nothing. It waited a
lot, especially during tasks like reading data, which wasted its power.
 One Task at a Time: These systems were like a person who can’t multitask. They could only
handle one job at a time, making things slow.
 Long Wait Times: Imagine giving someone a job and waiting ages to see the result. That’s how
these systems were. You’d give them a task, and it took forever to get the outcome.

Second Generation (Batch System)

 Due to the inefficiencies of serial processing, the need for a more optimized approach became
evident. This led to the development of a batch-processing system. This era (1950-60) is called the
second generation of operating systems.
 In a batch system, similar tasks (or jobs) are grouped into batches and then processed sequentially
without any user interaction.
 The goal was to automate the processing of jobs and minimize the setup time.
 A scripting language, Job Control Language (JCL), was introduced to manage these batches.
 It allows operators to specify the sequence of jobs to be executed.

Advantages

 The system optimizes the processing sequence by grouping similar tasks, reducing the overhead
and setup time between jobs.
 It allows for automated processing of tasks, i.e., reduces the need for manual intervention.
 The system could better utilize CPU and minimum idle time by processing tasks in batches.

Limitations

 It lacks real-time user interaction, i.e., users have to wait for the entire batch to be processed.
 If the batches contain multiple tasks, giving output takes a longer time.
 Once the batch is processed, corrections can’t be done.

Third Generation (Multi-Programmed Batch System)


In the previous two generations, the systems ran jobs one at a time in sequence, which was efficient
because the CPU had to wait for I/O operations to complete. To overcome this, multiprogramming
was introduced in the next generations of operating systems.

 Multiprogramming allows multiple jobs to reside in the main memory at once, i.e., the CPU could
switch to another job if one job needs to wait for I/O operation. Due to multi-programming CPU
could process more jobs in a given amount of time.
 Since multiple jobs are done at once, there was a need for more advanced memory management.
These memory needs led to the development of concepts such as memory partitioning, paging, and
segmentation.
 Since multiple jobs are done at a time, it is important to decide which job to execute first, second,
or last. Algorithms like First-Come-First-Serve, Shortest Job Next (SJN), and Round Robin are
developed.
 The complexity of the OS was increased, and system utilities were developed to help manage files,
devices, and other system resources.
 Operating systems were accompanied by hardware like Integrated Circuit, which allowed for
smaller, faster, and more reliable computers.

Fourth Generation (Time-Sharing Operating System)


The fourth-generation operating system was more commonly associated with programming
languages that were close to human language and often used for database-related tasks.

The fourth generation has features like:

 Graphical User Interface that allows users to interact with the system using windows, icons, and
menus.
 Ability to run multiple applications simultaneously.
 Built-in capabilities to connect to and function on networks, including the Internet.
 Automatically recognize and configure hardware devices.
 Advanced security mechanism to protect against malware, unauthorized access.
 Compatibility with a wide range of hardware devices and architecture.
 The OS allocates a small time slice or quantum to each task.

Advantages of Operating System

 User-friendly: Makes computers easy to use.


 Manages resources: Handles CPU, memory, and storage well.
 Multitasking: This lets you run many apps at once.
 Error handling: Keeps the system running smoothly.
 Developer-friendly: Ensures apps work well and consistently.

Disadvantages of the Operating System

 Can Perform Slow: Extra software layer might reduce speed.


 Needs specific setups: It might not work well on old computers.
 Can be costly: Some, like Windows or macOS, aren’t free.
 Software limits: Not all apps work on every system.
 Learning new systems: Switching can be tough for users.

Interactive Operating System


Interactive operating systems are computers that accept human inputs. Users
give commands or some data to the computers by typing or by gestures. Some
examples of interactive systems include MS Word and Spreadsheets, etc. They
facilitate interactive behavior. Mac and Windows OS are some examples of
interactive operating systems.

What is an Interactive Operating System?


 An interactive operative system is an operating system that allows the
execution of interactive programs. All PC operating systems are interactive
operating systems only.
 An interactive operating system gives permission to the user to interact
directly with the computer. In an Interactive operating system, the user
enters some command into the system and the work of the system is to
execute it.
 Programs that allow users to enter some data or commands are known as
Interactive Operating Systems. Some commonly used examples of
Interactive operating systems include Word Processors and Spreadsheet
Applications.
 A non-interactive program can be defined as one that once started continues
without the need for human interaction. A compiler can be an example of a
non-interactive program.

Properties of Interactive Operating System:


1. Batch Processing: It is defined as the process of gathering programs and
data together in a batch before performing them. The job of the operating
system is to define the jobs as a single unit by using some already defined
sequence of commands or data, etc.
Before they are performed or carried out, these are stored in the memory of
the system and their processing depends on a FIFO basis. The operating
system releases the memory and then copies the output into an output spool
for later printing when the job is finished. Its use is that it basically improves
the system performance because a new job begins only when the old one is
completed without any interference from the user. One disadvantage is that
there is a small chance that the jobs will enter an infinite loop. Debugging is
also somewhat difficult with batch processing.
2. Multitasking: The CPU can execute many tasks simultaneously by
switching between them. This is known as Time- Sharing System and also it
has a very fast response time. They switch so Fastly that the users can very
easily interact with each running program.
3. Multiprogramming: Multiprogramming happens when the memory of the
system stores way too many processes. The job of the operating system
here is that runs these processes in parallel on the same processor. Multiple
processes share the CPU, thus increasing CPU utilization. Now, the CPU
only performs one job at a particular time while the rest wait for the
processor to be assigned to them. The operating system takes care of the
fact that the CPU is never idle by using its memory management programs
so that it can monitor the state of all system resources and active programs.
One advantage of this is that it gives the user the feeling that the CPU is
working on multiple programs simultaneously.
4. Distributive Environment: A distributive environment consists of many
independent processors. The job of the operating system here is that
distribute computation logic among the physical processors and also at the
same time manage communication between them. Each processor has its
own local memory, so they do not share a memory.
5. Interactivity: Interactivity is defined as the power of a user to interact with
the system. The main job of the operating system here is that it basically
provides an interface for interacting with the system, manages I/O devices,
and also ensures a fast response time.
6. Real-Time System: Dedicated embedded systems are real-time systems.
The main job of the operating system here is that reads and react to sensor
data and then provide a response in a fixed time period, therefore, ensuring
good performance.
7. Spooling: Spooling is defined as the process of pushing the data from
different I/O jobs into a buffer or somewhere in the memory so that any
device can access the data when it is ready. The operating system here
handles the I/O device data spooling because the devices have different
data access rates in order to maintain the spooling buffer. Now the job of the
buffer here is that acts like a waiting station for the data to rest while the
devices which are slower can catch up.

Example of an Interactive Operating System:

Some examples of Interactive operating systems are as follows:


1. Unix Operating System
2. Disk Operating System
Advantages of Interactive Operating System:
The advantages of an Interactive Operating System are as follows:
1. Usability: An operating system is designed to perform something and the
interactiveness allows the user to manage the tasks more or less in real-
time.
2. Security: Simple security policy enhancement. In non-interactive systems,
the user virtually always knows what their programs will do during their
lifetime, thus allowing us to forecast and correct the bugs.
Disadvantages of Interactive Operating System:
1. Tough to design: Depending on the target device, interactivity might be
proved challenging to design because the user must be prepared for every
input. What about having many inputs? The state of a program can alternate
at any particular time, all the programs should be handled in some way, and
also it doesn’t always work out properly.

Real Time Operating System (RTOS)


Real-time operating systems (RTOS) are used in environments where a large
number of events, mostly external to the computer system, must be accepted
and processed in a short time or within certain deadlines. such applications are
industrial control, telephone switching equipment, flight control, and real-time
simulations. With an RTOS, the processing time is measured in tenths of
seconds. This system is time-bound and has a fixed deadline. The processing
in this type of system must occur within the specified constraints. Otherwise,
This will lead to system failure.
Examples of real-time operating systems are airline traffic control systems,
Command Control Systems, airline reservation systems, Heart pacemakers,
Network Multimedia Systems, robots, etc.
The real-time operating systems can be of 3 types –

RTOS

1. Hard Real-Time Operating System: These operating systems guarantee


that critical tasks are completed within a range of time.
For example, a robot is hired to weld a car body. If the robot welds too early
or too late, the car cannot be sold, so it is a hard real-time system that
requires complete car welding by the robot hardly on time., scientific
experiments, medical imaging systems, industrial control systems, weapon
systems, robots, air traffic control systems, etc.

2. Soft real-time operating system: This operating system provides some


relaxation in the time limit.
For example – Multimedia systems, digital audio systems, etc. Explicit,
programmer-defined, and controlled processes are encountered in real-time
systems. A separate process is changed by handling a single external event.
The process is activated upon the occurrence of the related event signaled
by an interrupt.
Multitasking operation is accomplished by scheduling processes for
execution independently of each other. Each process is assigned a certain
level of priority that corresponds to the relative importance of the event that it
services. The processor is allocated to the highest-priority processes. This
type of schedule, called, priority-based preemptive scheduling is used by
real-time systems.

3. Firm Real-time Operating System: RTOS of this type have to follow


deadlines as well. In spite of its small impact, missing a deadline can have
unintended consequences, including a reduction in the quality of the product.
Example: Multimedia applications.
4. Deterministic Real-time operating System: Consistency is the main key in
this type of real-time operating system. It ensures that all the task and
processes execute with predictable timing all the time,which make it more
suitable for applications in which timing accuracy is very
important. Examples: INTEGRITY, PikeOS.

Advantages:
The advantages of real-time operating systems are as follows-
1. Maximum consumption: Maximum utilization of devices and systems. Thus
more output from all the resources.

2. Task Shifting: Time assigned for shifting tasks in these systems is very
less. For example, in older systems, it takes about 10 microseconds. Shifting
one task to another and in the latest systems, it takes 3 microseconds.

3. Focus On Application: Focus on running applications and less importance


to applications that are in the queue.

4. Real-Time Operating System In Embedded System: Since the size of


programs is small, RTOS can also be embedded systems like in transport
and others.

5. Error Free: These types of systems are error-free.

6. Memory Allocation: Memory allocation is best managed in these types of


systems.
Disadvantages:
The disadvantages of real-time operating systems are as follows-

1. Limited Tasks: Very few tasks run simultaneously, and their concentration
is very less on few applications to avoid errors.
2. Use Heavy System Resources: Sometimes the system resources are not
so good and they are expensive as well.

3. Complex Algorithms: The algorithms are very complex and difficult for the
designer to write on.

4. Device Driver And Interrupt signals: It needs specific device drivers and
interrupts signals to respond earliest to interrupts.

5. Thread Priority: It is not good to set thread priority as these systems are
very less prone to switching tasks.

6. Minimum Switching: RTOS performs minimal task switching.


Comparison of Regular and Real-Time operating systems:
Regular OS Real-Time OS (RTOS)

Complex Simple

Best effort Guaranteed response

Fairness Strict Timing constraints

Average Bandwidth Minimum and maximum limits

Unknown components Components are known

Unpredictable behavior
Predictable behavior

Plug and play RTOS is upgradeable

System Protection in Operating System


System protection in an operating system refers to the mechanisms
implemented by the operating system to ensure the security and integrity of the
system. System protection involves various techniques to prevent unauthorized
access, misuse, or modification of the operating system and its resources.
There are several ways in which an operating system can provide system
protection:
User authentication: The operating system requires users to authenticate
themselves before accessing the system. Usernames and passwords are
commonly used for this purpose.
Access control: The operating system uses access control lists (ACLs) to
determine which users or processes have permission to access specific
resources or perform specific actions.
Encryption: The operating system can use encryption to protect sensitive data
and prevent unauthorized access.
Firewall: A firewall is a software program that monitors and controls incoming
and outgoing network traffic based on predefined security rules.
Antivirus software: Antivirus software is used to protect the system from
viruses, malware, and other malicious software.
System updates and patches: The operating system must be kept up-to-date
with the latest security patches and updates to prevent known vulnerabilities
from being exploited.
By implementing these protection mechanisms, the operating system can
prevent unauthorized access to the system, protect sensitive data, and ensure
the overall security and integrity of the system.

What is Protection?

Protection refers to a mechanism which controls the access of programs,


processes, or users to the resources defined by a computer system. We can
take protection as a helper to multi programming operating system, so that
many users might safely share a common logical name space such as directory
or files.
Need for Protection:
 To prevent the access of unauthorized users
 To ensure that each active programs or processes in the system uses
resources only as the stated policy
 To improve reliability by detecting latent errors
Role of Protection:
The role of protection is to provide a mechanism that implement policies which
defines the uses of resources in the computer system. Some policies are
defined at the time of design of the system, some are designed by management
of the system and some are defined by the users of the system to protect their
own files and programs. Every application has different policies for use of the
resources and they may change over time so protection of the system is not
only concern of the designer of the operating system. Application programmer
should also design the protection mechanism to protect their system against
misuse. Policy is different from mechanism. Mechanisms determine how
something will be done and policies determine what will be done. Policies are
changed over time and place to place. Separation of mechanism and policy is
important for the flexibility of the system.

Advantages of system protection in an operating system:

1. Ensures the security and integrity of the system


2. Prevents unauthorized access, misuse, or modification of the operating
system and its resources
3. Protects sensitive data
4. Provides a secure environment for users and applications
5. Prevents malware and other security threats from infecting the system
6. Allows for safe sharing of resources and data among users and applications
7. Helps maintain compliance with security regulations and standards

Disadvantages of system protection in an operating system:

1. Can be complex and difficult to implement and manage


2. May slow down system performance due to increased security measures
3. Can cause compatibility issues with some applications or hardware
4. Can create a false sense of security if users are not properly educated on
safe computing practices
5. Can create additional costs for implementing and maintaining security
measures.

Operating System Services


Operating system is a software that acts as an intermediary between the user
and computer hardware. It is a program with the help of which we are able to
run various applications. It is the one program that is running all the time. Every
computer must have an operating system to smoothly execute other programs.
The OS coordinates the use of the hardware and application programs for
various users. It provides a platform for other application programs to work. The
operating system is a set of special programs that run on a computer system
that allows it to work properly. It controls input-output devices, execution of
programs, managing files, etc.
Services of Operating System
1. Program execution
2. Input Output Operations
3. Communication between Process
4. File Management
5. Memory Management
6. Process Management
7. Security and Privacy
8. Resource Management
9. User Interface
10. Networking
11. Error handling
12. Time Management
Program Execution
It is the Operating System that manages how a program is going to be
executed. It loads the program into the memory after which it is executed. The
order in which they are executed depends on the CPU Scheduling Algorithms.
A few are FCFS, SJF, etc. When the program is in execution, the Operating
System also handles deadlock i.e. no two processes come for execution at the
same time. The Operating System is responsible for the smooth execution of
both user and system programs. The Operating System utilizes various
resources available for the efficient running of all types of functionalities.
Input Output Operations
Operating System manages the input-output operations and establishes
communication between the user and device drivers. Device drivers are
software that is associated with hardware that is being managed by the OS so
that the sync between the devices works properly. It also provides access to
input-output devices to a program when needed.
Communication between Processes
The Operating system manages the communication between processes.
Communication between processes includes data transfer among them. If the
processes are not on the same computer but connected through a computer
network, then also their communication is managed by the Operating System
itself.
File Management
The operating system helps in managing files also. If a program needs access
to a file, it is the operating system that grants access. These permissions
include read-only, read-write, etc. It also provides a platform for the user to
create, and delete files. The Operating System is responsible for making
decisions regarding the storage of all types of data or files, i.e, floppy disk/hard
disk/pen drive, etc. The Operating System decides how the data should be
manipulated and stored.
Memory Management
Let’s understand memory management by OS in simple way. Imagine a cricket
team with limited number of player . The team manager (OS) decide whether
the upcoming player will be in playing 11 ,playing 15 or will not be included in
team , based on his performance . In the same way, OS first check whether the
upcoming program fulfil all requirement to get memory space or not ,if all things
good, it checks how much memory space will be sufficient for program and then
load the program into memory at certain location. And thus , it prevents
program from using unnecessary memory.
Process Management
Let’s understand the process management in unique way. Imagine, our kitchen
stove as the (CPU) where all cooking(execution) is really happen and chef as
the (OS) who uses kitchen-stove(CPU) to cook different dishes(program). The
chef(OS) has to cook different dishes(programs) so he ensure that any
particular dish(program) does not take long time(unnecessary time) and all
dishes(programs) gets a chance to cooked(execution) .The chef(OS) basically
scheduled time for all dishes(programs) to run kitchen(all the system) smoothly
and thus cooked(execute) all the different dishes(programs) efficiently.
Security and Privacy
 Security : OS keep our computer safe from an unauthorised user by adding
secuirity layer to it.Basically, Secuirity is nothing but just a layer of protection
which protect computer from bad guys like viruses and hackers. OS provide
us defenses like firewalls and anti-virus software and ensure good safety of
computer and personal information.
 Privacy : OS give us facility to keep our essential information hidden like
having a lock on our door, where only you can enter and other are not
allowed . Basically , it respect our secrets and provide us facility to keep it
safe.
Resource Management
System resources are shared between various processes. It is the Operating
system that manages resource sharing. It also manages the CPU time among
processes using CPU Scheduling Algorithms. It also helps in the memory
management of the system. It also controls input-output devices. The OS also
ensures the proper use of all the resources available by deciding which
resource to be used by whom.
User Interface
User interface is essential and all operating systems provide it. Users either
interface with the operating system through the command-line interface or
graphical user interface or GUI. The command interpreter executes the next
user-specified command.
A GUI offers the user a mouse-based window and menu system as an
interface.
Networking
This service enables communication between devices on a network, such as
connecting to the internet, sending and receiving data packets, and managing
network connections.
Error Handling
The Operating System also handles the error occurring in the CPU, in Input-
Output devices, etc. It also ensures that an error does not occur frequently and
fixes the errors. It also prevents the process from coming to a deadlock. It also
looks for any type of error or bugs that can occur while any task. The well-
secured OS sometimes also acts as a countermeasure for preventing any sort
of breach of the Computer System from any external source and probably
handling them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether it
should be stop(red)=>(simple queue) , start(yellow)=>(ready
queue),move(green)=>(under execution) and this light (control) changes after a
certain interval of time at each side of the road(computer system) so that the
cars(program) from all side of road move smoothly without traffic.

Operating System Structure


Overview
An operating system is a design that enables user application programs to communicate
with the hardware of the machine. The operating system should be built with the utmost
care because it is such a complicated structure and should be simple to use and modify.
Partially developing the operating system is a simple approach to accomplish this. Each
of these components needs to have distinct inputs, outputs, and functionalities.

This article discusses many sorts of structures that implement operating systems, as
listed below, as well as how and why they work. It also defines the operating system
structure.

o Simple Structure
o Monolithic Structure
o Layered Approach Structure
o Micro-Kernel Structure
o Exo-Kernel Structure
o Virtual Machines
What is an operating System Structure?
We want a clear structure to let us apply an operating system to our particular needs
because operating systems have complex structures. It is easier to create an operating
system in pieces, much as we break down larger issues into smaller, more manageable
subproblems. Every segment is also a part of the operating system. Operating system
structure can be thought of as the strategy for connecting and incorporating various
operating system components within the kernel. Operating systems are implemented
using many types of structures, as will be discussed below:

SIMPLE STRUCTURE
It is the most straightforward operating system structure, but it lacks definition and is only
appropriate for usage with tiny and restricted systems. Since the interfaces and degrees of
functionality in this structure are clearly defined, programs are able to access I/O routines,
which may result in unauthorized access to I/O procedures.

This organizational structure is used by the MS-DOS operating system:

o There are four layers that make up the MS-DOS operating system, and each has
its own set of features.
o These layers include ROM BIOS device drivers, MS-DOS device drivers,
application programs, and system programs.
o The MS-DOS operating system benefits from layering because each level can be
defined independently and, when necessary, can interact with one another.
o If the system is built in layers, it will be simpler to design, manage, and update.
Because of this, simple structures can be used to build constrained systems that
are less complex.
o When a user program fails, the operating system as whole crashes.
o Because MS-DOS systems have a low level of abstraction, programs and I/O
procedures are visible to end users, giving them the potential for unwanted
access.

The following figure illustrates layering in simple structure:


Advantages of Simple Structure:

o Because there are only a few interfaces and levels, it is simple to develop.
o Because there are fewer layers between the hardware and the applications, it offers
superior performance.

Disadvantages of Simple Structure:

o The entire operating system breaks if just one user program malfunctions.
o Since the layers are interconnected, and in communication with one another, there is no
abstraction or data hiding.
o The operating system's operations are accessible to layers, which can result in data
tampering and system failure.
MONOLITHIC STRUCTURE
The monolithic operating system controls all aspects of the operating system's operation,
including file management, memory management, device management, and operational
operations.

The core of an operating system for computers is called the kernel (OS). All other
System components are provided with fundamental services by the kernel. The
operating system and the hardware use it as their main interface. When an operating
system is built into a single piece of hardware, such as a keyboard or mouse, the kernel
can directly access all of its resources.

The monolithic operating system is often referred to as the monolithic kernel. Multiple
programming techniques such as batch processing and time-sharing increase a
processor's usability. Working on top of the operating system and under complete
command of all hardware, the monolithic kernel performs the role of a virtual computer.
This is an old operating system that was used in banks to carry out simple tasks like
batch processing and time-sharing, which allows numerous users at different terminals
to access the Operating System.

The following diagram represents the monolithic structure:


Advantages of Monolithic Structure:

o Because layering is unnecessary and the kernel alone is responsible for managing
all operations, it is easy to design and execute.
o Due to the fact that functions like memory management, file management,
process scheduling, etc., are implemented in the same address area, the
monolithic kernel runs rather quickly when compared to other systems. Utilizing
the same address speeds up and reduces the time required for address allocation
for new processes.

Disadvantages of Monolithic Structure:

o The monolithic kernel's services are interconnected in address space and have an impact
on one another, so if any of them malfunctions, the entire system does as well.
o It is not adaptable. Therefore, launching a new service is difficult.
LAYERED STRUCTURE
The OS is separated into layers or levels in this kind of arrangement. Layer 0 (the lowest
layer) contains the hardware, and layer 1 (the highest layer) contains the user interface
(layer N). These layers are organized hierarchically, with the top-level layers making use
of the capabilities of the lower-level ones.

The functionalities of each layer are separated in this method, and abstraction is also an
option. Because layered structures are hierarchical, debugging is simpler, therefore all
lower-level layers are debugged before the upper layer is examined. As a result, the
present layer alone has to be reviewed since all the lower layers have already been
examined.

The image below shows how OS is organized into layers:

Advantages of Layered Structure:

o Work duties are separated since each layer has its own functionality, and there is some
amount of abstraction.
o Debugging is simpler because the lower layers are examined first, followed by the top
layers.

Disadvantages of Layered Structure:

o Performance is compromised in layered structures due to layering.


o Construction of the layers requires careful design because upper layers only make use of
lower layers' capabilities.

MICRO-KERNEL STRUCTURE
The operating system is created using a micro-kernel framework that strips the kernel of
any unnecessary parts. Systems and user applications are used to implement these
optional kernel components. So, Micro-Kernels is the name given to these systems that
have been developed.

Each Micro-Kernel is created separately and is kept apart from the others. As a result,
the system is now more trustworthy and secure. If one Micro-Kernel malfunctions, the
remaining operating system is unaffected and continues to function normally.

The image below shows Micro-Kernel Operating System Structure:


Advantages of Micro-Kernel Structure:

o It enables portability of the operating system across platforms.


o Due to the isolation of each Micro-Kernel, it is reliable and secure.
o The reduced size of Micro-Kernels allows for successful testing.
o The remaining operating system remains unaffected and keeps running properly even if
a component or Micro-Kernel fails.

Disadvantages of Micro-Kernel Structure:

o The performance of the system is decreased by increased inter-module communication.


o The construction of a system is complicated.
EXOKERNEL
An operating system called Exokernel was created at MIT with the goal of offering
application-level management of hardware resources. The exokernel architecture's goal
is to enable application-specific customization by separating resource management
from protection. Exokernel size tends to be minimal due to its limited operability.

Because the OS sits between the programs and the actual hardware, it will always have
an effect on the functionality, performance, and breadth of the apps that are developed
on it. By rejecting the idea that an operating system must offer abstractions upon which
to base applications, the exokernel operating system makes an effort to solve this issue.
The goal is to give developers as few restriction on the use of abstractions as possible
while yet allowing them the freedom to do so when necessary. Because of the way the
exokernel architecture is designed, a single tiny kernel is responsible for moving all
hardware abstractions into unreliable libraries known as library operating systems.
Exokernels differ from micro- and monolithic kernels in that their primary objective is to
prevent forced abstraction.

Exokernel operating systems have a number of features, including:

o Enhanced application control support.


o Splits management and security apart.
o A secure transfer of abstractions is made to an unreliable library operating system.
o Brings up a low-level interface.
o Operating systems for libraries provide compatibility and portability.

Advantages of Exokernel Structure:

o Application performance is enhanced by it.


o Accurate resource allocation and revocation enable more effective utilisation of hardware
resources.
o New operating systems can be tested and developed more easily.
o Every user-space program is permitted to utilise its own customised memory
management.

Disadvantages of Exokernel Structure:


o A decline in consistency
o Exokernel interfaces have a complex architecture.

Modular structure or approach


It is considered as the best approach for an OS. It involves designing of a
modular kernel. The kernel has only a set of core components and other
services are added as dynamically loadable modules to the kernel either during
runtime or boot time. It resembles layered structure due to the fact that each
kernel has defined and protected interfaces, but it is more flexible than a
layered structure as a module can call any other module. For example Solaris
OS is organized as shown in the figure.

VIRTUAL MACHINES (VMs)


The hardware of our personal computer, including the CPU, disc drives, RAM, and NIC
(Network Interface Card), is abstracted by a virtual machine into a variety of various
execution contexts based on our needs, giving us the impression that each execution
environment is a separate computer. A virtual box is an example of it.
Using CPU scheduling and virtual memory techniques, an operating system allows us to
execute multiple processes simultaneously while giving the impression that each one is
using a separate processor and virtual memory. System calls and a file system are
examples of extra functionalities that a process can have that the hardware is unable to
give. Instead of offering these extra features, the virtual machine method just offers an
interface that is similar to that of the most fundamental hardware. A virtual duplicate of
the computer system underneath is made available to each process.

We can develop a virtual machine for a variety of reasons, all of which are fundamentally
connected to the capacity to share the same underlying hardware while concurrently
supporting various execution environments, i.e., various operating systems.

Disk systems are the fundamental problem with the virtual machine technique. If the
actual machine only has three-disc drives but needs to host seven virtual machines, let's
imagine that. It is obvious that it is impossible to assign a disc drive to every virtual
machine because the program that creates virtual machines would require a sizable
amount of disc space in order to offer virtual memory and spooling. The provision of
virtual discs is the solution.

The result is that users get their own virtual machines. They can then use any of the
operating systems or software programs that are installed on the machine below. Virtual
machine software is concerned with programming numerous virtual machines
simultaneously into a physical machine; it is not required to take into account any user-
support software. With this configuration, it may be possible to break the challenge of
building an interactive system for several users into two manageable chunks.

Advantages of Virtual Machines:

o Due to total isolation between each virtual machine and every other virtual machine,
there are no issues with security.
o A virtual machine may offer an architecture for the instruction set that is different from
that of actual computers.
o Simple availability, accessibility, and recovery convenience.

Disadvantages of Virtual Machines:

o Depending on the workload, operating numerous virtual machines simultaneously on a


host computer may have an adverse effect on one of them.
o When it comes to hardware access, virtual computers are less effective than physical
ones.

You might also like